{"_id":"@bernierllc/nevar-evaluator","_rev":"5-d476ed23ff257ad2b483e564d0418814","name":"@bernierllc/nevar-evaluator","dist-tags":{"latest":"0.5.0"},"versions":{"0.0.1":{"name":"@bernierllc/nevar-evaluator","version":"0.0.1","keywords":["oidc","trusted-publishing","setup"],"_id":"@bernierllc/nevar-evaluator@0.0.1","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"d934f9ad8e56d1a958e25bacd09673031ee4aad7","tarball":"https://registry.npmjs.org/@bernierllc/nevar-evaluator/-/nevar-evaluator-0.0.1.tgz","fileCount":2,"integrity":"sha512-0iBclkv1dVMJreyKTchlTVEw1fegYgvsI6XUK5kHwXImOGtAPxNER7weMd0EwgzON8oMTfdQZi0p/3spx6Azug==","signatures":[{"sig":"MEQCIAn+S1ukipAnzPwEpwJ2JtytPH5LQAU2OVpyWwBCj4w3AiAV4jgl/XH/511QyatCgIDqKBcEVMx6qrT6daxSJLz0NQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2071},"_npmUser":{"name":"mkbernier","email":"mkbernier@gmail.com"},"_npmVersion":"11.11.0","description":"OIDC trusted publishing setup package for @bernierllc/nevar-evaluator","directories":{},"_nodeVersion":"25.8.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nevar-evaluator_0.0.1_1774655739736_0.19488081607064256","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@bernierllc/nevar-evaluator","version":"0.1.0","keywords":["nevar","rules-engine","evaluator","condition-tree","evaluation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/nevar-evaluator@0.1.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"homepage":"https://github.com/bernierllc/tools#readme","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"dist":{"shasum":"d7410233f6c20ab8c455f9a0d515a42b617fb5c3","tarball":"https://registry.npmjs.org/@bernierllc/nevar-evaluator/-/nevar-evaluator-0.1.0.tgz","fileCount":6,"integrity":"sha512-gOsWvRCeUSsaP3skj7YXjw7oGq/Fo9wOJ0IV47OMOeSTPk3sLLEotiGWR3+l/RQ+SpAe+ykFGcC08fGNn3i0cA==","signatures":[{"sig":"MEUCIQC8SfTYst/BDu97qUQCHi9l6Lq7JK4prQ/Sb0xtxoga5AIgXCRKORE2icwn1nvwQih9TfVb/S/JrlWkZHj/7DuYark=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11366},"main":"dist/index.js","_from":"file:bernierllc-nevar-evaluator-0.1.0.tgz","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src __tests__ --ext .ts","test":"jest","build":"tsc","clean":"rimraf dist","prebuild":"npm run clean","test:run":"jest","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1f1d3ce8-0848-4615-b8a1-4414f9c2f566"}},"_resolved":"/home/runner/work/tools/tools/packages/core/nevar-evaluator/bernierllc-nevar-evaluator-0.1.0.tgz","_integrity":"sha512-gOsWvRCeUSsaP3skj7YXjw7oGq/Fo9wOJ0IV47OMOeSTPk3sLLEotiGWR3+l/RQ+SpAe+ykFGcC08fGNn3i0cA==","repository":{"url":"git+https://github.com/bernierllc/tools.git","type":"git","directory":"packages/core/nevar-evaluator"},"_npmVersion":"11.12.1","description":"Evaluates condition trees against a flat context using an operator registry for the Nevar rules engine","directories":{},"_nodeVersion":"20.20.1","dependencies":{"@bernierllc/nevar-types":"0.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nevar-evaluator_0.1.0_1774888788320_0.9553346287385827","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@bernierllc/nevar-evaluator","version":"0.2.0","keywords":["nevar","rules-engine","evaluator","condition-tree","evaluation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/nevar-evaluator@0.2.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"homepage":"https://github.com/bernierllc/tools#readme","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"dist":{"shasum":"a20316baf30427fc958361edc87be2473ad175f6","tarball":"https://registry.npmjs.org/@bernierllc/nevar-evaluator/-/nevar-evaluator-0.2.0.tgz","fileCount":6,"integrity":"sha512-Rs9/aBM4njPBo6hpDKpVK58F84GisckT96jE+ZziBUPHhcih/SrDvLkeGd99maLSr6IX64t2tv2RlaFb48XhKQ==","signatures":[{"sig":"MEQCIFaq4X6/+n86B4GynblUYANt8irNdQvp0mCFVIwKMUEXAiAwqH4SUj8nbZVTtHLM71CLO6YTG6dkzgFGp3san9aqmg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11366},"main":"dist/index.js","_from":"file:bernierllc-nevar-evaluator-0.2.0.tgz","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src __tests__ --ext .ts","test":"jest","build":"tsc","clean":"rimraf dist","prebuild":"npm run clean","test:run":"jest","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1f1d3ce8-0848-4615-b8a1-4414f9c2f566"}},"_resolved":"/home/runner/work/tools/tools/packages/core/nevar-evaluator/bernierllc-nevar-evaluator-0.2.0.tgz","_integrity":"sha512-Rs9/aBM4njPBo6hpDKpVK58F84GisckT96jE+ZziBUPHhcih/SrDvLkeGd99maLSr6IX64t2tv2RlaFb48XhKQ==","repository":{"url":"git+https://github.com/bernierllc/tools.git","type":"git","directory":"packages/core/nevar-evaluator"},"_npmVersion":"11.14.1","description":"Evaluates condition trees against a flat context using an operator registry for the Nevar rules engine","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@bernierllc/nevar-types":"0.2.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nevar-evaluator_0.2.0_1779133537040_0.12090885978994059","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@bernierllc/nevar-evaluator","version":"0.4.0","keywords":["nevar","rules-engine","evaluator","condition-tree","evaluation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/nevar-evaluator@0.4.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"homepage":"https://github.com/bernierllc/tools#readme","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"dist":{"shasum":"4b430b680d2c2fd4616a7c13049042b279a24847","tarball":"https://registry.npmjs.org/@bernierllc/nevar-evaluator/-/nevar-evaluator-0.4.0.tgz","fileCount":8,"integrity":"sha512-JjJbI1+ms+EP73cwkjEkar/krPbJcwIm227mHKlAI08VHBhQbpOxIAFFur39SH7Zbxwt2nHPrZtuNCEVqOkyqA==","signatures":[{"sig":"MEYCIQDerhoqjcCv8vYj+Tt6kEQkI28auPu6FrD7b1hh2lpmxAIhANBmQQfTpgDZ5BMmTaPvH4I8oL0NCgUNP8b8XW3McJWB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13111},"main":"dist/index.js","_from":"file:bernierllc-nevar-evaluator-0.4.0.tgz","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src __tests__ --ext .ts","test":"jest","build":"tsc","clean":"rimraf dist","prebuild":"npm run clean","test:run":"jest","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1f1d3ce8-0848-4615-b8a1-4414f9c2f566"}},"_resolved":"/home/runner/work/tools/tools/packages/core/nevar-evaluator/bernierllc-nevar-evaluator-0.4.0.tgz","_integrity":"sha512-JjJbI1+ms+EP73cwkjEkar/krPbJcwIm227mHKlAI08VHBhQbpOxIAFFur39SH7Zbxwt2nHPrZtuNCEVqOkyqA==","repository":{"url":"git+https://github.com/bernierllc/tools.git","type":"git","directory":"packages/core/nevar-evaluator"},"_npmVersion":"11.14.1","description":"Evaluates condition trees against a flat context using an operator registry for the Nevar rules engine","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@bernierllc/nevar-types":"0.3.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nevar-evaluator_0.4.0_1779241265102_0.43151631563043846","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@bernierllc/nevar-evaluator","version":"0.5.0","description":"Evaluates condition trees against a flat context using an operator registry for the Nevar rules engine","main":"dist/index.js","types":"dist/index.d.ts","keywords":["nevar","rules-engine","evaluator","condition-tree","evaluation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"engines":{"node":">=16.0.0"},"repository":{"type":"git","url":"git+https://github.com/bernierllc/tools.git","directory":"packages/core/nevar-evaluator"},"dependencies":{"@bernierllc/nevar-types":"0.4.0"},"devDependencies":{"@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","jest":"^29.5.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0"},"scripts":{"build":"tsc","prebuild":"npm run clean","clean":"rimraf dist","test":"jest","test:run":"jest","test:coverage":"jest --coverage","lint":"eslint src __tests__ --ext .ts"},"_id":"@bernierllc/nevar-evaluator@0.5.0","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"homepage":"https://github.com/bernierllc/tools#readme","_integrity":"sha512-MA+DUgFgoNKeOtEfUki1fmWsAGU3S3RVWL0hHbzXv2LhfeJNBQK1YaQNykQUm0wQ3R8VkVc+XITukUjqi5ZEcQ==","_resolved":"/home/runner/work/tools/tools/packages/core/nevar-evaluator/bernierllc-nevar-evaluator-0.5.0.tgz","_from":"file:bernierllc-nevar-evaluator-0.5.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"11.14.1","dist":{"integrity":"sha512-MA+DUgFgoNKeOtEfUki1fmWsAGU3S3RVWL0hHbzXv2LhfeJNBQK1YaQNykQUm0wQ3R8VkVc+XITukUjqi5ZEcQ==","shasum":"2da3e0b370e1bc0c4fa9dc320e8eaf0cf6289c84","tarball":"https://registry.npmjs.org/@bernierllc/nevar-evaluator/-/nevar-evaluator-0.5.0.tgz","fileCount":8,"unpackedSize":13111,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCroLeqFFWEZZP9LQsBJXGIQvEim8glsHI1YDkHOP9rZAIhAKXuKIsvyNvp94kjaSSYArNOAcYX4HWQWzILVXBUEEr9"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1f1d3ce8-0848-4615-b8a1-4414f9c2f566"}},"directories":{},"maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nevar-evaluator_0.5.0_1779250015849_0.7706842381115306"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T23:55:39.634Z","modified":"2026-05-20T04:06:56.134Z","0.0.1":"2026-03-27T23:55:39.899Z","0.1.0":"2026-03-30T16:39:48.449Z","0.2.0":"2026-05-18T19:45:37.190Z","0.4.0":"2026-05-20T01:41:05.274Z","0.5.0":"2026-05-20T04:06:56.000Z"},"bugs":{"url":"https://github.com/bernierllc/tools/issues"},"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/bernierllc/tools#readme","keywords":["nevar","rules-engine","evaluator","condition-tree","evaluation"],"repository":{"type":"git","url":"git+https://github.com/bernierllc/tools.git","directory":"packages/core/nevar-evaluator"},"description":"Evaluates condition trees against a flat context using an operator registry for the Nevar rules engine","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"readme":"# @bernierllc/nevar-evaluator\n\nEvaluates condition trees against a flat context using an operator registry for the Nevar rules engine.\n\n## Installation\n\n```bash\nnpm install @bernierllc/nevar-evaluator\n```\n\n## Usage\n\n```typescript\nimport { evaluate, resolveField } from '@bernierllc/nevar-evaluator';\nimport type { OperatorLookup } from '@bernierllc/nevar-evaluator';\nimport type { ConditionGroup } from '@bernierllc/nevar-types';\n\n// Any object implementing OperatorLookup (e.g. OperatorRegistry from nevar-operator-registry)\nconst operators: OperatorLookup = {\n  has: (name) => name === 'gte',\n  evaluate: (name, field, target) => (field as number) >= (target as number),\n};\n\nconst tree: ConditionGroup = {\n  operator: 'AND',\n  conditions: [\n    { field: 'user.age', op: 'gte', value: 18 },\n  ],\n};\n\nconst result = evaluate(tree, { user: { age: 21 } }, operators);\n// result.matched === true\n// result.trace === [{ field: 'user.age', op: 'gte', expected: 18, actual: 21, matched: true }]\n\n// Resolve a dot-path field from a nested object\nconst value = resolveField({ user: { name: 'Alice' } }, 'user.name');\n// 'Alice'\n```\n\n## API\n\n### `evaluate(tree, context, operators)`\n\nRecursively evaluates a condition tree (AND / OR / NOT groups) against a context object. Returns a boolean match result and a trace of every condition evaluated.\n\n**Parameters:**\n- `tree: ConditionGroup` - The root condition group to evaluate\n- `context: Record<string, unknown>` - Key-value context to evaluate against\n- `operators: OperatorLookup` - Operator lookup for resolving and evaluating operators\n\n**Returns:** `EvaluationResult` with `matched: boolean` and `trace: EvaluationTrace[]`\n\n**Throws:** `NevarEvaluationError` if an unknown operator is encountered.\n\n### `resolveField(context, fieldPath)`\n\nResolves a dot-notation field path against a context object. Returns `undefined` if any segment is missing.\n\n**Parameters:**\n- `context: Record<string, unknown>` - The context object\n- `fieldPath: string` - Dot-notation path (e.g. `\"user.name\"`)\n\n**Returns:** `unknown` - The resolved value or `undefined`\n\n### `OperatorLookup` (type)\n\nInterface for looking up and evaluating operators. Decouples the evaluator from a specific operator registry implementation.\n\n- `evaluate(name: string, fieldValue: unknown, targetValue: unknown): boolean`\n- `has(name: string): boolean`\n\n## Integration Documentation\n\n### Logger Integration\nThis package does not integrate with `@bernierllc/logger`. As a core package, logger integration is optional and not included by default. Consumers should handle logging at the service layer.\n\n### NeverHub Integration\nThis package does not integrate with `@bernierllc/neverhub-adapter`. As a core package, NeverHub integration is not applicable. NeverHub registration should be handled by service-layer packages that compose this package.\n\n## License\n\nCopyright (c) 2025 Bernier LLC. All rights reserved.\n","readmeFilename":"README.md"}