@alexaegis/predicate 0.15.1 → 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.
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/vite.config.d.ts +3 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/package.json +14 -11
package/dist/index.cjs.map
CHANGED
|
@@ -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;
|
|
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;
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../vite.config.ts"],"names":[],"mappings":";AAMA,wBAOE"}
|
|
@@ -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.
|
|
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.
|
|
44
|
-
"publint": "^0.3.
|
|
46
|
+
"@types/node": "^25.9.1",
|
|
47
|
+
"publint": "^0.3.21",
|
|
45
48
|
"typescript": "^6.0.3",
|
|
46
|
-
"vite": "^8.0.
|
|
47
|
-
"vite-plugin-dts": "^5.0.
|
|
48
|
-
"vitest": "^4.1.
|
|
49
|
-
"@alexaegis/eslint-config-vitest": "^0.15.
|
|
50
|
-
"@alexaegis/ts": "^0.15.
|
|
51
|
-
"@alexaegis/vite": "^0.15.
|
|
52
|
-
"@alexaegis/vitest": "^0.15.
|
|
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",
|