@jakubmazanec/ts-utils 3.0.19-unstable.f50b9d9c → 3.0.19
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/README.md +1 -1
- package/build/main.js +0 -1
- package/build/main.js.map +1 -1
- package/build/types/AtLeastOneRequired.js +0 -1
- package/build/types/DeepPartial.js +0 -1
- package/build/types/DeepReadonly.js +0 -1
- package/build/types/If.js +0 -1
- package/build/types/IsEqual.js +0 -1
- package/build/types/LiteralUnion.js +0 -1
- package/build/types/NonArray.js +0 -1
- package/build/types/NonArrayLike.js +0 -1
- package/build/types/OptionalKeys.js +0 -1
- package/build/types/Parameters.js +0 -1
- package/build/types/Primitive.js +0 -1
- package/build/types/RequiredKeys.js +0 -1
- package/build/types/ReturnType.js +0 -1
- package/build/types/Simplify.js +0 -1
- package/build/types/TupleToUnion.js +0 -1
- package/build/types/UnionToIntersection.js +0 -1
- package/build/types/Writable.js +0 -1
- package/build/types.js +0 -1
- package/build/utils/assert.js +0 -1
- package/build/utils/assert.js.map +1 -1
- package/build/utils/is.js +0 -1
- package/build/utils/is.js.map +1 -1
- package/build/utils/isNonNullable.js +0 -1
- package/build/utils/isNonNullable.js.map +1 -1
- package/build/utils/tuple.js +0 -1
- package/build/utils/tuple.js.map +1 -1
- package/build/utils.js +0 -1
- package/build/utils.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
package/build/main.js
CHANGED
package/build/main.js.map
CHANGED
package/build/types/If.js
CHANGED
package/build/types/IsEqual.js
CHANGED
package/build/types/NonArray.js
CHANGED
package/build/types/Primitive.js
CHANGED
package/build/types/Simplify.js
CHANGED
package/build/types/Writable.js
CHANGED
package/build/types.js
CHANGED
package/build/utils/assert.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../source/utils/assert.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * A subclass of `Error` that indicates an assertion failure.\n */\nexport class AssertionError extends Error {\n override name = 'AssertionError';\n\n /**\n * @param message Message added to the default error message\n */\n constructor(message?: string) {\n super(`Wrong assertion encountered${message ? `: \"${message}\"` : ''}!`);\n }\n}\n\n/**\n * A function that throws {@link AssertionError} (with optional message defined with `errorMessage`) if\n * `condition` is falsy.\n * You can use it to narrow types:\n *\n * ```TypeScript\n * interface Foo {\n * kind: 'Foo';\n * }\n *\n * interface Bar {\n * kind: 'Bar';\n * }\n *\n * declare const foobar: Foo | Bar;\n *\n * assert(is<Foo>(foobar, foobar.kind === 'Foo'));\n *\n * // `typeof foobar` is now `Foo`\n * ```\n *\n * @param condition Condition we're asserting isn't falsy\n * @param errorMessage Message for the `AssertionError`\n */\nexport function assert(condition: unknown, errorMessage?: string): asserts condition {\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions -- we don't mind here\n if (!condition) {\n throw new AssertionError(errorMessage);\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAGO,aAAM,uBAAuB,MAAM;AAAA,EAC/B,OAAO;AAAA;AAAA;AAAA;AAAA,EAKhB,YAAY,SAAkB;AAC5B,UAAM,8BAA8B,UAAU,MAAM,OAAO,MAAM,EAAE,GAAG;AAAA,EACxE;AACF;AA0BO,gBAAS,OAAO,WAAoB,cAA0C;AAEnF,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,eAAe,YAAY;AAAA,EACvC;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/utils/is.js
CHANGED
package/build/utils/is.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../source/utils/is.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * A generic type guard. If `isMatched` is `true`, TypeScript assumes `value` is of type `T`.\n * You can use it to narrow types:\n *\n * ```TypeScript\n * interface Foo {\n * value: string;\n * }\n *\n * interface Bar {\n * value: number;\n * }\n *\n * declare let foobar: Foo | Bar;\n *\n * if (is<Foo>(foobar, typeof foobar.value === 'string')) {\n * // `typeof foobar` is now `Foo`\n * } else {\n * // `typeof foobar` is now `Bar`\n * }\n * ```\n *\n * @typeParam T Potential type of `value`\n * @param value Value being checked\n * @param isMatched Specifies if `value` is of type `T`\n * @return Value of `isMatched`\n */\nexport function is<T>(value: unknown, isMatched: boolean): value is T {\n return isMatched;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AA2BO,gBAAS,GAAM,OAAgB,WAAgC;AACpE,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../source/utils/isNonNullable.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * A type guard that checks whether variable is not `null` or `undefined`:\n *\n * ```TypeScript\n * declare let foobar: string | null;\n *\n * if (isNonNullable(foobar)) {\n * // `typeof foobar` is now `string`\n * } else {\n * // `typeof foobar` is now `null`\n * }\n * ```\n *\n * @typeParam T Type of `value`\n * @param value Value being checked\n * @return `true` if `value` is non-nullable\n */\nexport function isNonNullable<T>(value: T): value is NonNullable<T> {\n return value !== undefined && value !== null;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAiBO,gBAAS,cAAiB,OAAmC;AAClE,SAAO,UAAU,UAAa,UAAU;AAC1C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/utils/tuple.js
CHANGED
package/build/utils/tuple.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../source/utils/tuple.ts"],
|
|
4
4
|
"sourcesContent": ["import {type Primitive} from '../types.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- this is intended\nexport function tuple<T extends Array<Primitive | {}>>(...values: T) {\n return values;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAGO,gBAAS,SAA0C,QAAW;AACnE,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/utils.js
CHANGED
package/build/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../source/utils.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './utils/assert.js';\nexport * from './utils/is.js';\nexport * from './utils/isNonNullable.js';\nexport * from './utils/tuple.js';\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jakubmazanec/ts-utils",
|
|
3
|
-
"version": "3.0.19
|
|
3
|
+
"version": "3.0.19",
|
|
4
4
|
"description": "Collection of TypeScript types and utilities.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"typecheck": "tsc --project tsconfig.typecheck.json"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@jakubmazanec/eslint-config": "5.0.0
|
|
30
|
+
"@jakubmazanec/eslint-config": "^5.0.0",
|
|
31
31
|
"@types/lodash": "^4.17.24",
|
|
32
32
|
"@types/node": "^24.0.4",
|
|
33
33
|
"@vitest/coverage-v8": "^4.1.10",
|
|
34
|
-
"concurrently": "^
|
|
34
|
+
"concurrently": "^10.0.3",
|
|
35
35
|
"del-cli": "^7.0.0",
|
|
36
36
|
"esbuild": "^0.28.1",
|
|
37
37
|
"eslint": "^9.39.4",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"prettier-plugin-packagejson": "^2.5.22",
|
|
41
41
|
"typedoc": "^0.28.20",
|
|
42
42
|
"typedoc-plugin-markdown": "^4.12.0",
|
|
43
|
-
"typescript": "^
|
|
43
|
+
"typescript": "^6.0.0",
|
|
44
44
|
"vitest": "^4.1.10"
|
|
45
45
|
},
|
|
46
46
|
"packageManager": "npm@11.3.0",
|