574a16d9fa
Snapshot of the working tree before cleanup. Captures: - Keysat licensing: server/license.js, /api/license/* endpoints in server/index.js, activation modal in public/index.html, embedded Ed25519 issuer key (assets/issuer.pub). - StartOS 0.4 expansion: setApiKey action, version files v0.1.1 through v0.1.15, file-models/config.json.ts, manifest updates. - Self-hosted registry server (startos-registry/). - Build/deploy scripts (bin/bump-version.sh, bin/deploy.sh, vendored yt-dlp binary), .gitignore, .deploy.env.example. - Recent design docs (KEYSAT_INTEGRATION.md, UPGRADE-DESIGN.md) — retained here so they remain recoverable when removed in the follow-up cleanup commit.
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
|
|
}
|