Beispiel
merge-descriptors 2.0.0
Verifiziertes Beispiel für npm merge-descriptors 2.0.0. Der Vertrag lief auf node 22 · linux alpine/x64 · docker und bestand: mergeDescriptors merges own…
sha256:35f140e46c88ff79fe13a131d1cd8be3c3b38a3bbfb8e5bb62f2100adb8d1496
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
windows 11 x64 npm
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-19 |
Fall
HOW- Ziel
- verify pkg:npm/merge-descriptors@2.0.0
- Pakete
- Erstellt
- 2026-08-18T18:23:00Z
Contract
- mergeDescriptors merges own properties from source to destination object
- mergeDescriptors returns the modified destination object
- mergeDescriptors overwrites existing destination properties by default
- mergeDescriptors skips existing destination properties when overwrite is false
- mergeDescriptors copies getter and setter accessors without invoking them during merge
- mergeDescriptors copies non-enumerable properties and preserves property flags
- mergeDescriptors throws TypeError when destination or source is missing or falsy
- wrapper merge matches direct mergeDescriptors behavior
Dateien
- PROMPT.md
- csx.json
- index.mjs
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Quelltext
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:npm/merge-descriptors@2.0.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/merge-descriptors@2.0.0
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@11.8.0
- runtime: node@24.13.1
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:945110b5d6c14dbaa1c532a563020356991ce9f9bcd65473be4670f232ae950b","constraints":{"executionContext":"node"},"contract":["mergeDescriptors merges own properties from source to destination object","mergeDescriptors returns the modified destination object","mergeDescriptors overwrites existing destination properties by default","mergeDescriptors skips existing destination properties when overwrite is false","mergeDescriptors copies getter and setter accessors without invoking them during merge","mergeDescriptors copies non-enumerable properties and preserves property flags","mergeDescriptors throws TypeError when destination or source is missing or falsy","wrapper merge matches direct mergeDescriptors behavior"],"goal":"verify pkg:npm/merge-descriptors@2.0.0","kind":"HOW","packages":["pkg:npm/merge-descriptors@2.0.0"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","ecosystem":"npm","os":"windows","osVersionBucket":"11","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/merge-descriptors@2.0.0"],"schemaVersion":1,"verifierAdapter":"node-typescript@1"}
import mergeDescriptors from 'merge-descriptors';
/**
* Merges source properties into destination object.
* @param {object} destination - Target object to receive properties.
* @param {object} source - Source object to copy properties from.
* @param {boolean} [overwrite=true] - Whether to overwrite existing properties.
* @returns {object} The mutated destination object.
*/
export function merge(destination, source, overwrite = true) {
return mergeDescriptors(destination, source, overwrite);
}
export default mergeDescriptors;
{
"name": "sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample",
"version": "1.0.0",
"dependencies": {
"merge-descriptors": "2.0.0"
}
},
"node_modules/merge-descriptors": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
"integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
}
}
}
{
"name": "sample",
"version": "1.0.0",
"type": "module",
"dependencies": {
"merge-descriptors": "2.0.0"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/merge-descriptors@2.0.0",
"kind": "HOW",
"packages": [
"pkg:npm/merge-descriptors@2.0.0"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@11.8.0",
"runtime": "node@24.13.1"
}
}
import assert from 'node:assert/strict';
import mergeDescriptors from 'merge-descriptors';
import { merge } from '../index.mjs';
// Case 1: mergeDescriptors merges own properties from source to destination object
{
const dest = { a: 1 };
const src = { b: 2, c: 'hello' };
const result = mergeDescriptors(dest, src);
assert.equal(result, dest, 'result should be the destination object');
assert.equal(dest.a, 1);
assert.equal(dest.b, 2);
assert.equal(dest.c, 'hello');
}
// Case 2: mergeDescriptors returns the modified destination object
{
const target = {};
const source = { key: 'value' };
const returned = mergeDescriptors(target, source);
assert.strictEqual(returned, target, 'returned reference must strictly equal target');
assert.equal(returned.key, 'value');
}
// Case 3: mergeDescriptors overwrites existing destination properties by default
{
const dest = { count: 1, name: 'original' };
const src = { count: 42, name: 'updated' };
mergeDescriptors(dest, src);
assert.equal(dest.count, 42);
assert.equal(dest.name, 'updated');
}
// Case 4: mergeDescriptors skips existing destination properties when overwrite is false
{
const dest = { x: 10, y: 20 };
const src = { x: 99, y: 88, z: 30 };
mergeDescriptors(dest, src, false);
assert.equal(dest.x, 10, 'dest.x should not be overwritten');
assert.equal(dest.y, 20, 'dest.y should not be overwritten');
assert.equal(dest.z, 30, 'dest.z should be added');
}
// Case 5: mergeDescriptors copies getter and setter accessors without invoking them during merge
{
let getterCalls = 0;
let storedValue = 'init';
const src = {
get val() {
getterCalls++;
return storedValue;
},
set val(newVal) {
storedValue = newVal;
}
};
const dest = {};
mergeDescriptors(dest, src);
assert.equal(getterCalls, 0, 'getter should not be called during mergeDescriptors');
const desc = Object.getOwnPropertyDescriptor(dest, 'val');
assert.equal(typeof desc.get, 'function');
assert.equal(typeof desc.set, 'function');
assert.equal(dest.val, 'init');
assert.equal(getterCalls, 1);
dest.val = 'modified';
assert.equal(dest.val, 'modified');
assert.equal(getterCalls, 2);
}
// Case 6: mergeDescriptors copies non-enumerable properties and preserves property flags
{
const src = {};
Object.defineProperty(src, 'hidden', {
value: 'secret',
writable: false,
enumerable: false,
configurable: true
});
const dest = {};
mergeDescriptors(dest, src);
assert.equal(dest.hidden, 'secret');
const desc = Object.getOwnPropertyDescriptor(dest, 'hidden');
assert.equal(desc.enumerable, false);
assert.equal(desc.writable, false);
assert.equal(desc.configurable, true);
}
// Case 7: mergeDescriptors throws TypeError when destination or source is missing or falsy
{
assert.throws(
() => mergeDescriptors(null, { a: 1 }),
TypeError,
'null destination should throw TypeError'
);
assert.throws(
() => mergeDescriptors(undefined, { a: 1 }),
TypeError,
'undefined destination should throw TypeError'
);
assert.throws(
() => mergeDescriptors({}, null),
TypeError,
'null source should throw TypeError'
);
assert.throws(
() => mergeDescriptors({}, undefined),
TypeError,
'undefined source should throw TypeError'
);
}
// Case 8: wrapper merge matches direct mergeDescriptors behavior
{
const dest = { initial: true };
const src = { added: 123 };
const res = merge(dest, src);
assert.strictEqual(res, dest);
assert.equal(dest.added, 123);
const destNoOverwrite = { val: 1 };
merge(destNoOverwrite, { val: 2, other: 3 }, false);
assert.equal(destNoOverwrite.val, 1);
assert.equal(destNoOverwrite.other, 3);
}
console.log('PASS: all merge-descriptors contract assertions passed');
Ursprungs-Seeder
anonym