- Node/Express/TypeScript API under /api/v1 with JWT auth (login, refresh, logout, /me) - Prisma schema: vendors, users, roles, products, categories, taxes, transactions - SQLite for local dev; Postgres via docker-compose for production - Full CRUD routes for vendors, users, categories, taxes, products with Zod validation and RBAC - Paginated list endpoints scoped per vendor; refresh token rotation - React/TypeScript admin SPA (Vite): login, protected routing, sidebar layout - Pages: Dashboard, Catalog (tabbed Products/Categories/Taxes), Users, Vendor Settings - Shared UI: Table, Modal, FormField, Btn, PageHeader components - Multi-stage Dockerfile; docker-compose with Postgres healthcheck - Seed script with demo vendor and owner account - INSTRUCTIONS.md, ROADMAP.md, .claude/launch.json for dev server config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
61 lines
1.2 KiB
JavaScript
61 lines
1.2 KiB
JavaScript
/*!
|
|
* merge-descriptors
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
* MIT Licensed
|
|
*/
|
|
|
|
'use strict'
|
|
|
|
/**
|
|
* Module exports.
|
|
* @public
|
|
*/
|
|
|
|
module.exports = merge
|
|
|
|
/**
|
|
* Module variables.
|
|
* @private
|
|
*/
|
|
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty
|
|
|
|
/**
|
|
* Merge the property descriptors of `src` into `dest`
|
|
*
|
|
* @param {object} dest Object to add descriptors to
|
|
* @param {object} src Object to clone descriptors from
|
|
* @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties
|
|
* @returns {object} Reference to dest
|
|
* @public
|
|
*/
|
|
|
|
function merge (dest, src, redefine) {
|
|
if (!dest) {
|
|
throw new TypeError('argument dest is required')
|
|
}
|
|
|
|
if (!src) {
|
|
throw new TypeError('argument src is required')
|
|
}
|
|
|
|
if (redefine === undefined) {
|
|
// Default to true
|
|
redefine = true
|
|
}
|
|
|
|
Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) {
|
|
if (!redefine && hasOwnProperty.call(dest, name)) {
|
|
// Skip descriptor
|
|
return
|
|
}
|
|
|
|
// Copy descriptor
|
|
var descriptor = Object.getOwnPropertyDescriptor(src, name)
|
|
Object.defineProperty(dest, name, descriptor)
|
|
})
|
|
|
|
return dest
|
|
}
|