{"_id":"@adsq/jsnq","_rev":"5-3e5a6be54df6aafdc280ccb96d6a94c1","name":"@adsq/jsnq","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@adsq/jsnq","version":"0.1.0","keywords":["json","@adsq/jsnq","pipeline","query","immutable","copy-on-write","where","update","move","nested"],"license":"MIT","_id":"@adsq/jsnq@0.1.0","maintainers":[{"name":"adsq","email":"adscampaincreate@gmail.com"}],"homepage":"https://github.com/synestiqx/jsnq#readme","bugs":{"url":"https://github.com/synestiqx/jsnq/issues"},"dist":{"shasum":"696d85c7d7060c958867d95cf54e33bb8c14ac4d","tarball":"https://registry.npmjs.org/@adsq/jsnq/-/jsnq-0.1.0.tgz","fileCount":214,"integrity":"sha512-zfgTGAiDZ43TWRaVpvmboyhVM5BkS53TnQ34WK6dkCsMVQgZktKqlexSTvT14tZJV5P5VRhfRKkFdKSgA+ISdw==","signatures":[{"sig":"MEQCIEAf3s9a2UdrN7xSqxffDfEwPRrXxTWXBF5RZ2pi5+QgAiAyUDYsGmu7gDfVhF3TPtpASt5lKFJEC2gVqgcupbQMFQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":690471},"main":"./dist/synced/index.js","type":"module","types":"./dist/synced/index.d.ts","exports":{".":{"types":"./dist/synced/index.d.ts","import":"./dist/synced/index.js","require":"./dist-cjs/synced/index.js"},"./core/*":{"types":"./dist/synced/core/*.d.ts","import":"./dist/synced/core/*.js","require":"./dist-cjs/synced/core/*.js"},"./data-engine":{"types":"./dist/data-engine.d.ts","import":"./dist/data-engine.js","require":"./dist-cjs/data-engine.js"},"./operators/*":{"types":"./dist/synced/operators/*.d.ts","import":"./dist/synced/operators/*.js","require":"./dist-cjs/synced/operators/*.js"},"./package.json":"./package.json"},"gitHead":"690cb2e9a635bd6388939ca363a93ff9ad02347f","scripts":{"test":"bun run test:types && bun run test:units && bun run test:fastpath && bun run test:data-engine && bun run test:edge && bun run test:structural && bun run test:vs-native && bun run test:bench","build":"node scripts/clean-dist.mjs && npm run build:esm && npm run build:cjs","prepack":"npm run build","build:cjs":"tsc -p tsconfig.cjs.json && node scripts/write-cjs-package.mjs","build:esm":"tsc && node scripts/fix-dist-esm-extensions.mjs","test:edge":"bun test/jsnq-edge-cases.test.ts","typecheck":"tsc --noEmit","test:bench":"bun test/jsnq-pipeline-bench.ts","test:types":"tsc --noEmit --strict --target ES2022 --module ESNext --moduleResolution bundler --skipLibCheck test/types-path-contract.ts","test:units":"bun test/jsnq-match-actions.test.ts","test:fastpath":"bun test/jsnq-fastpath-parity.test.ts","test:vs-native":"bun test/jsnq-vs-native.test.ts","test:structural":"bun test/jsnq-structural-safety.test.ts","test:data-engine":"bun test/jsnq-data-engine.test.ts"},"_npmUser":{"name":"adsq","email":"adscampaincreate@gmail.com"},"repository":{"url":"git+https://github.com/synestiqx/jsnq.git","type":"git"},"_npmVersion":"11.12.1","description":"Framework-agnostic JSON pipeline engine: where/update/move/copy/insert/delete over nested JSON trees, with copy-on-write fast paths. Zero runtime dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","typesVersions":{"*":{"*":["dist/synced/index.d.ts"],"core/*":["dist/synced/core/*"],"data-engine":["dist/data-engine.d.ts"],"operators/*":["dist/synced/operators/*"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/jsnq_0.1.0_1784691543596_0.14287432098759756","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@adsq/jsnq","version":"0.1.1","keywords":["json","jsnq","pipeline","query","immutable","copy-on-write","where","update","move","nested"],"license":"MIT","_id":"@adsq/jsnq@0.1.1","maintainers":[{"name":"adsq","email":"adscampaincreate@gmail.com"}],"homepage":"https://github.com/synestiqx/jsnq#readme","bugs":{"url":"https://github.com/synestiqx/jsnq/issues"},"dist":{"shasum":"c83dbe236943d56fa3fa5c702cebd1837001cfc7","tarball":"https://registry.npmjs.org/@adsq/jsnq/-/jsnq-0.1.1.tgz","fileCount":214,"integrity":"sha512-VqmLH3LnSUdcCSGTxn4x0BrDmhw93E4xeUMy8aH115nwrVuMJOl1QcSSEIdwySms7Ie1YORwZTurwAxd8sxGLg==","signatures":[{"sig":"MEUCIDZPvbVge1LIyhqaA89LdBkOV4mxFcy1eIBalrdOha5/AiEA+1JqHyBIdG03K+vO/6U8gnYFbuYGCy64QgN7g4r3q3w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":690333},"main":"./dist/synced/index.js","type":"module","types":"./dist/synced/index.d.ts","exports":{".":{"types":"./dist/synced/index.d.ts","import":"./dist/synced/index.js","require":"./dist-cjs/synced/index.js"},"./core/*":{"types":"./dist/synced/core/*.d.ts","import":"./dist/synced/core/*.js","require":"./dist-cjs/synced/core/*.js"},"./data-engine":{"types":"./dist/data-engine.d.ts","import":"./dist/data-engine.js","require":"./dist-cjs/data-engine.js"},"./operators/*":{"types":"./dist/synced/operators/*.d.ts","import":"./dist/synced/operators/*.js","require":"./dist-cjs/synced/operators/*.js"},"./package.json":"./package.json"},"gitHead":"50f4709dbad645f70a036bce4247e11bba237744","scripts":{"test":"bun run test:types && bun run test:units && bun run test:fastpath && bun run test:data-engine && bun run test:edge && bun run test:structural && bun run test:vs-native && bun run test:bench","build":"node scripts/clean-dist.mjs && npm run build:esm && npm run build:cjs","prepack":"npm run build","build:cjs":"tsc -p tsconfig.cjs.json && node scripts/write-cjs-package.mjs","build:esm":"tsc && node scripts/fix-dist-esm-extensions.mjs","test:edge":"bun test/jsnq-edge-cases.test.ts","typecheck":"tsc --noEmit","test:bench":"bun test/jsnq-pipeline-bench.ts","test:types":"tsc --noEmit --strict --target ES2022 --module ESNext --moduleResolution bundler --skipLibCheck test/types-path-contract.ts","test:units":"bun test/jsnq-match-actions.test.ts","test:fastpath":"bun test/jsnq-fastpath-parity.test.ts","test:vs-native":"bun test/jsnq-vs-native.test.ts","test:structural":"bun test/jsnq-structural-safety.test.ts","test:data-engine":"bun test/jsnq-data-engine.test.ts"},"_npmUser":{"name":"adsq","email":"adscampaincreate@gmail.com"},"repository":{"url":"git+https://github.com/synestiqx/jsnq.git","type":"git"},"_npmVersion":"11.12.1","description":"Framework-agnostic JSON pipeline engine: where/update/move/copy/insert/delete over nested JSON trees, with copy-on-write fast paths. Zero runtime dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","typesVersions":{"*":{"*":["dist/synced/index.d.ts"],"core/*":["dist/synced/core/*"],"data-engine":["dist/data-engine.d.ts"],"operators/*":["dist/synced/operators/*"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/jsnq_0.1.1_1784694188574_0.45762046590457084","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@adsq/jsnq","version":"0.1.2","keywords":["json","jsnq","pipeline","query","immutable","copy-on-write","where","update","move","nested"],"license":"MIT","_id":"@adsq/jsnq@0.1.2","maintainers":[{"name":"adsq","email":"adscampaincreate@gmail.com"}],"homepage":"https://github.com/adsqx/jsnq#readme","bugs":{"url":"https://github.com/adsqx/jsnq/issues"},"dist":{"shasum":"47bec7d2e55e600fed3383fb79d913162491a8bf","tarball":"https://registry.npmjs.org/@adsq/jsnq/-/jsnq-0.1.2.tgz","fileCount":214,"integrity":"sha512-NdRMEVxcs9pETxLsH70b4qYDhjDMKEE/CwpY6PwF1Kq76wGoGlHcv7pHUwnwtgyEp/jfQbNmuDYq4DPL9xtwDw==","signatures":[{"sig":"MEQCIAhVD4g8EQ4glNVAVgGpRmLDCgv5RH7v1wyJ9oNzbrr9AiBXbRiZt+RVtxo2e9JeOXIeCuYgK6i2BnlULNGCQBCZPw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":690321},"main":"./dist/synced/index.js","type":"module","types":"./dist/synced/index.d.ts","exports":{".":{"types":"./dist/synced/index.d.ts","import":"./dist/synced/index.js","require":"./dist-cjs/synced/index.js"},"./core/*":{"types":"./dist/synced/core/*.d.ts","import":"./dist/synced/core/*.js","require":"./dist-cjs/synced/core/*.js"},"./data-engine":{"types":"./dist/data-engine.d.ts","import":"./dist/data-engine.js","require":"./dist-cjs/data-engine.js"},"./operators/*":{"types":"./dist/synced/operators/*.d.ts","import":"./dist/synced/operators/*.js","require":"./dist-cjs/synced/operators/*.js"},"./package.json":"./package.json"},"gitHead":"908d3f698116071023ac9781701471034533f5d4","scripts":{"test":"bun run test:types && bun run test:units && bun run test:fastpath && bun run test:data-engine && bun run test:edge && bun run test:structural && bun run test:vs-native && bun run test:bench","build":"node scripts/clean-dist.mjs && npm run build:esm && npm run build:cjs","prepack":"npm run build","build:cjs":"tsc -p tsconfig.cjs.json && node scripts/write-cjs-package.mjs","build:esm":"tsc && node scripts/fix-dist-esm-extensions.mjs","test:edge":"bun test/jsnq-edge-cases.test.ts","typecheck":"tsc --noEmit","test:bench":"bun test/jsnq-pipeline-bench.ts","test:types":"tsc --noEmit --strict --target ES2022 --module ESNext --moduleResolution bundler --skipLibCheck test/types-path-contract.ts","test:units":"bun test/jsnq-match-actions.test.ts","test:fastpath":"bun test/jsnq-fastpath-parity.test.ts","test:vs-native":"bun test/jsnq-vs-native.test.ts","test:structural":"bun test/jsnq-structural-safety.test.ts","test:data-engine":"bun test/jsnq-data-engine.test.ts"},"_npmUser":{"name":"adsq","email":"adscampaincreate@gmail.com"},"repository":{"url":"git+https://github.com/adsqx/jsnq.git","type":"git"},"_npmVersion":"11.12.1","description":"Framework-agnostic JSON pipeline engine: where/update/move/copy/insert/delete over nested JSON trees, with copy-on-write fast paths. Zero runtime dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","typesVersions":{"*":{"*":["dist/synced/index.d.ts"],"core/*":["dist/synced/core/*"],"data-engine":["dist/data-engine.d.ts"],"operators/*":["dist/synced/operators/*"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/jsnq_0.1.2_1784695808843_0.06208739318226408","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@adsq/jsnq","version":"0.1.3","keywords":["json","jsnq","pipeline","query","immutable","copy-on-write","where","update","move","nested"],"license":"MIT","_id":"@adsq/jsnq@0.1.3","maintainers":[{"name":"adsq","email":"adscampaincreate@gmail.com"}],"homepage":"https://github.com/adsqx/jsnq#readme","bugs":{"url":"https://github.com/adsqx/jsnq/issues"},"dist":{"shasum":"d88e70b62d12bb5cb9637df292d725b5e83a03eb","tarball":"https://registry.npmjs.org/@adsq/jsnq/-/jsnq-0.1.3.tgz","fileCount":214,"integrity":"sha512-1Bj/hudy4HfqatQL2+ZK8d+sNpTPZfyIQ9/g30yub/PlElzCBSU3yxfM89jlRa19vcTVvbs2UvOq0WvaXFg4bw==","signatures":[{"sig":"MEUCIQCTuKq+jO2LW+wH4K7LSw1wRn2tMfr8/0vQYE5u2LgoFQIgDXNHN2Z4BFP5/KRCcSrx7WYddQQsKbZpVwv0AsnvOAs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":692794},"main":"./dist/synced/index.js","type":"module","types":"./dist/synced/index.d.ts","exports":{".":{"types":"./dist/synced/index.d.ts","import":"./dist/synced/index.js","require":"./dist-cjs/synced/index.js"},"./core/*":{"types":"./dist/synced/core/*.d.ts","import":"./dist/synced/core/*.js","require":"./dist-cjs/synced/core/*.js"},"./data-engine":{"types":"./dist/data-engine.d.ts","import":"./dist/data-engine.js","require":"./dist-cjs/data-engine.js"},"./operators/*":{"types":"./dist/synced/operators/*.d.ts","import":"./dist/synced/operators/*.js","require":"./dist-cjs/synced/operators/*.js"},"./package.json":"./package.json"},"gitHead":"edb0a356cc6cf2e4aad9918e22070f185b6938a6","scripts":{"test":"bun run test:types && bun run test:units && bun run test:fastpath && bun run test:data-engine && bun run test:edge && bun run test:structural && bun run test:vs-native && bun run test:bench","build":"node scripts/clean-dist.mjs && npm run build:esm && npm run build:cjs","prepack":"npm run build && npm run verify:exports","build:cjs":"tsc -p tsconfig.cjs.json && node scripts/write-cjs-package.mjs","build:esm":"tsc && node scripts/fix-dist-esm-extensions.mjs","test:edge":"bun test/jsnq-edge-cases.test.ts","typecheck":"tsc --noEmit","test:bench":"bun test/jsnq-pipeline-bench.ts","test:types":"tsc --noEmit --strict --target ES2022 --module ESNext --moduleResolution bundler --skipLibCheck test/types-path-contract.ts","test:units":"bun test/jsnq-match-actions.test.ts","test:fastpath":"bun test/jsnq-fastpath-parity.test.ts","test:vs-native":"bun test/jsnq-vs-native.test.ts","verify:exports":"node scripts/verify-exports.mjs","test:structural":"bun test/jsnq-structural-safety.test.ts","test:data-engine":"bun test/jsnq-data-engine.test.ts"},"_npmUser":{"name":"adsq","email":"adscampaincreate@gmail.com"},"repository":{"url":"git+https://github.com/adsqx/jsnq.git","type":"git"},"_npmVersion":"11.12.1","description":"Framework-agnostic JSON pipeline engine: where/update/move/copy/insert/delete over nested JSON trees, with copy-on-write fast paths. Zero runtime dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","typesVersions":{"*":{"*":["dist/synced/index.d.ts"],"core/*":["dist/synced/core/*"],"data-engine":["dist/data-engine.d.ts"],"operators/*":["dist/synced/operators/*"]}},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/jsnq_0.1.3_1784741983442_0.9513869974890214","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@adsq/jsnq","version":"0.1.4","description":"Framework-agnostic JSON pipeline engine: where/update/move/copy/insert/delete over nested JSON trees, with copy-on-write fast paths. Zero runtime dependencies.","repository":{"type":"git","url":"git+https://github.com/adsqx/jsnq.git"},"homepage":"https://github.com/adsqx/jsnq#readme","bugs":{"url":"https://github.com/adsqx/jsnq/issues"},"type":"module","main":"./dist/synced/index.js","types":"./dist/synced/index.d.ts","typesVersions":{"*":{"core/*":["dist/synced/core/*"],"operators/*":["dist/synced/operators/*"],"data-engine":["dist/data-engine.d.ts"],"*":["dist/synced/index.d.ts"]}},"exports":{".":{"types":"./dist/synced/index.d.ts","import":"./dist/synced/index.js","require":"./dist-cjs/synced/index.js"},"./core/*":{"types":"./dist/synced/core/*.d.ts","import":"./dist/synced/core/*.js","require":"./dist-cjs/synced/core/*.js"},"./operators/*":{"types":"./dist/synced/operators/*.d.ts","import":"./dist/synced/operators/*.js","require":"./dist-cjs/synced/operators/*.js"},"./data-engine":{"types":"./dist/data-engine.d.ts","import":"./dist/data-engine.js","require":"./dist-cjs/data-engine.js"},"./package.json":"./package.json"},"sideEffects":false,"scripts":{"build":"node scripts/clean-dist.mjs && npm run build:esm && npm run build:cjs","build:esm":"tsc && node scripts/fix-dist-esm-extensions.mjs","build:cjs":"tsc -p tsconfig.cjs.json && node scripts/write-cjs-package.mjs","prepack":"npm run build && npm run verify:exports","typecheck":"tsc --noEmit","test":"bun run test:types && bun run test:units && bun run test:fastpath && bun run test:data-engine && bun run test:edge && bun run test:structural && bun run test:vs-native && bun run test:proto-guard && bun run test:bench","test:types":"tsc --noEmit --strict --target ES2022 --module ESNext --moduleResolution bundler --skipLibCheck test/types-path-contract.ts","test:units":"bun test/jsnq-match-actions.test.ts","test:fastpath":"bun test/jsnq-fastpath-parity.test.ts","test:data-engine":"bun test/jsnq-data-engine.test.ts","test:edge":"bun test/jsnq-edge-cases.test.ts","test:structural":"bun test/jsnq-structural-safety.test.ts","test:vs-native":"bun test/jsnq-vs-native.test.ts","test:bench":"bun test/jsnq-pipeline-bench.ts","verify:exports":"node scripts/verify-exports.mjs","test:proto-guard":"bun test/jsnq-prototype-guard.test.ts"},"keywords":["json","jsnq","pipeline","query","immutable","copy-on-write","where","update","move","nested"],"license":"MIT","devDependencies":{"typescript":"^5.4.0"},"gitHead":"77a4d0808a49b174fac5f260223bddd9f0005c19","_id":"@adsq/jsnq@0.1.4","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-Noif4+SKo8DYrK9sW3KA8cqJveN+7QOjRxCV5zkJJuJYlgWBKTczpS+f3ISjJT6xXhnVRWYc++Rr6USfmsprRA==","shasum":"85ba8cf0a88bd508e19291e5e8478a8c18e947e4","tarball":"https://registry.npmjs.org/@adsq/jsnq/-/jsnq-0.1.4.tgz","fileCount":214,"unpackedSize":694579,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFk8nHE18yq0YN/DBRauD1Ka63yOBT9l2B8pjZTK3fwdAiEAin2GFicz6jgvdbr/zfVsmZJETUmtPRkbh3QYEvA3diw="}]},"_npmUser":{"name":"adsq","email":"adscampaincreate@gmail.com"},"directories":{},"maintainers":[{"name":"adsq","email":"adscampaincreate@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jsnq_0.1.4_1784745472555_0.32337738197111365"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-22T03:39:03.415Z","modified":"2026-07-22T18:37:52.829Z","0.1.0":"2026-07-22T03:39:03.735Z","0.1.1":"2026-07-22T04:23:08.709Z","0.1.2":"2026-07-22T04:50:09.003Z","0.1.3":"2026-07-22T17:39:43.590Z","0.1.4":"2026-07-22T18:37:52.694Z"},"bugs":{"url":"https://github.com/adsqx/jsnq/issues"},"license":"MIT","homepage":"https://github.com/adsqx/jsnq#readme","keywords":["json","jsnq","pipeline","query","immutable","copy-on-write","where","update","move","nested"],"repository":{"type":"git","url":"git+https://github.com/adsqx/jsnq.git"},"description":"Framework-agnostic JSON pipeline engine: where/update/move/copy/insert/delete over nested JSON trees, with copy-on-write fast paths. Zero runtime dependencies.","maintainers":[{"name":"adsq","email":"adscampaincreate@gmail.com"}],"readme":"# jsnq\n\nFramework-independent JSON query and mutation engine used by SolidStore and Angular SignalStore. It supports flat arrays and deeply nested trees, copy-on-write host mutations, typed paths, structural moves/copies, and focused operator imports. It has no runtime dependencies.\n\n## Install\n\n```sh\nnpm install @adsq/jsnq\n# or\nbun add @adsq/jsnq\n```\n\nThe package ships tree-shakeable ESM, a CommonJS fallback, and declarations. Modern\nbundlers select `import`, Node `require()` selects the isolated CommonJS build, and both\nshare one TypeScript source.\n\n## Query And Mutate\n\n```ts\nimport JsnqPipeline from '@adsq/jsnq/core/pipeline';\nimport where from '@adsq/jsnq/operators/where';\nimport update from '@adsq/jsnq/operators/update';\n\nconst users = [\n  { id: 1, profile: { name: 'Ann' }, active: true },\n  { id: 2, profile: { name: 'Bob' }, active: false },\n];\n\nconst query = new JsnqPipeline(users).pipe(where('active', '===', true));\nconst first = query.first();\n\nconst mutation = new JsnqPipeline(users, { immutable: true })\n  .pipe(where('id', '===', 2), update('profile.name', 'Ada'));\nmutation.all();\nconst nextUsers = mutation.data;\n```\n\n`pipe()` composes immutable operator descriptors. Execution is explicit:\n\n- `all()` returns every matching result node;\n- `first()` returns the first matched value or `null`;\n- `count()` returns the number of matches;\n- `getStats()` reports traversal, action counts, timings, warnings, and operations;\n- `dryRun()` plans and measures without mutating;\n- `immutable(true)` always clones before actions, while `immutable('auto')` clones only\n  when the pipeline contains a mutation.\n\nStructural operators are independent modules:\n\n```ts\nimport moveTo from '@adsq/jsnq/operators/moveTo';\nimport copyToAll from '@adsq/jsnq/operators/copyToAll';\nimport insertTo from '@adsq/jsnq/operators/insertTo';\n```\n\n## Operator Reference\n\n| Operator | Purpose |\n| --- | --- |\n| `where(path, operator, value)` | Add an AND-combined criterion. |\n| `update(path, valueOrFn)` | Update a matched value, creating a missing path when policy allows it. |\n| `replace(path, valueOrFn)` | Replace a matched value. |\n| `mergeUpdate(path, patch, { deep })` | Shallow or deep merge into a matched object. |\n| `deleteKey(path)` | Delete a key/index from each match. |\n| `deleteElement()` | Remove each matched element from its parent container. |\n| `insert(data, mode, key)` | Insert relative to each match. |\n| `insertTo(path, data, mode, key)` | Insert into a target path. |\n| `moveTo` / `copyTo` | Move or copy matches to one path. |\n| `moveToMatches` / `copyToMatches` | Move or copy matched sources to the first selected target. |\n| `moveToAll` / `copyToAll` | Move or copy matched sources into every selected target. |\n| `moveToMatchesOverwrite` | Move matches and overwrite a selected target key. |\n\nInsertion modes are `inside`, `before`, and `after`. Built-in comparisons are `==`,\n`===`, `!=`, `!==`, `>`, `>=`, `<`, `<=`, `includes`, `!includes`, `startsWith`,\n`endsWith`, `regex`, `isArray`, and `isObject`. Multiple `where()` calls are AND-combined.\nDeep `@` criteria and nested object/array paths use the general traversal; supported flat\nshapes select copy-on-write fast paths automatically.\n\nStructural operations use a stable match set: nodes inserted by `moveTo` or `copyTo` are\nnot visited again by the same operation. Multi-source moves preserve source order after\nsafe descending-index removal. Multi-target move/copy results do not share mutable object\nreferences between targets. When an explicit object key already contains an array,\n`insertTo`, `moveTo`, and `copyTo` append to that array rather than replacing it. A\nnon-insertable target fails before source removal or success-stat updates.\n\n`moveToMatches` and `copyToMatches` intentionally use only the first target in traversal\norder. `moveToAll` and `copyToAll` use every target. In both forms, `.all()` supplies all\nmatched sources and `.first()` supplies one source. For object fan-out without an explicit\nkey, the source property name or its `id` is used. The default `overwritePolicy` is\n`'overwrite'`; choose `'skip'` or `'error'` when replacing an existing object slot is not\nacceptable.\n\nImporting one operator does not execute or instantiate the others. A pipeline, compiled predicate, path plan, and mutation result are created only when the corresponding API is called. Path plans and compiled hot paths are cached with bounded caches.\n\n## Data Engine\n\nHosts can use the same public path engine instead of duplicating traversal logic:\n\n```ts\nimport {\n  readJsonPath,\n  writeJsonPath,\n  deleteJsonPath,\n  createJsonPathPlan,\n} from '@adsq/jsnq/data-engine';\n\nconst state: Record<string, unknown> = {};\nwriteJsonPath(state, 'workspace.pages.0.title', 'Home');\nreadJsonPath(state, createJsonPathPlan('workspace.pages.0.title'));\ndeleteJsonPath(state, 'workspace.pages.0.title');\n```\n\n## Mutation Model\n\n- Generic pipelines mutate their working data; `{ immutable: true }` clones before mutation.\n- Host fast paths use copy-on-write: a new outer container and changed item are created while untouched branches retain identity.\n- Single-key flat mutations shallow-clone the changed item and preserve untouched nested references.\n- Structural operations fall back to the full traversal whenever the optimized path cannot prove semantic parity.\n- No-match immutable fast paths retain the original root identity.\n- `merge-by-key` merges values only when the configured key is present and unique on both\n  sides. Missing or duplicate keys are preserved as separate entries instead of being\n  collapsed by an ambiguous match.\n\nImportant pipeline options include `maxDepth`, `limit`, `earlyTermination`,\n`includeArrays`, `includeObjects`, `returnPaths`, `strictPathsWarn`,\n`operatorsStrict`, `overwritePolicy`, `arrayMergeStrategy`, and `trackOperations`.\n`maxDepth` defaults to `10`; raise it explicitly for deeper recursive documents.\n`overwritePolicy` governs object/path assignments, while insertion into an existing array\nis an append/splice operation and does not replace that array key.\nOptimized execution is an internal decision: unsupported or ambiguous shapes fall back to\nthe full pipeline with the same public semantics.\n\nFor production hosts that only commit the returned value, set `returnPaths: false` and\n`trackOperations: false`. This avoids diagnostic path arrays and per-match log strings;\nstore bridges do this automatically outside development diagnostics. Benchmark output\nseparates complete batches, records scanned, and applied actions: a batch that scans 10,000\nrecords is one batch, not one primitive operation.\n\n## Package Boundaries\n\n- `@adsq/jsnq`: complete public API.\n- `@adsq/jsnq/operators/<name>`: one operator.\n- `@adsq/jsnq/core/<module>`: host and advanced integration.\n- `@adsq/jsnq/data-engine`: path read/write/delete and mutation metadata.\n\n## Verify\n\n```sh\nbun run typecheck\nbun test\nbun run build\nnpm pack --dry-run\n```\n\nThe suite covers nested paths, missing keys, special JavaScript values, immutable result identity, structural operations, fast-path parity, and native-equivalent behavior.\n\n## Bundle Size\n\nMeasured from the built ESM with esbuild minification:\n\n| Entry | Minified | Gzip | Brotli |\n| --- | ---: | ---: | ---: |\n| Full JSNQ entry | 53.9 kB | 16.1 kB | 14.5 kB |\n| Individual `where` operator | 3.1 kB | 1.3 kB | 1.2 kB |\n\nImport individual operators when an application does not need the full public surface.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}