@xyo-network/typeof 5.3.22 → 5.3.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/typeof",
3
- "version": "5.3.22",
3
+ "version": "5.3.25",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,7 +30,6 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
33
  "!**/*.bench.*",
35
34
  "!**/*.spec.*",
36
35
  "!**/*.test.*",
@@ -38,17 +37,14 @@
38
37
  ],
39
38
  "devDependencies": {
40
39
  "@types/node": "^25.5.0",
41
- "@xylabs/ts-scripts-common": "~7.6.8",
42
- "@xylabs/ts-scripts-yarn3": "~7.6.8",
43
- "@xylabs/tsconfig": "~7.6.8",
40
+ "@xylabs/ts-scripts-common": "~7.6.16",
41
+ "@xylabs/ts-scripts-pnpm": "~7.6.16",
42
+ "@xylabs/tsconfig": "~7.6.16",
44
43
  "acorn": "^8.16.0",
45
- "cosmiconfig": "^9.0.1",
46
- "esbuild": "^0.27.4",
47
- "eslint": "^10.1.0",
48
- "rollup": "^4.60.1",
44
+ "esbuild": "^0.28.0",
49
45
  "typescript": "~5.9.3"
50
46
  },
51
47
  "publishConfig": {
52
48
  "access": "public"
53
49
  }
54
- }
50
+ }
@@ -1,2 +0,0 @@
1
- /** @deprecated use @xylabs/typeof or zod */
2
- export type TypeOfTypes = 'string' | 'number' | 'object' | 'array' | 'buffer' | 'null' | 'undefined' | 'bigint' | 'boolean' | 'function' | 'symbol'
package/src/ifDefined.ts DELETED
@@ -1,17 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-deprecated */
2
- /* eslint-disable sonarjs/deprecation */
3
- import { typeOf } from './typeOf.ts'
4
-
5
- /** @deprecated use @xylabs/typeof or zod */
6
- export const ifDefined = <T>(value: T, function_: (value: T) => void): T | undefined => {
7
- switch (typeOf(value)) {
8
- case 'undefined':
9
- case 'null': {
10
- break
11
- }
12
- default: {
13
- function_(value)
14
- return value
15
- }
16
- }
17
- }
package/src/ifTypeOf.ts DELETED
@@ -1,18 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-deprecated */
2
- /* eslint-disable sonarjs/deprecation */
3
- import { typeOf } from './typeOf.ts'
4
- import type { TypeOfTypes } from './TypeOfTypes.ts'
5
-
6
- /** @deprecated use @xylabs/typeof or zod */
7
- export const ifTypeOf = <T, R>(
8
- typeName: TypeOfTypes,
9
- value: unknown,
10
- trueFunction: (value: T) => R,
11
- isFunction?: (value: T) => boolean,
12
- ): R | undefined => {
13
- switch (typeOf(value)) {
14
- case typeName: {
15
- return !isFunction || isFunction(value as T) ? trueFunction(value as T) : undefined
16
- }
17
- }
18
- }
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './ifDefined.ts'
2
- export * from './ifTypeOf.ts'
3
- export * from './typeOf.ts'
4
- export * from './TypeOfTypes.ts'
5
- export * from './validateType.ts'
package/src/typeOf.ts DELETED
@@ -1,8 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-deprecated */
2
- /* eslint-disable sonarjs/deprecation */
3
- import type { TypeOfTypes } from './TypeOfTypes.ts'
4
-
5
- /** @deprecated use @xylabs/typeof or zod */
6
- export const typeOf = <T>(item: T): TypeOfTypes => {
7
- return Array.isArray(item) ? 'array' : typeof item
8
- }
@@ -1,19 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-deprecated */
2
- /* eslint-disable sonarjs/deprecation */
3
- import { typeOf } from './typeOf.ts'
4
- import type { TypeOfTypes } from './TypeOfTypes.ts'
5
-
6
- /** @deprecated use @xylabs/typeof or zod */
7
- export const validateType = <T>(typeName: TypeOfTypes, value: T, optional = false): [T | undefined, Error[]] => {
8
- switch (typeOf(value)) {
9
- case typeName: {
10
- return [value, []]
11
- }
12
- default: {
13
- if (optional && typeOf(value) === 'undefined') {
14
- return [value, []]
15
- }
16
- return [undefined, [new Error(`value type is not '${typeName}:${typeof value}'`)]]
17
- }
18
- }
19
- }