@xylabs/typeof 4.13.15 → 4.13.17

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 CHANGED
@@ -1,6 +1,33 @@
1
- [![logo][]](https://xyo.network)
1
+ # @xylabs/typeof
2
2
 
3
- Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
3
+ [![logo][]](https://xylabs.com)
4
+
5
+ [![main-build][]][main-build-link]
6
+ [![npm-badge][]][npm-link]
7
+ [![npm-downloads-badge][]][npm-link]
8
+ [![jsdelivr-badge][]][jsdelivr-link]
9
+ [![npm-license-badge][]](LICENSE)
10
+ [![codacy-badge][]][codacy-link]
11
+ [![codeclimate-badge][]][codeclimate-link]
12
+ [![snyk-badge][]][snyk-link]
13
+ [![socket-badge][]][socket-link]
14
+
15
+ Version: 4.13.15
16
+
17
+ Base functionality used throughout XY Labs TypeScript/JavaScript libraries
18
+
19
+ ## Documentation
20
+
21
+ Coming Soon!
22
+
23
+ Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
24
+
25
+ ## Maintainers
26
+
27
+ - [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
28
+ - [Matt Jones](https://github.com/jonesmac)
29
+ - [Joel Carter](https://github.com/JoelBCarter)
30
+ - [Jordan Trouw](https://github.com/jordantrouw)
4
31
 
5
32
  ## License
6
33
 
@@ -8,6 +35,26 @@ Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-c
8
35
 
9
36
  ## Credits
10
37
 
11
- [Made with 🔥 and ❄️ by XYO](https://xyo.network)
38
+ [Made with 🔥 and ❄️ by XYLabs](https://xylabs.com)
39
+
40
+ [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
41
+
42
+ [main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
43
+ [main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
44
+ [npm-badge]: https://img.shields.io/npm/v/@xylabs/typeof.svg
45
+ [npm-link]: https://www.npmjs.com/package/@xylabs/typeof
46
+ [codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698
47
+ [codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade
48
+ [codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
49
+ [codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
50
+ [snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
51
+ [snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
52
+
53
+ [npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/typeof
54
+ [npm-license-badge]: https://img.shields.io/npm/l/@xylabs/typeof
55
+
56
+ [jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/typeof/badge
57
+ [jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/typeof
12
58
 
13
- [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
59
+ [socket-badge]: https://socket.dev/api/badge/npm/package/@xylabs/typeof
60
+ [socket-link]: https://socket.dev/npm/package/@xylabs/typeof
@@ -1,111 +1,10 @@
1
- declare const ifDefined: <T>(value: T, func: (value: T) => void) => T | undefined;
2
-
3
- type TypeOfTypes = 'string' | 'number' | 'object' | 'array' | 'buffer' | 'null' | 'undefined' | 'bigint' | 'boolean' | 'function' | 'symbol';
4
-
5
- declare const ifTypeOf: <T, R>(typeName: TypeOfTypes, value: unknown, trueFunc: (value: T) => R, isFunc?: (value: T) => boolean) => R | undefined;
6
-
7
- type AnyFunction = (...args: unknown[]) => unknown;
8
- type RecordKey = string | number | symbol;
9
- declare function isUndefined(value: unknown): value is undefined;
10
- declare function isUndefined<T>(value: T): value is Extract<T, undefined>;
11
- declare function isDefined<T>(value: T): value is Exclude<T, undefined>;
12
- declare function isNull(value: unknown): value is null;
13
- declare function isNull<T>(value: T): value is Extract<T, null>;
14
- declare function isDefinedNotNull<T>(value: T): value is Exclude<T, undefined | null>;
15
- declare function isUndefinedOrNull(value: unknown): value is undefined | null;
16
- declare function isUndefinedOrNull<T>(value: T): value is Extract<T, undefined | null>;
17
- declare function isBigInt(value: unknown): value is bigint;
18
- declare function isBigInt<T extends bigint>(value: T): value is Extract<T, bigint>;
19
- declare function isString(value: unknown): value is string;
20
- declare function isString<T extends string>(value: T): value is Extract<T, string>;
21
- declare function isNumber(value: unknown): value is number;
22
- declare function isNumber<T extends number>(value: T): value is Extract<T, number>;
23
- declare function isObject(value: unknown): value is object;
24
- declare function isObject<T extends object>(value: T): value is Extract<T, object>;
25
- declare function isArray(value: unknown): value is [];
26
- declare function isArray<T extends []>(value: T): value is Extract<T, Array<unknown>>;
27
- declare function isFunction(value: unknown): value is AnyFunction;
28
- declare function isFunction<T extends AnyFunction>(value: T): value is Extract<T, AnyFunction>;
29
- declare function isSymbol(value: unknown): value is symbol;
30
- declare function isSymbol<T extends symbol>(value: T): value is Extract<T, symbol>;
31
- declare function isEmptyObject(value: unknown): value is {};
32
- declare function isEmptyObject<K extends RecordKey, V, T extends Record<K, V>>(value: T): value is Extract<T, Record<K, never>>;
33
- declare function isEmptyString(value: unknown): value is '';
34
- declare function isEmptyString<T extends string>(value: T): value is Extract<T, ''>;
35
- declare function isEmptyArray(value: unknown): value is [];
36
- declare function isEmptyArray<T extends Array<unknown>>(value: T): value is Extract<T, Array<unknown>>;
37
- declare function isPopulatedArray(value: unknown): value is [];
38
- declare function isPopulatedArray<T extends Array<unknown>>(value: T): value is Extract<T, Array<unknown>>;
39
- declare function isEmpty<T>(value: unknown): value is T;
40
- declare function isEmpty<K extends RecordKey, V, T extends Record<K, V>>(value: T): value is Extract<T, Record<K, never>>;
41
- declare function isEmpty<T extends Array<unknown>>(value: T): value is Extract<T, Array<never>>;
42
- declare function isFalsy<T>(value: T): value is Extract<T, 0 | null | undefined | false | '' | 0n>;
43
- declare function isFalsy<T extends boolean>(value: T): value is Extract<T, false>;
44
- declare function isFalsy<T extends number>(value: T): value is Extract<T, 0>;
45
- declare function isFalsy<T extends bigint>(value: T): value is Extract<T, 0n>;
46
- declare function isFalsy<T extends null>(value: T): value is Extract<T, null>;
47
- declare function isFalsy<T extends undefined>(value: T): value is Extract<T, undefined>;
48
- declare function isFalsy<T extends string>(value: T): value is Extract<T, ''>;
49
- declare function isTruthy<T>(value: T): value is Exclude<T, 0 | null | undefined | false | '' | 0n>;
50
- declare function isTruthy<T extends boolean>(value: T): value is Extract<T, true>;
51
- declare function isTruthy<T extends number>(value: T): value is Extract<T, number>;
52
- declare function isTruthy<T extends bigint>(value: T): value is Extract<T, bigint>;
53
- declare function isTruthy<T extends null>(value: T): value is Extract<T, null>;
54
- declare function isTruthy<T extends undefined>(value: T): value is Extract<T, undefined>;
55
- declare function isTruthy<T extends string>(value: T): value is Extract<T, string>;
56
- declare function isBoolean(value: unknown): value is boolean;
57
- declare function isBoolean<T extends boolean>(value: T): value is Extract<T, boolean>;
58
- declare function isDateString(value: unknown): value is string;
59
- declare function isDateString<T>(value: T): value is Extract<T, string>;
60
- declare function isDate(value: unknown): value is Date;
61
- declare function isDate<T>(value: T): value is Extract<T, Date>;
62
- declare function isRegExp(value: unknown): value is RegExp;
63
- declare function isRegExp<T extends RegExp>(value: T): value is Extract<T, RegExp>;
64
- declare function isError(value: unknown): value is Error;
65
- declare function isError<T>(value: T): value is Extract<T, Error>;
66
- declare function isPromise(value: unknown): value is Promise<unknown>;
67
- declare function isPromise<T>(value: T): value is Extract<T, Promise<unknown>>;
68
- declare function isPromiseLike(value: unknown): value is Promise<unknown>;
69
- declare function isPromiseLike<T>(value: T): value is Extract<T, Promise<unknown>>;
70
- declare function isMap(value: unknown): value is Map<unknown, unknown>;
71
- declare function isMap<K, V, T extends Map<K, V>>(value: T): value is Extract<T, Map<K, V>>;
72
- declare function isArrayBufferView(value: unknown): value is ArrayBufferView;
73
- declare function isArrayBufferView<T extends ArrayBufferView>(value: T): value is Extract<T, ArrayBufferView>;
74
- declare function isSet(value: unknown): value is Set<unknown>;
75
- declare function isSet<T extends Set<unknown>>(value: unknown | Set<T>): value is Extract<T, Set<unknown>>;
76
- declare function isWeakMap(value: unknown): value is WeakMap<WeakKey, unknown>;
77
- declare function isWeakMap<K extends WeakKey, V, T extends WeakMap<K, V>>(value: T): value is Extract<T, WeakMap<K, V>>;
78
- declare function isWeakSet(value: unknown): value is WeakSet<WeakKey>;
79
- declare function isWeakSet<K extends WeakKey, T extends WeakSet<K>>(value: T): value is Extract<T, WeakSet<K>>;
80
- declare function isArrayBuffer(value: unknown): value is ArrayBuffer;
81
- declare function isArrayBuffer<T extends ArrayBuffer>(value: T): value is Extract<T, ArrayBuffer>;
82
- declare function isDataView(value: unknown): value is DataView;
83
- declare function isDataView<T>(value: T): value is Extract<T, DataView>;
84
- declare function isBlob(value: unknown): value is Blob;
85
- declare function isBlob<T extends Blob>(value: T): value is Extract<T, Blob>;
86
- declare function isFile(value: unknown): value is File;
87
- declare function isFile<T extends File>(value: T): value is Extract<T, File>;
88
-
89
- type FieldType = 'string' | 'number' | 'object' | 'symbol' | 'undefined' | 'null' | 'array' | 'function';
90
- type ObjectTypeShape = Record<string | number | symbol, FieldType>;
91
-
92
- declare const isType: (value: unknown, expectedType: FieldType) => boolean;
93
-
94
- type TypedValue = bigint | string | number | boolean | null | TypedObject | TypedArray | Function | symbol | undefined;
95
- type TypedKey<T extends string | void = void> = T extends string ? T : string | number | symbol;
96
- type TypedObject = {
97
- [key: TypedKey]: TypedValue;
98
- } | object;
99
- type TypedArray = TypedValue[];
100
- declare const isTypedKey: (value: unknown) => value is TypedKey;
101
- declare const isTypedValue: (value: unknown) => value is TypedValue;
102
- declare const isTypedArray: (value: unknown) => value is TypedArray;
103
- declare const isValidTypedFieldPair: (pair: [key: unknown, value: unknown]) => pair is [key: TypedKey, value: TypedValue];
104
- declare const isTypedObject: (value: unknown) => value is TypedObject;
105
-
106
- declare const typeOf: <T>(item: T) => TypeOfTypes;
107
-
108
- declare const validateType: <T>(typeName: TypeOfTypes, value: T, optional?: boolean) => [T | undefined, Error[]];
109
-
110
- export { ifDefined, ifTypeOf, isArray, isArrayBuffer, isArrayBufferView, isBigInt, isBlob, isBoolean, isDataView, isDate, isDateString, isDefined, isDefinedNotNull, isEmpty, isEmptyArray, isEmptyObject, isEmptyString, isError, isFalsy, isFile, isFunction, isMap, isNull, isNumber, isObject, isPopulatedArray, isPromise, isPromiseLike, isRegExp, isSet, isString, isSymbol, isTruthy, isType, isTypedArray, isTypedKey, isTypedObject, isTypedValue, isUndefined, isUndefinedOrNull, isValidTypedFieldPair, isWeakMap, isWeakSet, typeOf, validateType };
111
- export type { AnyFunction, FieldType, ObjectTypeShape, RecordKey, TypeOfTypes, TypedArray, TypedKey, TypedObject, TypedValue };
1
+ export * from './ifDefined.ts';
2
+ export * from './ifTypeOf.ts';
3
+ export * from './is.ts';
4
+ export * from './isType.ts';
5
+ export * from './ObjectTypeShape.ts';
6
+ export * from './Typed.ts';
7
+ export * from './typeOf.ts';
8
+ export * from './TypeOfTypes.ts';
9
+ export * from './validateType.ts';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=is.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/is.spec.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/typeof",
3
- "version": "4.13.15",
3
+ "version": "4.13.17",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "typeof",
@@ -36,8 +36,8 @@
36
36
  "module": "dist/neutral/index.mjs",
37
37
  "types": "dist/neutral/index.d.ts",
38
38
  "devDependencies": {
39
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.20",
40
- "@xylabs/tsconfig": "^7.0.0-rc.20",
39
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
40
+ "@xylabs/tsconfig": "^7.0.0-rc.27",
41
41
  "typescript": "^5.8.3",
42
42
  "vitest": "^3.2.4"
43
43
  },
@@ -1,10 +0,0 @@
1
- export * from './ifDefined.ts';
2
- export * from './ifTypeOf.ts';
3
- export * from './is.ts';
4
- export * from './isType.ts';
5
- export * from './ObjectTypeShape.ts';
6
- export * from './Typed.ts';
7
- export * from './typeOf.ts';
8
- export * from './TypeOfTypes.ts';
9
- export * from './validateType.ts';
10
- //# sourceMappingURL=index.d.ts.map
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes