@alexaegis/predicate 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../src/internal/predicates.ts"],"sourcesContent":["export type Predicate<T> = (value?: T | undefined | null) => boolean;\n\nexport const not = <T>(predicate: Predicate<T>): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean => !predicate(value);\n};\n\nexport const equal = <T>(criteria: T) => {\n\treturn (value?: T | undefined | null): value is T => value === criteria;\n};\n\nexport const and = <T>(...predicates: Predicate<T>[]): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean =>\n\t\tpredicates.every((predicate) => predicate(value));\n};\n\nexport const or = <T>(...predicates: Predicate<T>[]): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean =>\n\t\tpredicates.some((predicate) => predicate(value));\n};\n\nexport const contains = <T extends string>(criteria: T): Predicate<string> => {\n\treturn (value?: T | string | undefined | null): value is string =>\n\t\tvalue?.includes(criteria) ?? false;\n};\n\nexport const matchRegExp = <T extends string>(criteria: RegExp): Predicate<string> => {\n\treturn (value?: T | string | undefined | null): value is string =>\n\t\ttypeof value === 'string' ? criteria.test(value) : false;\n};\n\nexport const predicate = {\n\tnot,\n\tequal,\n\tand,\n\tor,\n\tcontains,\n\tmatchRegExp,\n} as const;\n"],"mappings":";;AAEA,IAAa,OAAU,cAA0C;AAChE,SAAQ,UAA0C,CAAC,UAAU,MAAM;;AAGpE,IAAa,SAAY,aAAgB;AACxC,SAAQ,UAA6C,UAAU;;AAGhE,IAAa,OAAU,GAAG,eAA6C;AACtE,SAAQ,UACP,WAAW,OAAO,cAAc,UAAU,MAAM,CAAC;;AAGnD,IAAa,MAAS,GAAG,eAA6C;AACrE,SAAQ,UACP,WAAW,MAAM,cAAc,UAAU,MAAM,CAAC;;AAGlD,IAAa,YAA8B,aAAmC;AAC7E,SAAQ,UACP,OAAO,SAAS,SAAS,IAAI;;AAG/B,IAAa,eAAiC,aAAwC;AACrF,SAAQ,UACP,OAAO,UAAU,WAAW,SAAS,KAAK,MAAM,GAAG;;AAGrD,IAAa,YAAY;CACxB;CACA;CACA;CACA;CACA;CACA;CACA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/internal/predicates.ts"],"sourcesContent":["export type Predicate<T> = (value?: T | undefined | null) => boolean;\n\nexport const not = <T>(predicate: Predicate<T>): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean => !predicate(value);\n};\n\nexport const equal = <T>(criteria: T) => {\n\treturn (value?: T | undefined | null): value is T => value === criteria;\n};\n\nexport const and = <T>(...predicates: Predicate<T>[]): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean =>\n\t\tpredicates.every((predicate) => predicate(value));\n};\n\nexport const or = <T>(...predicates: Predicate<T>[]): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean =>\n\t\tpredicates.some((predicate) => predicate(value));\n};\n\nexport const contains = <T extends string>(criteria: T): Predicate<string> => {\n\treturn (value?: T | string | undefined | null): value is string =>\n\t\tvalue?.includes(criteria) ?? false;\n};\n\nexport const matchRegExp = <T extends string>(criteria: RegExp): Predicate<string> => {\n\treturn (value?: T | string | undefined | null): value is string =>\n\t\ttypeof value === 'string' ? criteria.test(value) : false;\n};\n\nexport const predicate = {\n\tnot,\n\tequal,\n\tand,\n\tor,\n\tcontains,\n\tmatchRegExp,\n} as const;\n"],"mappings":";;AAEA,IAAa,OAAU,cAA0C;CAChE,QAAQ,UAA0C,CAAC,UAAU,KAAK;AACnE;AAEA,IAAa,SAAY,aAAgB;CACxC,QAAQ,UAA6C,UAAU;AAChE;AAEA,IAAa,OAAU,GAAG,eAA6C;CACtE,QAAQ,UACP,WAAW,OAAO,cAAc,UAAU,KAAK,CAAC;AAClD;AAEA,IAAa,MAAS,GAAG,eAA6C;CACrE,QAAQ,UACP,WAAW,MAAM,cAAc,UAAU,KAAK,CAAC;AACjD;AAEA,IAAa,YAA8B,aAAmC;CAC7E,QAAQ,UACP,OAAO,SAAS,QAAQ,KAAK;AAC/B;AAEA,IAAa,eAAiC,aAAwC;CACrF,QAAQ,UACP,OAAO,UAAU,WAAW,SAAS,KAAK,KAAK,IAAI;AACrD;AAEA,IAAa,YAAY;CACxB;CACA;CACA;CACA;CACA;CACA;AACD"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/internal/predicates.ts"],"sourcesContent":["export type Predicate<T> = (value?: T | undefined | null) => boolean;\n\nexport const not = <T>(predicate: Predicate<T>): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean => !predicate(value);\n};\n\nexport const equal = <T>(criteria: T) => {\n\treturn (value?: T | undefined | null): value is T => value === criteria;\n};\n\nexport const and = <T>(...predicates: Predicate<T>[]): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean =>\n\t\tpredicates.every((predicate) => predicate(value));\n};\n\nexport const or = <T>(...predicates: Predicate<T>[]): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean =>\n\t\tpredicates.some((predicate) => predicate(value));\n};\n\nexport const contains = <T extends string>(criteria: T): Predicate<string> => {\n\treturn (value?: T | string | undefined | null): value is string =>\n\t\tvalue?.includes(criteria) ?? false;\n};\n\nexport const matchRegExp = <T extends string>(criteria: RegExp): Predicate<string> => {\n\treturn (value?: T | string | undefined | null): value is string =>\n\t\ttypeof value === 'string' ? criteria.test(value) : false;\n};\n\nexport const predicate = {\n\tnot,\n\tequal,\n\tand,\n\tor,\n\tcontains,\n\tmatchRegExp,\n} as const;\n"],"mappings":";AAEA,IAAa,OAAU,cAA0C;AAChE,SAAQ,UAA0C,CAAC,UAAU,MAAM;;AAGpE,IAAa,SAAY,aAAgB;AACxC,SAAQ,UAA6C,UAAU;;AAGhE,IAAa,OAAU,GAAG,eAA6C;AACtE,SAAQ,UACP,WAAW,OAAO,cAAc,UAAU,MAAM,CAAC;;AAGnD,IAAa,MAAS,GAAG,eAA6C;AACrE,SAAQ,UACP,WAAW,MAAM,cAAc,UAAU,MAAM,CAAC;;AAGlD,IAAa,YAA8B,aAAmC;AAC7E,SAAQ,UACP,OAAO,SAAS,SAAS,IAAI;;AAG/B,IAAa,eAAiC,aAAwC;AACrF,SAAQ,UACP,OAAO,UAAU,WAAW,SAAS,KAAK,MAAM,GAAG;;AAGrD,IAAa,YAAY;CACxB;CACA;CACA;CACA;CACA;CACA;CACA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/internal/predicates.ts"],"sourcesContent":["export type Predicate<T> = (value?: T | undefined | null) => boolean;\n\nexport const not = <T>(predicate: Predicate<T>): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean => !predicate(value);\n};\n\nexport const equal = <T>(criteria: T) => {\n\treturn (value?: T | undefined | null): value is T => value === criteria;\n};\n\nexport const and = <T>(...predicates: Predicate<T>[]): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean =>\n\t\tpredicates.every((predicate) => predicate(value));\n};\n\nexport const or = <T>(...predicates: Predicate<T>[]): Predicate<T> => {\n\treturn (value?: T | undefined | null): boolean =>\n\t\tpredicates.some((predicate) => predicate(value));\n};\n\nexport const contains = <T extends string>(criteria: T): Predicate<string> => {\n\treturn (value?: T | string | undefined | null): value is string =>\n\t\tvalue?.includes(criteria) ?? false;\n};\n\nexport const matchRegExp = <T extends string>(criteria: RegExp): Predicate<string> => {\n\treturn (value?: T | string | undefined | null): value is string =>\n\t\ttypeof value === 'string' ? criteria.test(value) : false;\n};\n\nexport const predicate = {\n\tnot,\n\tequal,\n\tand,\n\tor,\n\tcontains,\n\tmatchRegExp,\n} as const;\n"],"mappings":";AAEA,IAAa,OAAU,cAA0C;CAChE,QAAQ,UAA0C,CAAC,UAAU,KAAK;AACnE;AAEA,IAAa,SAAY,aAAgB;CACxC,QAAQ,UAA6C,UAAU;AAChE;AAEA,IAAa,OAAU,GAAG,eAA6C;CACtE,QAAQ,UACP,WAAW,OAAO,cAAc,UAAU,KAAK,CAAC;AAClD;AAEA,IAAa,MAAS,GAAG,eAA6C;CACrE,QAAQ,UACP,WAAW,MAAM,cAAc,UAAU,KAAK,CAAC;AACjD;AAEA,IAAa,YAA8B,aAAmC;CAC7E,QAAQ,UACP,OAAO,SAAS,QAAQ,KAAK;AAC/B;AAEA,IAAa,eAAiC,aAAwC;CACrF,QAAQ,UACP,OAAO,UAAU,WAAW,SAAS,KAAK,KAAK,IAAI;AACrD;AAEA,IAAa,YAAY;CACxB;CACA;CACA;CACA;CACA;CACA;AACD"}
@@ -0,0 +1,3 @@
1
+ declare const _default: Record<string, any>;
2
+ export default _default;
3
+ //# sourceMappingURL=vite.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../vite.config.ts"],"names":[],"mappings":";AAMA,wBAOE"}
@@ -0,0 +1,2 @@
1
+ export { vitestNodeConfig as default } from '@alexaegis/vitest';
2
+ //# sourceMappingURL=vitest.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alexaegis/predicate",
3
3
  "description": "Dead simple declarative predicates",
4
- "version": "0.15.0",
4
+ "version": "0.15.2",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "archetype": {
@@ -19,7 +19,7 @@
19
19
  "query"
20
20
  ],
21
21
  "repository": {
22
- "url": "git+https://github.com/AlexAegis/js-tooling",
22
+ "url": "git+https://github.com/AlexAegis/js-tooling.git",
23
23
  "type": "git"
24
24
  },
25
25
  "type": "module",
@@ -29,6 +29,9 @@
29
29
  "files": [
30
30
  "dist"
31
31
  ],
32
+ "engines": {
33
+ "node": ">=22.6.0"
34
+ },
32
35
  "exports": {
33
36
  ".": {
34
37
  "types": "./dist/index.d.ts",
@@ -40,16 +43,16 @@
40
43
  "./readme": "./readme.md"
41
44
  },
42
45
  "devDependencies": {
43
- "@types/node": "^25.5.0",
44
- "publint": "^0.3.18",
45
- "typescript": "^5.9.3",
46
- "vite": "^8.0.1",
47
- "vite-plugin-dts": "^4.5.4",
48
- "vitest": "^4.1.0",
49
- "@alexaegis/eslint-config-vitest": "^0.15.0",
50
- "@alexaegis/vite": "^0.15.0",
51
- "@alexaegis/vitest": "^0.15.0",
52
- "@alexaegis/ts": "^0.15.0"
46
+ "@types/node": "^25.9.1",
47
+ "publint": "^0.3.21",
48
+ "typescript": "^6.0.3",
49
+ "vite": "^8.0.16",
50
+ "vite-plugin-dts": "^5.0.2",
51
+ "vitest": "^4.1.8",
52
+ "@alexaegis/eslint-config-vitest": "^0.15.2",
53
+ "@alexaegis/ts": "^0.15.2",
54
+ "@alexaegis/vite": "^0.15.2",
55
+ "@alexaegis/vitest": "^0.15.2"
53
56
  },
54
57
  "scripts": {
55
58
  "lint:depcheck": "turbo run lint:depcheck_ --concurrency 16 --filter @alexaegis/predicate",