@robinpath/assert
Advanced tools
| /** | ||
| * RobinPath Assert Module (Node port) | ||
| * | ||
| * Testing assertions for values — equality, truthiness, type checks, inclusion, | ||
| * regex match, length, property existence, and numeric comparisons. Pure | ||
| * helpers with no side effects, no network, no credentials. | ||
| * | ||
| * Exposes `configureAssert(host)` for parity with other modules; the host | ||
| * reference is unused. | ||
| */ | ||
| import type { BuiltinHandler, FunctionMetadata, ModuleHost, ModuleMetadata } from "@robinpath/core"; | ||
| export declare function configureAssert(h: ModuleHost): void; | ||
| export declare const AssertFunctions: Record<string, BuiltinHandler>; | ||
| export declare const AssertFunctionMetadata: Record<string, FunctionMetadata>; | ||
| export declare const AssertModuleMetadata: ModuleMetadata; | ||
| //# sourceMappingURL=assert.d.ts.map |
| {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,cAAc,EAEf,MAAM,iBAAiB,CAAC;AAKzB,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAEnD;AAmLD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAgB1D,CAAC;AAoCF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAicnE,CAAC;AAIF,eAAO,MAAM,oBAAoB,EAAE,cAiDlC,CAAC"} |
+706
| /** | ||
| * RobinPath Assert Module (Node port) | ||
| * | ||
| * Testing assertions for values — equality, truthiness, type checks, inclusion, | ||
| * regex match, length, property existence, and numeric comparisons. Pure | ||
| * helpers with no side effects, no network, no credentials. | ||
| * | ||
| * Exposes `configureAssert(host)` for parity with other modules; the host | ||
| * reference is unused. | ||
| */ | ||
| // ── Module-local state (populated by configure hook) ──────────────────── | ||
| const state = {}; | ||
| export function configureAssert(h) { | ||
| state.host = h; | ||
| } | ||
| // ── Helpers ───────────────────────────────────────────────────────────── | ||
| function deepEqual(a, b) { | ||
| if (a === b) | ||
| return true; | ||
| if (a == null || b == null) | ||
| return false; | ||
| if (typeof a !== typeof b) | ||
| return false; | ||
| if (Array.isArray(a) && Array.isArray(b)) { | ||
| if (a.length !== b.length) | ||
| return false; | ||
| return a.every((val, i) => deepEqual(val, b[i])); | ||
| } | ||
| if (typeof a === "object" && typeof b === "object") { | ||
| const keysA = Object.keys(a); | ||
| const keysB = Object.keys(b); | ||
| if (keysA.length !== keysB.length) | ||
| return false; | ||
| return keysA.every((key) => deepEqual(a[key], b[key])); | ||
| } | ||
| return false; | ||
| } | ||
| // ── Handlers ──────────────────────────────────────────────────────────── | ||
| const equal = (args) => { | ||
| if (args[0] !== args[1]) { | ||
| throw new Error(`Expected ${JSON.stringify(args[0])} to equal ${JSON.stringify(args[1])}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const notEqual = (args) => { | ||
| if (args[0] === args[1]) { | ||
| throw new Error(`Expected values to not be equal: ${JSON.stringify(args[0])}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const deepEqualHandler = (args) => { | ||
| if (!deepEqual(args[0], args[1])) { | ||
| throw new Error(`Expected deep equality.\nActual: ${JSON.stringify(args[0])}\nExpected: ${JSON.stringify(args[1])}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const truthy = (args) => { | ||
| if (!args[0]) { | ||
| throw new Error(`Expected truthy value, got: ${JSON.stringify(args[0])}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const falsy = (args) => { | ||
| if (args[0]) { | ||
| throw new Error(`Expected falsy value, got: ${JSON.stringify(args[0])}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const isNull = (args) => { | ||
| if (args[0] != null) { | ||
| throw new Error(`Expected null/undefined, got: ${JSON.stringify(args[0])}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const isNotNull = (args) => { | ||
| if (args[0] == null) { | ||
| throw new Error("Expected non-null value, got null/undefined"); | ||
| } | ||
| return true; | ||
| }; | ||
| const isType = (args) => { | ||
| const actual = typeof args[0]; | ||
| const expected = String(args[1] ?? ""); | ||
| if (actual !== expected) { | ||
| throw new Error(`Expected type "${expected}", got "${actual}"`); | ||
| } | ||
| return true; | ||
| }; | ||
| const includes = (args) => { | ||
| const haystack = args[0]; | ||
| const needle = args[1]; | ||
| if (typeof haystack === "string") { | ||
| if (!haystack.includes(String(needle))) { | ||
| throw new Error(`Expected string to include "${String(needle)}"`); | ||
| } | ||
| } | ||
| else if (Array.isArray(haystack)) { | ||
| if (!haystack.includes(needle)) { | ||
| throw new Error(`Expected array to include ${JSON.stringify(needle)}`); | ||
| } | ||
| } | ||
| else { | ||
| throw new Error("First argument must be a string or array"); | ||
| } | ||
| return true; | ||
| }; | ||
| const matches = (args) => { | ||
| const str = String(args[0] ?? ""); | ||
| const pattern = new RegExp(String(args[1] ?? "")); | ||
| if (!pattern.test(str)) { | ||
| throw new Error(`Expected "${str}" to match pattern ${String(pattern)}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const throws = (args) => { | ||
| const fn = args[0]; | ||
| if (typeof fn === "function") { | ||
| try { | ||
| fn(); | ||
| return false; | ||
| } | ||
| catch { | ||
| return true; | ||
| } | ||
| } | ||
| throw new Error("First argument must be a function"); | ||
| }; | ||
| const lengthOf = (args) => { | ||
| const value = args[0]; | ||
| const expected = Number(args[1]); | ||
| const actual = typeof value === "string" | ||
| ? value.length | ||
| : Array.isArray(value) | ||
| ? value.length | ||
| : -1; | ||
| if (actual !== expected) { | ||
| throw new Error(`Expected length ${expected}, got ${actual}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const hasProperty = (args) => { | ||
| const obj = args[0]; | ||
| const prop = String(args[1] ?? ""); | ||
| if (!obj || typeof obj !== "object" || !(prop in obj)) { | ||
| throw new Error(`Expected object to have property "${prop}"`); | ||
| } | ||
| return true; | ||
| }; | ||
| const isAbove = (args) => { | ||
| const value = Number(args[0]); | ||
| const threshold = Number(args[1]); | ||
| if (value <= threshold) { | ||
| throw new Error(`Expected ${value} to be above ${threshold}`); | ||
| } | ||
| return true; | ||
| }; | ||
| const isBelow = (args) => { | ||
| const value = Number(args[0]); | ||
| const threshold = Number(args[1]); | ||
| if (value >= threshold) { | ||
| throw new Error(`Expected ${value} to be below ${threshold}`); | ||
| } | ||
| return true; | ||
| }; | ||
| // ── Exports: functions map ────────────────────────────────────────────── | ||
| export const AssertFunctions = { | ||
| equal, | ||
| notEqual, | ||
| deepEqual: deepEqualHandler, | ||
| truthy, | ||
| falsy, | ||
| isNull, | ||
| isNotNull, | ||
| isType, | ||
| includes, | ||
| matches, | ||
| throws, | ||
| lengthOf, | ||
| hasProperty, | ||
| isAbove, | ||
| isBelow, | ||
| }; | ||
| // ── Shared parameter descriptors ──────────────────────────────────────── | ||
| const actualParam = { | ||
| name: "actual", | ||
| title: "Actual", | ||
| description: "Value under test.", | ||
| dataType: "any", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }; | ||
| const expectedParam = { | ||
| name: "expected", | ||
| title: "Expected", | ||
| description: "Value the actual value should match.", | ||
| dataType: "any", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }; | ||
| const valueParam = { | ||
| name: "value", | ||
| title: "Value", | ||
| description: "Value to check.", | ||
| dataType: "any", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }; | ||
| // ── Exports: function metadata ────────────────────────────────────────── | ||
| export const AssertFunctionMetadata = { | ||
| equal: { | ||
| title: "Assert equal", | ||
| summary: "Assert two values are strictly equal (===)", | ||
| description: "Strict equality check. Throws if the two values are not identical by ===.", | ||
| group: "equality", | ||
| action: "read", | ||
| icon: "check", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "equal", "test"], | ||
| parameters: [actualParam, expectedParam], | ||
| returnType: "boolean", | ||
| returnDescription: "True if equal; throws otherwise.", | ||
| errors: { | ||
| assertion_failed: "The two values are not strictly equal.", | ||
| }, | ||
| examples: [ | ||
| { title: "Compare numbers", code: "assert.equal $a $b" }, | ||
| ], | ||
| example: "assert.equal $a $b", | ||
| }, | ||
| notEqual: { | ||
| title: "Assert not equal", | ||
| summary: "Assert two values are not equal", | ||
| description: "Throws if the two values are strictly equal (===).", | ||
| group: "equality", | ||
| action: "read", | ||
| icon: "x", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "notEqual", "test"], | ||
| parameters: [ | ||
| actualParam, | ||
| { ...expectedParam, description: "Value the actual value should not match." }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if not equal; throws otherwise.", | ||
| errors: { assertion_failed: "The two values are strictly equal." }, | ||
| examples: [{ title: "Ensure values differ", code: "assert.notEqual $a $b" }], | ||
| example: "assert.notEqual $a $b", | ||
| }, | ||
| deepEqual: { | ||
| title: "Assert deep equal", | ||
| summary: "Assert deep equality of two values", | ||
| description: "Recursively compares objects and arrays. Throws if any leaf differs.", | ||
| group: "equality", | ||
| action: "read", | ||
| icon: "check", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "deepEqual", "test"], | ||
| parameters: [ | ||
| { ...actualParam, formInputType: "json", language: "json", rows: 4 }, | ||
| { ...expectedParam, formInputType: "json", language: "json", rows: 4 }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if deeply equal; throws otherwise.", | ||
| errors: { assertion_failed: "Values are not deeply equal." }, | ||
| examples: [ | ||
| { title: "Compare objects", code: "assert.deepEqual $obj1 $obj2" }, | ||
| ], | ||
| example: "assert.deepEqual $obj1 $obj2", | ||
| }, | ||
| truthy: { | ||
| title: "Assert truthy", | ||
| summary: "Assert value is truthy", | ||
| description: "Throws if the value coerces to false.", | ||
| group: "boolean", | ||
| action: "read", | ||
| icon: "check", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "truthy", "test"], | ||
| parameters: [valueParam], | ||
| returnType: "boolean", | ||
| returnDescription: "True if truthy; throws otherwise.", | ||
| errors: { assertion_failed: "Value is falsy." }, | ||
| examples: [{ title: "Check value", code: "assert.truthy $val" }], | ||
| example: "assert.truthy $val", | ||
| }, | ||
| falsy: { | ||
| title: "Assert falsy", | ||
| summary: "Assert value is falsy", | ||
| description: "Throws if the value coerces to true.", | ||
| group: "boolean", | ||
| action: "read", | ||
| icon: "x", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "falsy", "test"], | ||
| parameters: [valueParam], | ||
| returnType: "boolean", | ||
| returnDescription: "True if falsy; throws otherwise.", | ||
| errors: { assertion_failed: "Value is truthy." }, | ||
| examples: [{ title: "Check value", code: "assert.falsy $val" }], | ||
| example: "assert.falsy $val", | ||
| }, | ||
| isNull: { | ||
| title: "Assert null", | ||
| summary: "Assert value is null or undefined", | ||
| description: "Throws unless the value is null or undefined.", | ||
| group: "boolean", | ||
| action: "read", | ||
| icon: "slash", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "null", "test"], | ||
| parameters: [valueParam], | ||
| returnType: "boolean", | ||
| returnDescription: "True if null/undefined; throws otherwise.", | ||
| errors: { assertion_failed: "Value is not null/undefined." }, | ||
| examples: [{ title: "Check null", code: "assert.isNull $val" }], | ||
| example: "assert.isNull $val", | ||
| }, | ||
| isNotNull: { | ||
| title: "Assert not null", | ||
| summary: "Assert value is not null/undefined", | ||
| description: "Throws if the value is null or undefined.", | ||
| group: "boolean", | ||
| action: "read", | ||
| icon: "check", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "notNull", "test"], | ||
| parameters: [valueParam], | ||
| returnType: "boolean", | ||
| returnDescription: "True if not null; throws otherwise.", | ||
| errors: { assertion_failed: "Value is null/undefined." }, | ||
| examples: [{ title: "Check not null", code: "assert.isNotNull $val" }], | ||
| example: "assert.isNotNull $val", | ||
| }, | ||
| isType: { | ||
| title: "Assert type", | ||
| summary: "Assert typeof value matches expected type", | ||
| description: "Uses JavaScript typeof: 'string', 'number', 'boolean', 'object', 'function', 'undefined'.", | ||
| group: "type", | ||
| action: "read", | ||
| icon: "type", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "type", "test"], | ||
| parameters: [ | ||
| valueParam, | ||
| { | ||
| name: "type", | ||
| title: "Type", | ||
| description: "Expected type string (string, number, boolean, object, function, undefined).", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "string", | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if type matches; throws otherwise.", | ||
| errors: { assertion_failed: "typeof did not match expected type." }, | ||
| examples: [{ title: "Check type", code: 'assert.isType $val "string"' }], | ||
| example: 'assert.isType $val "string"', | ||
| }, | ||
| includes: { | ||
| title: "Assert includes", | ||
| summary: "Assert array/string includes a value", | ||
| description: "For strings, performs substring check. For arrays, performs === member check.", | ||
| group: "containment", | ||
| action: "read", | ||
| icon: "search", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "includes", "test"], | ||
| parameters: [ | ||
| { | ||
| name: "haystack", | ||
| title: "Haystack", | ||
| description: "Array or string to search.", | ||
| dataType: "any", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "needle", | ||
| title: "Needle", | ||
| description: "Value to find.", | ||
| dataType: "any", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if included; throws otherwise.", | ||
| errors: { assertion_failed: "Haystack does not contain needle." }, | ||
| examples: [ | ||
| { title: "Substring", code: 'assert.includes "hello" "ell"' }, | ||
| ], | ||
| example: 'assert.includes "hello" "ell"', | ||
| }, | ||
| matches: { | ||
| title: "Assert matches regex", | ||
| summary: "Assert string matches a regex pattern", | ||
| description: "Tests the string against a JavaScript RegExp built from the pattern.", | ||
| group: "containment", | ||
| action: "read", | ||
| icon: "regex", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "regex", "match", "test"], | ||
| parameters: [ | ||
| { | ||
| name: "str", | ||
| title: "String", | ||
| description: "String to test.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "pattern", | ||
| title: "Pattern", | ||
| description: "Regex pattern (as plain string, no delimiters).", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "^hello", | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if pattern matches; throws otherwise.", | ||
| errors: { assertion_failed: "String does not match the pattern." }, | ||
| examples: [ | ||
| { title: "Starts with", code: 'assert.matches "hello" "^h"' }, | ||
| ], | ||
| example: 'assert.matches "hello" "^h"', | ||
| }, | ||
| throws: { | ||
| title: "Assert throws", | ||
| summary: "Assert that a function throws", | ||
| description: "Calls the supplied function and returns true if it throws, false otherwise.", | ||
| group: "error", | ||
| action: "read", | ||
| icon: "alert-triangle", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "throws", "error", "test"], | ||
| parameters: [ | ||
| { | ||
| name: "fn", | ||
| title: "Function", | ||
| description: "Function to invoke.", | ||
| dataType: "any", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if the function throws; false otherwise.", | ||
| errors: {}, | ||
| examples: [{ title: "Check throw", code: "assert.throws $fn" }], | ||
| example: "assert.throws $fn", | ||
| }, | ||
| lengthOf: { | ||
| title: "Assert length of", | ||
| summary: "Assert array/string has specific length", | ||
| description: "Throws unless the length matches exactly.", | ||
| group: "containment", | ||
| action: "read", | ||
| icon: "ruler", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "length", "test"], | ||
| parameters: [ | ||
| { | ||
| name: "value", | ||
| title: "Value", | ||
| description: "Array or string to measure.", | ||
| dataType: "any", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "length", | ||
| title: "Length", | ||
| description: "Expected length.", | ||
| dataType: "number", | ||
| formInputType: "number", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if length matches; throws otherwise.", | ||
| errors: { assertion_failed: "Length does not match." }, | ||
| examples: [{ title: "Array length", code: "assert.lengthOf $arr 3" }], | ||
| example: "assert.lengthOf $arr 3", | ||
| }, | ||
| hasProperty: { | ||
| title: "Assert has property", | ||
| summary: "Assert object has a specific property", | ||
| description: "Uses the `in` operator — inherited properties count.", | ||
| group: "containment", | ||
| action: "read", | ||
| icon: "key", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "property", "test"], | ||
| parameters: [ | ||
| { | ||
| name: "obj", | ||
| title: "Object", | ||
| description: "Object to inspect.", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: true, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 3, | ||
| }, | ||
| { | ||
| name: "property", | ||
| title: "Property", | ||
| description: "Property name to check for.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "name", | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if the property exists; throws otherwise.", | ||
| errors: { assertion_failed: "Object does not have the expected property." }, | ||
| examples: [ | ||
| { title: "Has property", code: 'assert.hasProperty $obj "name"' }, | ||
| ], | ||
| example: 'assert.hasProperty $obj "name"', | ||
| }, | ||
| isAbove: { | ||
| title: "Assert above", | ||
| summary: "Assert number is above threshold", | ||
| description: "Strict greater-than (>) numeric comparison.", | ||
| group: "numeric", | ||
| action: "read", | ||
| icon: "chevron-up", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "numeric", "test"], | ||
| parameters: [ | ||
| { | ||
| name: "value", | ||
| title: "Value", | ||
| description: "Number to check.", | ||
| dataType: "number", | ||
| formInputType: "number", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "threshold", | ||
| title: "Threshold", | ||
| description: "Value must be strictly greater than this.", | ||
| dataType: "number", | ||
| formInputType: "number", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if value > threshold; throws otherwise.", | ||
| errors: { assertion_failed: "Value is not strictly above threshold." }, | ||
| examples: [{ title: "Above", code: "assert.isAbove 5 3" }], | ||
| example: "assert.isAbove 5 3", | ||
| }, | ||
| isBelow: { | ||
| title: "Assert below", | ||
| summary: "Assert number is below threshold", | ||
| description: "Strict less-than (<) numeric comparison.", | ||
| group: "numeric", | ||
| action: "read", | ||
| icon: "chevron-down", | ||
| capability: "read", | ||
| sideEffects: [], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["assert", "numeric", "test"], | ||
| parameters: [ | ||
| { | ||
| name: "value", | ||
| title: "Value", | ||
| description: "Number to check.", | ||
| dataType: "number", | ||
| formInputType: "number", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "threshold", | ||
| title: "Threshold", | ||
| description: "Value must be strictly less than this.", | ||
| dataType: "number", | ||
| formInputType: "number", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "True if value < threshold; throws otherwise.", | ||
| errors: { assertion_failed: "Value is not strictly below threshold." }, | ||
| examples: [{ title: "Below", code: "assert.isBelow 3 5" }], | ||
| example: "assert.isBelow 3 5", | ||
| }, | ||
| }; | ||
| // ── Exports: module metadata ──────────────────────────────────────────── | ||
| export const AssertModuleMetadata = { | ||
| slug: "assert", | ||
| title: "Assertions", | ||
| summary: "Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more", | ||
| description: "Pure assertion helpers for tests and runtime invariants. Each function throws on failure and returns true on success, so they compose naturally with conditional flows. Use these to validate pre- and post-conditions in scripts without a dedicated test framework.", | ||
| category: "utility", | ||
| icon: "icon.svg", | ||
| color: "#10b981", | ||
| version: "0.2.0", | ||
| docsUrl: "https://docs.robinpath.com/modules/assert", | ||
| status: "stable", | ||
| requires: [], | ||
| minNodeVersion: "18.0.0", | ||
| credentialsType: null, | ||
| operationGroups: { | ||
| equality: { | ||
| title: "Equality", | ||
| description: "Strict and deep equality checks.", | ||
| order: 1, | ||
| }, | ||
| boolean: { | ||
| title: "Truthiness", | ||
| description: "Truthy, falsy, and null checks.", | ||
| order: 2, | ||
| }, | ||
| type: { | ||
| title: "Type", | ||
| description: "typeof checks.", | ||
| order: 3, | ||
| }, | ||
| containment: { | ||
| title: "Containment", | ||
| description: "includes, matches, length, property checks.", | ||
| order: 4, | ||
| }, | ||
| numeric: { | ||
| title: "Numeric", | ||
| description: "Above and below comparisons.", | ||
| order: 5, | ||
| }, | ||
| error: { | ||
| title: "Error", | ||
| description: "Assertions about thrown errors.", | ||
| order: 6, | ||
| }, | ||
| }, | ||
| methods: Object.keys(AssertFunctions), | ||
| }; | ||
| //# sourceMappingURL=assert.js.map |
| {"version":3,"file":"assert.js","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,2EAA2E;AAC3E,MAAM,KAAK,GAA0B,EAAE,CAAC;AAExC,MAAM,UAAU,eAAe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K,EAAE,SAAS;IAChB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,2CAA2C;IACpD,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE;QACf,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,kCAAkC;YAC/C,KAAK,EAAE,CAAC;SACT;QACD,OAAO,EAAE;YACP,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,CAAC;SACT;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,gBAAgB;YAC7B,KAAK,EAAE,CAAC;SACT;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,6CAA6C;YAC1D,KAAK,EAAE,CAAC;SACT;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,8BAA8B;YAC3C,KAAK,EAAE,CAAC;SACT;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,CAAC;SACT;KACF;IACD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;CACtC,CAAC"} |
| import type { ModuleAdapter } from "@robinpath/core"; | ||
| declare const AssertModule: ModuleAdapter; | ||
| export default AssertModule; | ||
| export { AssertModule }; | ||
| export { AssertFunctions, AssertFunctionMetadata, AssertModuleMetadata, configureAssert, } from "./assert.js"; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAQrD,QAAA,MAAM,YAAY,EAAE,aASnB,CAAC;AAEF,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,GAChB,MAAM,aAAa,CAAC"} |
| import { AssertFunctions, AssertFunctionMetadata, AssertModuleMetadata, configureAssert, } from "./assert.js"; | ||
| const AssertModule = { | ||
| name: "assert", | ||
| functions: AssertFunctions, | ||
| functionMetadata: AssertFunctionMetadata, | ||
| moduleMetadata: AssertModuleMetadata, | ||
| // No credentials — assert helpers are pure. | ||
| credentialTypes: [], | ||
| configure: configureAssert, | ||
| global: false, | ||
| }; | ||
| export default AssertModule; | ||
| export { AssertModule }; | ||
| export { AssertFunctions, AssertFunctionMetadata, AssertModuleMetadata, configureAssert, } from "./assert.js"; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,MAAM,YAAY,GAAkB;IAClC,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,eAAe;IAC1B,gBAAgB,EAAE,sBAAsB;IACxC,cAAc,EAAE,oBAAoB;IACpC,4CAA4C;IAC5C,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,eAAe;IAC1B,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,GAChB,MAAM,aAAa,CAAC"} |
+9
-4
| { | ||
| "name": "@robinpath/assert", | ||
| "version": "0.1.2", | ||
| "version": "0.3.0", | ||
| "publishConfig": { | ||
@@ -24,6 +24,6 @@ "access": "public" | ||
| "peerDependencies": { | ||
| "@robinpath/core": ">=0.20.0" | ||
| "@robinpath/core": ">=0.40.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@robinpath/core": "^0.30.1", | ||
| "@robinpath/core": "^0.40.0", | ||
| "tsx": "^4.19.0", | ||
@@ -42,4 +42,9 @@ "typescript": "^5.6.0" | ||
| "auth": "none", | ||
| "functionCount": 15 | ||
| "functionCount": 15, | ||
| "language": "nodejs", | ||
| "platforms": [ | ||
| "cloud", | ||
| "cli" | ||
| ] | ||
| } | ||
| } |
+1
-1
@@ -22,3 +22,3 @@ # @robinpath/assert | ||
| ```bash | ||
| npm install @robinpath/assert | ||
| robinpath add @robinpath/assert | ||
| ``` | ||
@@ -25,0 +25,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
48801
1234.45%10
400%739
Infinity%1
-50%2
100%