@xylabs/typeof 5.0.11 → 5.0.13
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/neutral/IdentityFunction.d.ts +2 -0
- package/dist/neutral/IdentityFunction.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +1 -0
- package/dist/neutral/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/IdentityFunction.ts +1 -0
- package/src/index.ts +1 -0
- package/src/spec/is.spec.ts +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityFunction.d.ts","sourceRoot":"","sources":["../../src/IdentityFunction.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAA"}
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/typeof",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.13",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typeof",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"src"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@xylabs/ts-scripts-yarn3": "~7.1.
|
|
46
|
-
"@xylabs/tsconfig": "~7.1.
|
|
47
|
-
"typescript": "~5.9.
|
|
45
|
+
"@xylabs/ts-scripts-yarn3": "~7.1.8",
|
|
46
|
+
"@xylabs/tsconfig": "~7.1.8",
|
|
47
|
+
"typescript": "~5.9.3",
|
|
48
48
|
"vitest": "~3.2.4"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type IdentityFunction<T> = (value: unknown) => value is T
|
package/src/index.ts
CHANGED
package/src/spec/is.spec.ts
CHANGED
|
@@ -109,7 +109,7 @@ describe('is.ts type guards', () => {
|
|
|
109
109
|
|
|
110
110
|
describe('isBigInt', () => {
|
|
111
111
|
it('correctly identifies BigInt values', () => {
|
|
112
|
-
expect(isBigInt(
|
|
112
|
+
expect(isBigInt(123n)).toBe(true)
|
|
113
113
|
expect(isBigInt(123n)).toBe(true)
|
|
114
114
|
|
|
115
115
|
expect(isBigInt(123)).toBe(false)
|
|
@@ -230,7 +230,7 @@ describe('is.ts type guards', () => {
|
|
|
230
230
|
|
|
231
231
|
it('preserves readonly array types', () => {
|
|
232
232
|
const v: string | readonly number[]
|
|
233
|
-
|
|
233
|
+
= Math.random() > 0.5 ? 'nope' : [1, 2, 3] as const
|
|
234
234
|
|
|
235
235
|
if (isArray(v)) {
|
|
236
236
|
// preserve readonly array
|