@vnodes/utils 0.0.23

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.
Files changed (75) hide show
  1. package/README.md +35 -0
  2. package/bin/version.mjs +12 -0
  3. package/dist/di/di-token.d.ts +2 -0
  4. package/dist/di/di-token.d.ts.map +1 -0
  5. package/dist/di/di-token.js +7 -0
  6. package/dist/di/di-token.js.map +1 -0
  7. package/dist/index.d.ts +18 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +20 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/nestjs/extract-resource-name.d.ts +2 -0
  12. package/dist/nestjs/extract-resource-name.d.ts.map +1 -0
  13. package/dist/nestjs/extract-resource-name.js +5 -0
  14. package/dist/nestjs/extract-resource-name.js.map +1 -0
  15. package/dist/object/get-method-names.d.ts +20 -0
  16. package/dist/object/get-method-names.d.ts.map +1 -0
  17. package/dist/object/get-method-names.js +34 -0
  18. package/dist/object/get-method-names.js.map +1 -0
  19. package/dist/object/get-property-descriptors.d.ts +3 -0
  20. package/dist/object/get-property-descriptors.d.ts.map +1 -0
  21. package/dist/object/get-property-descriptors.js +16 -0
  22. package/dist/object/get-property-descriptors.js.map +1 -0
  23. package/dist/object/keys.d.ts +2 -0
  24. package/dist/object/keys.d.ts.map +1 -0
  25. package/dist/object/keys.js +5 -0
  26. package/dist/object/keys.js.map +1 -0
  27. package/dist/object/omit.d.ts +5 -0
  28. package/dist/object/omit.d.ts.map +1 -0
  29. package/dist/object/omit.js +14 -0
  30. package/dist/object/omit.js.map +1 -0
  31. package/dist/object/pick.d.ts +8 -0
  32. package/dist/object/pick.d.ts.map +1 -0
  33. package/dist/object/pick.js +16 -0
  34. package/dist/object/pick.js.map +1 -0
  35. package/dist/string/coerce.d.ts +2 -0
  36. package/dist/string/coerce.d.ts.map +1 -0
  37. package/dist/string/coerce.js +5 -0
  38. package/dist/string/coerce.js.map +1 -0
  39. package/dist/string/is-number-string.d.ts +2 -0
  40. package/dist/string/is-number-string.d.ts.map +1 -0
  41. package/dist/string/is-number-string.js +10 -0
  42. package/dist/string/is-number-string.js.map +1 -0
  43. package/dist/string/join-lines.d.ts +3 -0
  44. package/dist/string/join-lines.d.ts.map +1 -0
  45. package/dist/string/join-lines.js +8 -0
  46. package/dist/string/join-lines.js.map +1 -0
  47. package/dist/string/normalize-number-string.d.ts +2 -0
  48. package/dist/string/normalize-number-string.d.ts.map +1 -0
  49. package/dist/string/normalize-number-string.js +5 -0
  50. package/dist/string/normalize-number-string.js.map +1 -0
  51. package/dist/string/trim.d.ts +2 -0
  52. package/dist/string/trim.d.ts.map +1 -0
  53. package/dist/string/trim.js +5 -0
  54. package/dist/string/trim.js.map +1 -0
  55. package/dist/value/defined-or-throw.d.ts +3 -0
  56. package/dist/value/defined-or-throw.d.ts.map +1 -0
  57. package/dist/value/defined-or-throw.js +28 -0
  58. package/dist/value/defined-or-throw.js.map +1 -0
  59. package/dist/value/defined.d.ts +3 -0
  60. package/dist/value/defined.d.ts.map +1 -0
  61. package/dist/value/defined.js +9 -0
  62. package/dist/value/defined.js.map +1 -0
  63. package/dist/value/is-defined.d.ts +3 -0
  64. package/dist/value/is-defined.d.ts.map +1 -0
  65. package/dist/value/is-defined.js +17 -0
  66. package/dist/value/is-defined.js.map +1 -0
  67. package/dist/value/is-undefined.d.ts +3 -0
  68. package/dist/value/is-undefined.d.ts.map +1 -0
  69. package/dist/value/is-undefined.js +6 -0
  70. package/dist/value/is-undefined.js.map +1 -0
  71. package/dist/value/string-or-throw.d.ts +2 -0
  72. package/dist/value/string-or-throw.d.ts.map +1 -0
  73. package/dist/value/string-or-throw.js +12 -0
  74. package/dist/value/string-or-throw.js.map +1 -0
  75. package/package.json +65 -0
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ ![Npm version](https://img.shields.io/npm/v/@vnodes/utils)
2
+ ![Npm downloads](https://img.shields.io/npm/dm/@vnodes/utils)
3
+ ![Build Status](https://img.shields.io/github/actions/workflow/status/vnodes/vnodes/ci.yml)
4
+ ![Doc Status](https://img.shields.io/github/actions/workflow/status/vnodes/vnodes/doc.yml)
5
+ ![Bundle size](https://img.shields.io/bundlephobia/min/@vnodes/utils)
6
+
7
+ <p align="center">
8
+ <img srcset="./assets/favicon.png, https://vnodes.github.io/vnodes/libs/utils/assets/favicon.png" alt="Logo" width="200" height="200" style="border-radius: 100%"/>
9
+ </p>
10
+
11
+ ## @vnodes/utils
12
+
13
+ @vnodes/utils
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ pnpm add @vnodes/utils
19
+ ```
20
+
21
+ ## 💖 Support My Work
22
+
23
+ If you find my open-source contributions or the **@vnodes/utils** project helpful, consider supporting my work. Your sponsorship helps me maintain these projects and explore new enterprise patterns.
24
+
25
+ [![CashApp](https://img.shields.io/badge/Sponsor%20me-%23EA4AAA.svg?style=for-the-badge&logo=github-sponsors&logoColor=white)](https://cash.app/$puqlib)
26
+
27
+ ---
28
+
29
+ ## 🤝 Connect with Me
30
+
31
+ <p align="left">
32
+ <a href="mailto:robert.brightline+vnodes-utils@gmail.com">
33
+ <img src="https://img.shields.io/badge/Email-D14836?style=for-the-badge&logo=gmail&logoColor=white" />
34
+ </a>
35
+ </p>
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { readFileSync } from 'node:fs';
4
+ import { dirname, join } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+ const packageJsonPath = join(__dirname, '..', 'package.json');
10
+ const packageJson = readFileSync(packageJsonPath, { encoding: 'utf-8' });
11
+ const version = JSON.parse(packageJson).version;
12
+ console.log(version);
@@ -0,0 +1,2 @@
1
+ export declare function diToken(key: string, profile?: string): string;
2
+ //# sourceMappingURL=di-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"di-token.d.ts","sourceRoot":"","sources":["../../src/di/di-token.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAQpD"}
@@ -0,0 +1,7 @@
1
+ import { defined } from '../value/defined.js';
2
+ export function diToken(key, profile) {
3
+ profile = defined(profile, ()=>`${profile}_`, ()=>'');
4
+ return `${profile}${key}`.toUpperCase();
5
+ }
6
+
7
+ //# sourceMappingURL=di-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/di/di-token.ts"],"sourcesContent":["import { defined } from '../value/defined.js';\n\nexport function diToken(key: string, profile?: string) {\n profile = defined(\n profile,\n () => `${profile}_`,\n () => '',\n );\n\n return `${profile}${key}`.toUpperCase();\n}\n"],"names":["defined","diToken","key","profile","toUpperCase"],"mappings":"AAAA,SAASA,OAAO,QAAQ,sBAAsB;AAE9C,OAAO,SAASC,QAAQC,GAAW,EAAEC,OAAgB;IACjDA,UAAUH,QACNG,SACA,IAAM,GAAGA,QAAQ,CAAC,CAAC,EACnB,IAAM;IAGV,OAAO,GAAGA,UAAUD,KAAK,CAACE,WAAW;AACzC"}
@@ -0,0 +1,18 @@
1
+ export * from './di/di-token.js';
2
+ export * from './nestjs/extract-resource-name.js';
3
+ export * from './object/get-method-names.js';
4
+ export * from './object/get-property-descriptors.js';
5
+ export * from './object/keys.js';
6
+ export * from './object/omit.js';
7
+ export * from './object/pick.js';
8
+ export * from './string/coerce.js';
9
+ export * from './string/is-number-string.js';
10
+ export * from './string/join-lines.js';
11
+ export * from './string/normalize-number-string.js';
12
+ export * from './string/trim.js';
13
+ export * from './value/defined.js';
14
+ export * from './value/defined-or-throw.js';
15
+ export * from './value/is-defined.js';
16
+ export * from './value/is-undefined.js';
17
+ export * from './value/string-or-throw.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ // @index(['./**/*.ts', '!./**/*.{spec,test}.ts'], f => `export * from '${f.path}.js'`)
2
+ export * from './di/di-token.js';
3
+ export * from './nestjs/extract-resource-name.js';
4
+ export * from './object/get-method-names.js';
5
+ export * from './object/get-property-descriptors.js';
6
+ export * from './object/keys.js';
7
+ export * from './object/omit.js';
8
+ export * from './object/pick.js';
9
+ export * from './string/coerce.js';
10
+ export * from './string/is-number-string.js';
11
+ export * from './string/join-lines.js';
12
+ export * from './string/normalize-number-string.js';
13
+ export * from './string/trim.js';
14
+ export * from './value/defined.js';
15
+ export * from './value/defined-or-throw.js';
16
+ export * from './value/is-defined.js';
17
+ export * from './value/is-undefined.js';
18
+ export * from './value/string-or-throw.js';
19
+
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.{spec,test}.ts'], f => `export * from '${f.path}.js'`)\nexport * from './di/di-token.js';\nexport * from './nestjs/extract-resource-name.js';\nexport * from './object/get-method-names.js';\nexport * from './object/get-property-descriptors.js';\nexport * from './object/keys.js';\nexport * from './object/omit.js';\nexport * from './object/pick.js';\nexport * from './string/coerce.js';\nexport * from './string/is-number-string.js';\nexport * from './string/join-lines.js';\nexport * from './string/normalize-number-string.js';\nexport * from './string/trim.js';\nexport * from './value/defined.js';\nexport * from './value/defined-or-throw.js';\nexport * from './value/is-defined.js';\nexport * from './value/is-undefined.js';\nexport * from './value/string-or-throw.js';\n"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,cAAc,mBAAmB;AACjC,cAAc,oCAAoC;AAClD,cAAc,+BAA+B;AAC7C,cAAc,uCAAuC;AACrD,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,qBAAqB;AACnC,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,sCAAsC;AACpD,cAAc,mBAAmB;AACjC,cAAc,qBAAqB;AACnC,cAAc,8BAA8B;AAC5C,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,6BAA6B"}
@@ -0,0 +1,2 @@
1
+ export declare function extractResourceName(className: string): string;
2
+ //# sourceMappingURL=extract-resource-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-resource-name.d.ts","sourceRoot":"","sources":["../../src/nestjs/extract-resource-name.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,UAKpD"}
@@ -0,0 +1,5 @@
1
+ export function extractResourceName(className) {
2
+ return className.replace(/Controller|Resolver|Service|Interceptor|Middleware|Guard|Filter|Module|Pipe|Dto|CreateDto|UpdateDto|QueryDto|ReadDto|/gi, '');
3
+ }
4
+
5
+ //# sourceMappingURL=extract-resource-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/nestjs/extract-resource-name.ts"],"sourcesContent":["export function extractResourceName(className: string) {\n return className.replace(\n /Controller|Resolver|Service|Interceptor|Middleware|Guard|Filter|Module|Pipe|Dto|CreateDto|UpdateDto|QueryDto|ReadDto|/gi,\n '',\n );\n}\n"],"names":["extractResourceName","className","replace"],"mappings":"AAAA,OAAO,SAASA,oBAAoBC,SAAiB;IACjD,OAAOA,UAAUC,OAAO,CACpB,2HACA;AAER"}
@@ -0,0 +1,20 @@
1
+ import type { Any } from '@vnodes/types';
2
+ /**
3
+ * Get the method names from the class's prototype
4
+ *
5
+ * ## Example
6
+ *
7
+ * ```typescript
8
+ *
9
+ * class SampleClass {
10
+ * property = 100;
11
+ * sampleFn(){}
12
+ * }
13
+ *
14
+ * getMethodNames(SampleClass.prototype) /// return ['sampleFn']
15
+ * ```
16
+ * @param classPrototype
17
+ * @returns -- list of method names
18
+ */
19
+ export declare function getMethodNames(target: Any): string[];
20
+ //# sourceMappingURL=get-method-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-method-names.d.ts","sourceRoot":"","sources":["../../src/object/get-method-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,EAAE,CAiBpD"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Get the method names from the class's prototype
3
+ *
4
+ * ## Example
5
+ *
6
+ * ```typescript
7
+ *
8
+ * class SampleClass {
9
+ * property = 100;
10
+ * sampleFn(){}
11
+ * }
12
+ *
13
+ * getMethodNames(SampleClass.prototype) /// return ['sampleFn']
14
+ * ```
15
+ * @param classPrototype
16
+ * @returns -- list of method names
17
+ */ export function getMethodNames(target) {
18
+ const methods = new Set();
19
+ let currentProto = target?.prototype;
20
+ // Stop when we hit the base Object prototype
21
+ while(currentProto && currentProto !== Object.prototype){
22
+ Object.getOwnPropertyNames(currentProto).forEach((name)=>{
23
+ // Filter for functions and exclude the constructor
24
+ if (name !== 'constructor' && typeof currentProto[name] === 'function') {
25
+ methods.add(name);
26
+ }
27
+ });
28
+ // Move up to the parent class
29
+ currentProto = Object.getPrototypeOf(currentProto);
30
+ }
31
+ return Array.from(methods);
32
+ }
33
+
34
+ //# sourceMappingURL=get-method-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/object/get-method-names.ts"],"sourcesContent":["import type { Any } from '@vnodes/types';\n\n/**\n * Get the method names from the class's prototype\n *\n * ## Example\n *\n * ```typescript\n *\n * class SampleClass {\n * property = 100;\n * sampleFn(){}\n * }\n *\n * getMethodNames(SampleClass.prototype) /// return ['sampleFn']\n * ```\n * @param classPrototype\n * @returns -- list of method names\n */\nexport function getMethodNames(target: Any): string[] {\n const methods = new Set<string>();\n let currentProto = target?.prototype;\n\n // Stop when we hit the base Object prototype\n while (currentProto && currentProto !== Object.prototype) {\n Object.getOwnPropertyNames(currentProto).forEach((name) => {\n // Filter for functions and exclude the constructor\n if (name !== 'constructor' && typeof currentProto[name] === 'function') {\n methods.add(name);\n }\n });\n // Move up to the parent class\n currentProto = Object.getPrototypeOf(currentProto);\n }\n\n return Array.from(methods);\n}\n"],"names":["getMethodNames","target","methods","Set","currentProto","prototype","Object","getOwnPropertyNames","forEach","name","add","getPrototypeOf","Array","from"],"mappings":"AAEA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASA,eAAeC,MAAW;IACtC,MAAMC,UAAU,IAAIC;IACpB,IAAIC,eAAeH,QAAQI;IAE3B,6CAA6C;IAC7C,MAAOD,gBAAgBA,iBAAiBE,OAAOD,SAAS,CAAE;QACtDC,OAAOC,mBAAmB,CAACH,cAAcI,OAAO,CAAC,CAACC;YAC9C,mDAAmD;YACnD,IAAIA,SAAS,iBAAiB,OAAOL,YAAY,CAACK,KAAK,KAAK,YAAY;gBACpEP,QAAQQ,GAAG,CAACD;YAChB;QACJ;QACA,8BAA8B;QAC9BL,eAAeE,OAAOK,cAAc,CAACP;IACzC;IAEA,OAAOQ,MAAMC,IAAI,CAACX;AACtB"}
@@ -0,0 +1,3 @@
1
+ import type { Any } from '@vnodes/types';
2
+ export declare function getInheritedPropertyDescriptor(target: Any, methodName: string): PropertyDescriptor | undefined;
3
+ //# sourceMappingURL=get-property-descriptors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-property-descriptors.d.ts","sourceRoot":"","sources":["../../src/object/get-property-descriptors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAiB9G"}
@@ -0,0 +1,16 @@
1
+ export function getInheritedPropertyDescriptor(target, methodName) {
2
+ // 1. Get the initial prototype if target is a constructor,
3
+ // or use target directly if we are already traversing the chain.
4
+ let current = typeof target === 'function' ? target.prototype : target;
5
+ while(current && current !== Object.prototype){
6
+ const descriptor = Object.getOwnPropertyDescriptor(current, methodName);
7
+ if (descriptor) {
8
+ return descriptor;
9
+ }
10
+ // Move up to the next link in the prototype chain
11
+ current = Object.getPrototypeOf(current);
12
+ }
13
+ return undefined;
14
+ }
15
+
16
+ //# sourceMappingURL=get-property-descriptors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/object/get-property-descriptors.ts"],"sourcesContent":["import type { Any } from '@vnodes/types';\n\nexport function getInheritedPropertyDescriptor(target: Any, methodName: string): PropertyDescriptor | undefined {\n // 1. Get the initial prototype if target is a constructor,\n // or use target directly if we are already traversing the chain.\n let current = typeof target === 'function' ? target.prototype : target;\n\n while (current && current !== Object.prototype) {\n const descriptor = Object.getOwnPropertyDescriptor(current, methodName);\n\n if (descriptor) {\n return descriptor;\n }\n\n // Move up to the next link in the prototype chain\n current = Object.getPrototypeOf(current);\n }\n\n return undefined;\n}\n"],"names":["getInheritedPropertyDescriptor","target","methodName","current","prototype","Object","descriptor","getOwnPropertyDescriptor","getPrototypeOf","undefined"],"mappings":"AAEA,OAAO,SAASA,+BAA+BC,MAAW,EAAEC,UAAkB;IAC1E,2DAA2D;IAC3D,iEAAiE;IACjE,IAAIC,UAAU,OAAOF,WAAW,aAAaA,OAAOG,SAAS,GAAGH;IAEhE,MAAOE,WAAWA,YAAYE,OAAOD,SAAS,CAAE;QAC5C,MAAME,aAAaD,OAAOE,wBAAwB,CAACJ,SAASD;QAE5D,IAAII,YAAY;YACZ,OAAOA;QACX;QAEA,kDAAkD;QAClDH,UAAUE,OAAOG,cAAc,CAACL;IACpC;IAEA,OAAOM;AACX"}
@@ -0,0 +1,2 @@
1
+ export declare function keys<T extends object>(obj: T): (keyof T)[];
2
+ //# sourceMappingURL=keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/object/keys.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GACd,CAAC,MAAM,CAAC,CAAC,EAAE,CACzC"}
@@ -0,0 +1,5 @@
1
+ export function keys(obj) {
2
+ return Object.keys(obj);
3
+ }
4
+
5
+ //# sourceMappingURL=keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/object/keys.ts"],"sourcesContent":["export function keys<T extends object>(obj: T) {\n return Object.keys(obj) as (keyof T)[];\n}\n"],"names":["keys","obj","Object"],"mappings":"AAAA,OAAO,SAASA,KAAuBC,GAAM;IACzC,OAAOC,OAAOF,IAAI,CAACC;AACvB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Immutably omits keys from an object.
3
+ */
4
+ export declare function omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
5
+ //# sourceMappingURL=omit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omit.d.ts","sourceRoot":"","sources":["../../src/object/omit.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CASvF"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Immutably omits keys from an object.
3
+ */ export function omit(obj, keys) {
4
+ // Create a shallow copy to ensure the original object is not mutated
5
+ const result = {
6
+ ...obj
7
+ };
8
+ keys.forEach((key)=>{
9
+ delete result[key];
10
+ });
11
+ return result;
12
+ }
13
+
14
+ //# sourceMappingURL=omit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/object/omit.ts"],"sourcesContent":["/**\n * Immutably omits keys from an object.\n */\nexport function omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n // Create a shallow copy to ensure the original object is not mutated\n const result = { ...obj };\n\n keys.forEach((key) => {\n delete result[key];\n });\n\n return result as Omit<T, K>;\n}\n"],"names":["omit","obj","keys","result","forEach","key"],"mappings":"AAAA;;CAEC,GACD,OAAO,SAASA,KAA0CC,GAAM,EAAEC,IAAS;IACvE,qEAAqE;IACrE,MAAMC,SAAS;QAAE,GAAGF,GAAG;IAAC;IAExBC,KAAKE,OAAO,CAAC,CAACC;QACV,OAAOF,MAAM,CAACE,IAAI;IACtB;IAEA,OAAOF;AACX"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Picks a set of properties from an object.
3
+ * * @param obj - The source object
4
+ * @param keys - An array of keys to extract
5
+ * @returns A new object containing only the specified keys
6
+ */
7
+ export declare function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
8
+ //# sourceMappingURL=pick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pick.d.ts","sourceRoot":"","sources":["../../src/object/pick.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAUvF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Picks a set of properties from an object.
3
+ * * @param obj - The source object
4
+ * @param keys - An array of keys to extract
5
+ * @returns A new object containing only the specified keys
6
+ */ export function pick(obj, keys) {
7
+ const result = {};
8
+ keys.forEach((key)=>{
9
+ if (key in obj) {
10
+ result[key] = obj[key];
11
+ }
12
+ });
13
+ return result;
14
+ }
15
+
16
+ //# sourceMappingURL=pick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/object/pick.ts"],"sourcesContent":["/**\n * Picks a set of properties from an object.\n * * @param obj - The source object\n * @param keys - An array of keys to extract\n * @returns A new object containing only the specified keys\n */\nexport function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n keys.forEach((key) => {\n if (key in obj) {\n result[key] = obj[key];\n }\n });\n\n return result;\n}\n"],"names":["pick","obj","keys","result","forEach","key"],"mappings":"AAAA;;;;;CAKC,GACD,OAAO,SAASA,KAA0CC,GAAM,EAAEC,IAAS;IACvE,MAAMC,SAAS,CAAC;IAEhBD,KAAKE,OAAO,CAAC,CAACC;QACV,IAAIA,OAAOJ,KAAK;YACZE,MAAM,CAACE,IAAI,GAAGJ,GAAG,CAACI,IAAI;QAC1B;IACJ;IAEA,OAAOF;AACX"}
@@ -0,0 +1,2 @@
1
+ export declare function coerce<R = unknown>(_value: unknown): R;
2
+ //# sourceMappingURL=coerce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce.d.ts","sourceRoot":"","sources":["../../src/string/coerce.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,CAAC,CAEtD"}
@@ -0,0 +1,5 @@
1
+ export function coerce(_value) {
2
+ return {};
3
+ }
4
+
5
+ //# sourceMappingURL=coerce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/string/coerce.ts"],"sourcesContent":["export function coerce<R = unknown>(_value: unknown): R {\n return {} as R;\n}\n"],"names":["coerce","_value"],"mappings":"AAAA,OAAO,SAASA,OAAoBC,MAAe;IAC/C,OAAO,CAAC;AACZ"}
@@ -0,0 +1,2 @@
1
+ export declare function isNumberString(value: string): boolean;
2
+ //# sourceMappingURL=is-number-string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-number-string.d.ts","sourceRoot":"","sources":["../../src/string/is-number-string.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,WAU3C"}
@@ -0,0 +1,10 @@
1
+ export function isNumberString(value) {
2
+ value = value.replace(/[\s,_]{1,}/g, '');
3
+ const dotCount = value.split('.').length;
4
+ if (dotCount > 2) {
5
+ return false;
6
+ }
7
+ return /^\d{0,}?.\d{0,}$/.test(value);
8
+ }
9
+
10
+ //# sourceMappingURL=is-number-string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/string/is-number-string.ts"],"sourcesContent":["export function isNumberString(value: string) {\n value = value.replace(/[\\s,_]{1,}/g, '');\n\n const dotCount = value.split('.').length;\n\n if (dotCount > 2) {\n return false;\n }\n\n return /^\\d{0,}?.\\d{0,}$/.test(value);\n}\n"],"names":["isNumberString","value","replace","dotCount","split","length","test"],"mappings":"AAAA,OAAO,SAASA,eAAeC,KAAa;IACxCA,QAAQA,MAAMC,OAAO,CAAC,eAAe;IAErC,MAAMC,WAAWF,MAAMG,KAAK,CAAC,KAAKC,MAAM;IAExC,IAAIF,WAAW,GAAG;QACd,OAAO;IACX;IAEA,OAAO,mBAAmBG,IAAI,CAACL;AACnC"}
@@ -0,0 +1,3 @@
1
+ export declare function joinLines(...lines: string[]): string;
2
+ export declare function joinBySpace(...lines: string[]): string;
3
+ //# sourceMappingURL=join-lines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-lines.d.ts","sourceRoot":"","sources":["../../src/string/join-lines.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,UAE3C;AAED,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,UAE7C"}
@@ -0,0 +1,8 @@
1
+ export function joinLines(...lines) {
2
+ return lines.join('\n');
3
+ }
4
+ export function joinBySpace(...lines) {
5
+ return lines.join(' ');
6
+ }
7
+
8
+ //# sourceMappingURL=join-lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/string/join-lines.ts"],"sourcesContent":["export function joinLines(...lines: string[]) {\n return lines.join('\\n');\n}\n\nexport function joinBySpace(...lines: string[]) {\n return lines.join(' ');\n}\n"],"names":["joinLines","lines","join","joinBySpace"],"mappings":"AAAA,OAAO,SAASA,UAAU,GAAGC,KAAe;IACxC,OAAOA,MAAMC,IAAI,CAAC;AACtB;AAEA,OAAO,SAASC,YAAY,GAAGF,KAAe;IAC1C,OAAOA,MAAMC,IAAI,CAAC;AACtB"}
@@ -0,0 +1,2 @@
1
+ export declare function normalizeNumberString(value: string): string;
2
+ //# sourceMappingURL=normalize-number-string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-number-string.d.ts","sourceRoot":"","sources":["../../src/string/normalize-number-string.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,UAElD"}
@@ -0,0 +1,5 @@
1
+ export function normalizeNumberString(value) {
2
+ return value.replace(/[\s,_]{1,}/g, '');
3
+ }
4
+
5
+ //# sourceMappingURL=normalize-number-string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/string/normalize-number-string.ts"],"sourcesContent":["export function normalizeNumberString(value: string) {\n return value.replace(/[\\s,_]{1,}/g, '');\n}\n"],"names":["normalizeNumberString","value","replace"],"mappings":"AAAA,OAAO,SAASA,sBAAsBC,KAAa;IAC/C,OAAOA,MAAMC,OAAO,CAAC,eAAe;AACxC"}
@@ -0,0 +1,2 @@
1
+ export declare function trim(text: string): string;
2
+ //# sourceMappingURL=trim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trim.d.ts","sourceRoot":"","sources":["../../src/string/trim.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,UAEhC"}
@@ -0,0 +1,5 @@
1
+ export function trim(text) {
2
+ return text.trim().replace(/[\s]{1,}/g, ' ');
3
+ }
4
+
5
+ //# sourceMappingURL=trim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/string/trim.ts"],"sourcesContent":["export function trim(text: string) {\n return text.trim().replace(/[\\s]{1,}/g, ' ');\n}\n"],"names":["trim","text","replace"],"mappings":"AAAA,OAAO,SAASA,KAAKC,IAAY;IAC7B,OAAOA,KAAKD,IAAI,GAAGE,OAAO,CAAC,aAAa;AAC5C"}
@@ -0,0 +1,3 @@
1
+ import type { Some } from '@vnodes/types';
2
+ export declare function definedOrThrow<T>(value: Some<T>, defaultValue?: T): T;
3
+ //# sourceMappingURL=defined-or-throw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defined-or-throw.d.ts","sourceRoot":"","sources":["../../src/value/defined-or-throw.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAO,IAAI,EAAE,MAAM,eAAe,CAAC;AAG/C,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,CA8BrE"}
@@ -0,0 +1,28 @@
1
+ import { EmptyStringError, InvalidDateError, NotNumberError, NullError, UndefinedError } from '@vnodes/errors';
2
+ import { isDefined } from './is-defined.js';
3
+ export function definedOrThrow(value, defaultValue) {
4
+ if (isDefined(value)) {
5
+ return value;
6
+ }
7
+ if (isDefined(defaultValue)) {
8
+ return defaultValue;
9
+ }
10
+ if (value === null) {
11
+ throw new NullError();
12
+ }
13
+ if (value === undefined) {
14
+ throw new UndefinedError();
15
+ }
16
+ if (typeof value === 'string') {
17
+ throw new EmptyStringError();
18
+ }
19
+ if (typeof value === 'number') {
20
+ throw new NotNumberError();
21
+ }
22
+ if (value instanceof Date) {
23
+ throw new InvalidDateError();
24
+ }
25
+ throw new UndefinedError();
26
+ }
27
+
28
+ //# sourceMappingURL=defined-or-throw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/value/defined-or-throw.ts"],"sourcesContent":["import { EmptyStringError, InvalidDateError, NotNumberError, NullError, UndefinedError } from '@vnodes/errors';\nimport type { Any, Some } from '@vnodes/types';\nimport { isDefined } from './is-defined.js';\n\nexport function definedOrThrow<T>(value: Some<T>, defaultValue?: T): T {\n if (isDefined(value)) {\n return value;\n }\n\n if (isDefined(defaultValue)) {\n return defaultValue;\n }\n\n if (value === null) {\n throw new NullError();\n }\n\n if (value === undefined) {\n throw new UndefinedError();\n }\n\n if (typeof value === 'string') {\n throw new EmptyStringError();\n }\n\n if (typeof value === 'number') {\n throw new NotNumberError();\n }\n\n if ((value as Any) instanceof Date) {\n throw new InvalidDateError();\n }\n\n throw new UndefinedError();\n}\n"],"names":["EmptyStringError","InvalidDateError","NotNumberError","NullError","UndefinedError","isDefined","definedOrThrow","value","defaultValue","undefined","Date"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,SAAS,EAAEC,cAAc,QAAQ,iBAAiB;AAE/G,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,OAAO,SAASC,eAAkBC,KAAc,EAAEC,YAAgB;IAC9D,IAAIH,UAAUE,QAAQ;QAClB,OAAOA;IACX;IAEA,IAAIF,UAAUG,eAAe;QACzB,OAAOA;IACX;IAEA,IAAID,UAAU,MAAM;QAChB,MAAM,IAAIJ;IACd;IAEA,IAAII,UAAUE,WAAW;QACrB,MAAM,IAAIL;IACd;IAEA,IAAI,OAAOG,UAAU,UAAU;QAC3B,MAAM,IAAIP;IACd;IAEA,IAAI,OAAOO,UAAU,UAAU;QAC3B,MAAM,IAAIL;IACd;IAEA,IAAI,AAACK,iBAAyBG,MAAM;QAChC,MAAM,IAAIT;IACd;IAEA,MAAM,IAAIG;AACd"}
@@ -0,0 +1,3 @@
1
+ import type { Some } from '@vnodes/types';
2
+ export declare function defined<T>(value: Some<T>, thenValue: (value: T) => T, elseValue: () => T): T;
3
+ //# sourceMappingURL=defined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defined.d.ts","sourceRoot":"","sources":["../../src/value/defined.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,CAK5F"}
@@ -0,0 +1,9 @@
1
+ import { isDefined } from './is-defined.js';
2
+ export function defined(value, thenValue, elseValue) {
3
+ if (isDefined(value)) {
4
+ return thenValue(value);
5
+ }
6
+ return elseValue();
7
+ }
8
+
9
+ //# sourceMappingURL=defined.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/value/defined.ts"],"sourcesContent":["import type { Some } from '@vnodes/types';\nimport { isDefined } from './is-defined.js';\n\nexport function defined<T>(value: Some<T>, thenValue: (value: T) => T, elseValue: () => T): T {\n if (isDefined(value)) {\n return thenValue(value);\n }\n return elseValue();\n}\n"],"names":["isDefined","defined","value","thenValue","elseValue"],"mappings":"AACA,SAASA,SAAS,QAAQ,kBAAkB;AAE5C,OAAO,SAASC,QAAWC,KAAc,EAAEC,SAA0B,EAAEC,SAAkB;IACrF,IAAIJ,UAAUE,QAAQ;QAClB,OAAOC,UAAUD;IACrB;IACA,OAAOE;AACX"}
@@ -0,0 +1,3 @@
1
+ import type { Some } from '@vnodes/types';
2
+ export declare function isDefined<T>(value: Some<T>): value is T;
3
+ //# sourceMappingURL=is-defined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-defined.d.ts","sourceRoot":"","sources":["../../src/value/is-defined.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAkBvD"}
@@ -0,0 +1,17 @@
1
+ export function isDefined(value) {
2
+ if (value === null || value === undefined) {
3
+ return false;
4
+ }
5
+ if (typeof value === 'number') {
6
+ return !Number.isNaN(value);
7
+ }
8
+ if (value instanceof Date) {
9
+ return isDefined(value.getTime());
10
+ }
11
+ if (typeof value === 'string') {
12
+ return value.trim().length > 0;
13
+ }
14
+ return true;
15
+ }
16
+
17
+ //# sourceMappingURL=is-defined.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/value/is-defined.ts"],"sourcesContent":["import type { Some } from '@vnodes/types';\n\nexport function isDefined<T>(value: Some<T>): value is T {\n if (value === null || value === undefined) {\n return false;\n }\n\n if (typeof value === 'number') {\n return !Number.isNaN(value);\n }\n\n if (value instanceof Date) {\n return isDefined(value.getTime());\n }\n\n if (typeof value === 'string') {\n return value.trim().length > 0;\n }\n\n return true;\n}\n"],"names":["isDefined","value","undefined","Number","isNaN","Date","getTime","trim","length"],"mappings":"AAEA,OAAO,SAASA,UAAaC,KAAc;IACvC,IAAIA,UAAU,QAAQA,UAAUC,WAAW;QACvC,OAAO;IACX;IAEA,IAAI,OAAOD,UAAU,UAAU;QAC3B,OAAO,CAACE,OAAOC,KAAK,CAACH;IACzB;IAEA,IAAIA,iBAAiBI,MAAM;QACvB,OAAOL,UAAUC,MAAMK,OAAO;IAClC;IAEA,IAAI,OAAOL,UAAU,UAAU;QAC3B,OAAOA,MAAMM,IAAI,GAAGC,MAAM,GAAG;IACjC;IAEA,OAAO;AACX"}
@@ -0,0 +1,3 @@
1
+ import type { Some } from '@vnodes/types';
2
+ export declare function isUndefined<T>(value: Some<T>): value is null | undefined;
3
+ //# sourceMappingURL=is-undefined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-undefined.d.ts","sourceRoot":"","sources":["../../src/value/is-undefined.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,SAAS,CAExE"}
@@ -0,0 +1,6 @@
1
+ import { isDefined } from './is-defined.js';
2
+ export function isUndefined(value) {
3
+ return !isDefined(value);
4
+ }
5
+
6
+ //# sourceMappingURL=is-undefined.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/value/is-undefined.ts"],"sourcesContent":["import type { Some } from '@vnodes/types';\nimport { isDefined } from './is-defined.js';\n\nexport function isUndefined<T>(value: Some<T>): value is null | undefined {\n return !isDefined(value);\n}\n"],"names":["isDefined","isUndefined","value"],"mappings":"AACA,SAASA,SAAS,QAAQ,kBAAkB;AAE5C,OAAO,SAASC,YAAeC,KAAc;IACzC,OAAO,CAACF,UAAUE;AACtB"}
@@ -0,0 +1,2 @@
1
+ export declare function stringOrThrow<T>(value: T): string;
2
+ //# sourceMappingURL=string-or-throw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-or-throw.d.ts","sourceRoot":"","sources":["../../src/value/string-or-throw.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAOjD"}
@@ -0,0 +1,12 @@
1
+ import { InvalidDateError } from '@vnodes/errors';
2
+ import { isDefined } from './is-defined.js';
3
+ export function stringOrThrow(value) {
4
+ if (isDefined(value)) {
5
+ if (typeof value === 'string') {
6
+ return value;
7
+ }
8
+ }
9
+ throw new InvalidDateError(`${value} is not a valid string`);
10
+ }
11
+
12
+ //# sourceMappingURL=string-or-throw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/value/string-or-throw.ts"],"sourcesContent":["import { InvalidDateError } from '@vnodes/errors';\nimport { isDefined } from './is-defined.js';\n\nexport function stringOrThrow<T>(value: T): string {\n if (isDefined(value)) {\n if (typeof value === 'string') {\n return value;\n }\n }\n throw new InvalidDateError(`${value} is not a valid string`);\n}\n"],"names":["InvalidDateError","isDefined","stringOrThrow","value"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,OAAO,SAASC,cAAiBC,KAAQ;IACrC,IAAIF,UAAUE,QAAQ;QAClB,IAAI,OAAOA,UAAU,UAAU;YAC3B,OAAOA;QACX;IACJ;IACA,MAAM,IAAIH,iBAAiB,GAAGG,MAAM,sBAAsB,CAAC;AAC/D"}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@vnodes/utils",
3
+ "version": "0.0.23",
4
+ "description": "@vnodes/utils",
5
+ "keywords": [
6
+ "utils"
7
+ ],
8
+ "author": {
9
+ "name": "Robert Brightline",
10
+ "email": "robert.brightline+vnodes-utils@gmail.com",
11
+ "url": "https://vnodes.github.io/vnodes"
12
+ },
13
+ "homepage": "https://vnodes.github.io/vnodes/libs/utils",
14
+ "icon": "https://vnodes.github.io/vnodes/libs/utils/assets/favicon.png",
15
+ "funding": [
16
+ "https://cash.app/$puqlib"
17
+ ],
18
+ "bin": {
19
+ "version": "./bin/version.mjs"
20
+ },
21
+ "type": "module",
22
+ "main": "./dist/index.js",
23
+ "module": "./dist/index.js",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ "./package.json": "./package.json",
27
+ ".": {
28
+ "@vnodes/source": "./src/index.ts",
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js",
31
+ "default": "./dist/index.js"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "bin",
37
+ "!**/*.tsbuildinfo"
38
+ ],
39
+ "nx": {
40
+ "sourceRoot": "libs/utils/src",
41
+ "targets": {
42
+ "build": {},
43
+ "doc": {},
44
+ "lint": {}
45
+ },
46
+ "tags": [
47
+ "lib"
48
+ ]
49
+ },
50
+ "dependencies": {
51
+ "@swc/helpers": "~0.5.18"
52
+ },
53
+ "peerDependencies": {
54
+ "@vnodes/types": "0.0.23",
55
+ "@vnodes/errors": "0.0.23"
56
+ },
57
+ "devDependencies": {
58
+ "@vnodes/types": "0.0.23",
59
+ "@vnodes/errors": "0.0.23"
60
+ },
61
+ "publishConfig": {
62
+ "access": "public",
63
+ "tag": "latest"
64
+ }
65
+ }