@budsbox/lib-es 2.3.0 → 3.0.0

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/string.js CHANGED
@@ -1,27 +1,44 @@
1
- import { isNil, isNotNil, isString } from './guards.js';
1
+ /* eslint-disable jsdoc/informative-docs */
2
+ import { assertArray, assertBoolean, assertNotNil, assertObject, assertOptionalProp, assertProp, assertSome, assertString, isBoolean, isNil, isNotNil, isNumber, isObject, isPropKey, isString, isUndef, somePredicate, } from '#guards';
3
+ import { joinWithConjunction as _joinWithConjunction, formatAccessString, } from '#guards/format';
2
4
  /**
3
5
  * Parses a package name string to extract its scope and name.
4
6
  *
5
7
  * @param packageName - The full name of the package, potentially including a scope.
6
8
  * @param clean - A flag indicating whether to return a cleaned version (i.e., without a leading `@` and trailing `/`) of the scope. Defaults to false.
7
9
  * @returns An object containing the parsed scope and name of the package. The scope will be `null` if no scope is present.
10
+ * @category Package Name
8
11
  */
9
12
  export function parsePackageName(packageName, clean = false) {
13
+ assertString(packageName, 'packageName');
14
+ assertBoolean(clean, 'clean');
10
15
  const [scope, cleanScope] = /^@([^/]+)\//.exec(packageName) ?? [null, null];
11
16
  return {
12
17
  scope: clean ? cleanScope : scope,
13
18
  name: packageName.replace(scope ?? '', ''),
14
19
  };
15
20
  }
21
+ function normalizePackageName(ident, clean) {
22
+ assertSome(ident, 'ident', isString, isObject);
23
+ if (isObject(ident)) {
24
+ assertProp(ident, 'name', isString);
25
+ assertOptionalProp(ident, 'scope', somePredicate(isString, isNil));
26
+ return {
27
+ ...ident,
28
+ scope: ident.scope ?? null,
29
+ };
30
+ }
31
+ return parsePackageName(ident, clean);
32
+ }
16
33
  export function serializePackageName(parsedPackageName, allowNil = false) {
17
- if (!allowNil && isNil(parsedPackageName)) {
18
- throw new TypeError('Expected a non-nil value');
34
+ if (!allowNil) {
35
+ assertNotNil(parsedPackageName, 'parsedPackageName');
19
36
  }
20
- const { scope, name } = parsedPackageName ?? { scope: null, name: '' };
37
+ const { scope, name } = normalizePackageName(parsedPackageName ?? { scope: null, name: '' });
21
38
  return joinPath(scope?.replace(/^@?/, '@'), name);
22
39
  }
23
40
  export function resolvePackageName(ident, { baseScope, parsed = false, } = {}) {
24
- const { scope, name } = isString(ident) ? parsePackageName(ident) : ident;
41
+ const { scope, name } = normalizePackageName(ident);
25
42
  const parsedIdent = {
26
43
  scope: scope ?? baseScope ?? null,
27
44
  name,
@@ -40,15 +57,32 @@ export function resolvePackageName(ident, { baseScope, parsed = false, } = {}) {
40
57
  * @param options.nameDelimiter - The delimiter used to separate parents name from the base name of the package. Defaults to `'_'`.
41
58
  * @param options.excludePathChunks - Array of path chunks to be excluded when constructing the path. Defaults to `['packages']`.
42
59
  * @returns The formatted package name as a string.
60
+ * @category Package Name
43
61
  */
44
- export function formatPackageName(base, { root = null, parent = root, relCwd = '', pathDelimiter = '-', nameDelimiter = '_', excludePathChunks = ['packages'], } = {}) {
62
+ export function formatPackageName(base, options = {}) {
63
+ assertString(base, 'base');
64
+ assertObject(options, 'options');
65
+ ['root', 'parent'].forEach((key) => {
66
+ assertOptionalProp(options, key, somePredicate(isString, isNil), 'options');
67
+ });
68
+ ['relCwd', 'pathDelimiter', 'nameDelimiter'].forEach((key) => {
69
+ assertOptionalProp(options, key, somePredicate(isString, isUndef), 'options');
70
+ });
71
+ const { root = null, parent = root, relCwd = '', pathDelimiter = '-', nameDelimiter = '_', excludePathChunks = ['packages'], } = options;
72
+ assertArray(excludePathChunks, isString, 'excludePathChunks');
73
+ [
74
+ ['relCwd', relCwd],
75
+ ['pathDelimiter', pathDelimiter],
76
+ ['nameDelimiter', nameDelimiter],
77
+ ].forEach(([name, value]) => void assertString(value, name));
78
+ assertArray(excludePathChunks, isString, 'options.excludePathChunks');
45
79
  const topLevel = parent === root;
46
80
  const exclude = new Set(excludePathChunks);
47
81
  const pathChunks = splitPath(relCwd).filter((chunk) => !exclude.has(chunk));
48
82
  if (pathChunks.at(-1) === base) {
49
83
  pathChunks.pop();
50
84
  }
51
- const { scope, name: parentName } = parsePackageName(parent ?? '');
85
+ const { scope, name: parentName } = normalizePackageName(parent ?? '');
52
86
  return serializePackageName({
53
87
  scope,
54
88
  name: [
@@ -63,6 +97,7 @@ export function formatPackageName(base, { root = null, parent = root, relCwd = '
63
97
  * @param value - The value to be converted to its string representation. Can be of any type.
64
98
  * @returns A string representation of the input value.
65
99
  * If the value cannot be serialized using JSON.stringify, it falls back to using String conversion.
100
+ * @deprecated Use `formatDebugValue` from `@budsbox/lib-es/guards` instead.
66
101
  */
67
102
  export function debugString(value) {
68
103
  try {
@@ -80,6 +115,7 @@ export function debugString(value) {
80
115
  * @returns The processed string with trimmed and normalized whitespace.
81
116
  */
82
117
  export function clampWS(str) {
118
+ assertString(str, 'str');
83
119
  return str.trim().replace(/\s+/g, ' ');
84
120
  }
85
121
  /**
@@ -90,8 +126,10 @@ export function clampWS(str) {
90
126
  * @param parts - An array of path parts to join. Each part can be a string, number, boolean, null, or undefined.
91
127
  * Non-string values will be serialized, and null/undefined values are ignored.
92
128
  * @returns The combined path as a single string, with proper slash formatting.
129
+ * @category Paths
93
130
  */
94
131
  export function joinPath(...parts) {
132
+ assertArray(parts, somePredicate(isString, isNumber, isBoolean, isNil), 'parts');
95
133
  return parts
96
134
  .filter(isNotNil)
97
135
  .reduce((acc, part) => acc.length === 0 ?
@@ -106,20 +144,38 @@ export function joinPath(...parts) {
106
144
  * @param keepEmptyChunks - A boolean indicating whether empty strings (resulting from consecutive delimiters)
107
145
  * should be preserved in the output array. Defaults to `false`.
108
146
  * @returns An array of strings representing the components of the path.
147
+ * @category Paths
109
148
  */
110
149
  export function splitPath(path, keepEmptyChunks = false) {
111
- const splitted = path.split(/\/+/);
150
+ assertString(path, 'path');
151
+ assertBoolean(keepEmptyChunks, 'keepEmptyChunks');
152
+ const splitted = path.split(keepEmptyChunks ? '/' : /\/+/);
112
153
  return keepEmptyChunks ? splitted : (splitted.filter((chunk) => chunk.length > 0));
113
154
  }
114
155
  export function camelCase(name) {
115
- return clampWS(name).replace(/[-_\s]+([^-_\s])/g, (_, suffix) => suffix.toUpperCase());
156
+ assertString(name, 'name');
157
+ return clampWS(name)
158
+ .replace(/[-_\s]+([^-_\s])/g, (_, suffix) => suffix.toUpperCase())
159
+ .replace(/^./, (char) => char.toLowerCase())
160
+ .replace(/[-_\s]+/g, '');
116
161
  }
117
162
  export function pascalCase(name) {
118
- return camelCase(name).replace(/^./, (c) => c.toUpperCase());
163
+ return camelCase(name).replace(/^./, (char) => char.toUpperCase());
119
164
  }
120
165
  export function delimCase(name, delimiter = '-') {
121
- return clampWS(name)
122
- .replace(/(.)([A-Z])/g, `$1${delimiter}$2`)
166
+ assertString(name, 'name');
167
+ assertString(delimiter, 'delimiter');
168
+ const clamped = clampWS(name);
169
+ const chars = [];
170
+ for (let i = 0; i < clamped.length; i++) {
171
+ const char = clamped[i];
172
+ if (/^[A-Z]$/.test(char) && i !== 0) {
173
+ chars.push(delimiter);
174
+ }
175
+ chars.push(char);
176
+ }
177
+ return chars
178
+ .join('')
123
179
  .replace(/[-_\s]+/g, delimiter)
124
180
  .toLowerCase();
125
181
  }
@@ -129,4 +185,34 @@ export function kebabCase(name) {
129
185
  export function snakeCase(name) {
130
186
  return delimCase(name, '_');
131
187
  }
188
+ /**
189
+ * Joins an array of strings into a single formatted string using the specified conjunction.
190
+ *
191
+ * @param items - An array of strings to be joined. If the array is empty, an empty string is returned.
192
+ * @param conjunction - A word or phrase (`and` or `or`) to be used as the conjunction between the last two items.
193
+ * @returns A formatted string where the items are separated by commas and the conjunction is added before the final item.
194
+ */
195
+ export function joinWithConjunction(items, conjunction) {
196
+ assertArray(items, isString, 'items');
197
+ assertString(conjunction, 'conjunction');
198
+ return _joinWithConjunction(items, conjunction);
199
+ }
200
+ /**
201
+ * Constructs a dot-notation or bracket-notation string representation
202
+ * for accessing nested properties of an object based on the provided keys.
203
+ *
204
+ * @internal
205
+ * @param sourceName - The base name of the object or source from which properties are being accessed.
206
+ * @param keys - A variadic list of property keys representing the nested path.
207
+ * Each key will be used to generate the accessor string.
208
+ * @returns A string representing the accessor path in dot-notation for valid identifiers
209
+ * or bracket-notation for non-identifier keys.
210
+ * @remarks This function considers "valid" for identifiers only alphanumeric characters,
211
+ * underscores, and dollar signs.
212
+ */
213
+ export function formatPropAccessor(sourceName, ...keys) {
214
+ assertString(sourceName, 'sourceName');
215
+ assertArray(keys, isPropKey, 'keys');
216
+ return formatAccessString(sourceName, ...keys);
217
+ }
132
218
  //# sourceMappingURL=string.js.map
package/dist/types.d.ts CHANGED
@@ -1,94 +1,40 @@
1
+ import type { FValue, Maybe, Predicate, TypePredicate, Undef, ValuePredicate } from '@budsbox/lib-types';
1
2
  /**
2
- * The `FValue` type represents a union type that can be either a value of type `T` or a function
3
- * that takes a parameter of type `A` and returns a value of type `T`.
3
+ * Resolves to a type based on a predicate or type guard and the selected branch.
4
4
  *
5
- * @typeParam A - The type of the parameter for the function.
6
- * @typeParam T - The type of the value or the return type of the function.
5
+ * @typeParam TValue - The value type under test.
6
+ * @typeParam TTestFn - A `Predicate` or `TypePredicate` applied to `TValue`.
7
+ * @typeParam TBranch - If `true`, keep the narrowed part; if `false`, exclude it.
7
8
  */
8
- export type FValue<A, T> = T | ((value: A) => T);
9
+ export type TestFnResult<TValue, TTestFn extends Predicate, TBranch extends boolean> = TTestFn extends TypePredicate<unknown, infer TNarrowed> ? TBranch extends true ? Extract<TValue, TNarrowed> : Exclude<TValue, TNarrowed> : TTestFn extends ValuePredicate<infer TOriginal> ? TOriginal : never;
9
10
  /**
10
- * A type representing a type guard function that determines if a given value of type `T`
11
- * conforms to a more specific type `V`, where `V` is a subtype of `T`.
11
+ * Maps the "true" branch of a test to a value or function result type.
12
12
  *
13
- * This function should be implemented to return `true` if the provided value matches
14
- * the more specific type `V`, and `false` otherwise. By using a type guard, TypeScript can
15
- * narrow the type of variable within the scope of a condition.
16
- *
17
- * @typeParam T - The broader type against which the value will be checked.
18
- * @typeParam V - The narrowed type that `T` is tested against. V must extend T.
19
- * @param value - The value of type `T` to be tested against the narrowed type `V`.
20
- * @returns A boolean value indicating whether the input value is of type `V`.
21
- */
22
- export type TypeGuard<T, V extends T> = (value: T) => value is V;
23
- /**
24
- * A type definition for a function that performs a boolean test on a given value.
25
- *
26
- * This generic type accepts a parameter `T`, which represents the type of the input
27
- * that the function will evaluate. The function returns a boolean indicating the
28
- * result of the test.
29
- *
30
- * @typeParam T - The type of the input value that the function will evaluate.
31
- * @param value - The input value to test.
32
- * @returns A boolean indicating the result of the test.
33
- */
34
- export type Predicate<T> = (value: T) => boolean;
35
- /**
36
- * Represents a type that can either be a `TypeGuard` or a `TestFn`.
37
- *
38
- * `TestParam` is a utility type that allows defining parameters used in testing or
39
- * type-checking procedures. It accommodates both type guard functions and test
40
- * functions for more comprehensive type handling.
41
- *
42
- * @typeParam TValue - The base type to be tested or narrowed. Defaults to `any`.
43
- * @typeParam TNarrowed - A subtype of `ValueType` that represents the narrowed type.
44
- * Defaults to `ValueType`.
45
- */
46
- export type TestFn<TValue = any, TNarrowed extends TValue = TValue> = Predicate<TValue> | TypeGuard<TValue, TNarrowed>;
47
- /**
48
- * Represents a type that evaluates to a specific result based on the provided test conditions.
49
- *
50
- * @typeParam TValue - The type of value being tested.
51
- * @typeParam TTestFn - The type of test being applied. This could be a type guard or a test function.
52
- * @typeParam TBranch - A boolean that determines the branch type. If true, the resulting type will
53
- * focus on the narrowed type; otherwise, it excludes the narrowed type.
54
- *
55
- * The type resolves based on the following rules:
56
- * 1. If `TestType` is a type guard:
57
- * - If `BranchType` is `true`, the resulting type includes only the portion of `ValueType` that
58
- * conforms to the narrowed type.
59
- * - If `BranchType` is `false`, the resulting type excludes the portion of `ValueType` that
60
- * conforms to the narrowed type.
61
- * 2. If `TestType` is a test function, the resulting type will be the original type inferred by
62
- * the test function.
63
- * 3. If neither condition applies, the resulting type will be `never`.
64
- */
65
- export type TestFnResult<TValue, TTestFn extends TestFn, TBranch extends boolean> = TTestFn extends TypeGuard<unknown, infer TNarrowed> ? TBranch extends true ? Extract<TValue, TNarrowed> : Exclude<TValue, TNarrowed> : TTestFn extends Predicate<infer TOriginal> ? TOriginal : never;
66
- /**
67
- * A type definition that represents a resolved value when a certain test condition is true.
68
- *
69
- * @typeParam ValueType - Represents the type of the input value being tested.
70
- * @typeParam TestType - Extends the `TestParam` type and defines the parameters for the test condition.
71
- * @typeParam ReturnType - Specifies the type of the resulting value after the test condition is satisfied.
72
- *
73
- * This type combines the test result with a return type, capturing the transformed value
74
- * or operation result when the test evaluates to `true`.
13
+ * @typeParam TValue - The input value type being tested.
14
+ * @typeParam TTestFn - The test (predicate or type guard).
15
+ * @typeParam TResult - The resulting value type.
75
16
  */
76
- export type FValueTrue<TValue, TTestFn extends TestFn, TResult> = FValue<TestFnResult<TValue, TTestFn, true>, TResult>;
17
+ export type FValueTrue<TValue, TTestFn extends Predicate, TResult> = FValue<TestFnResult<TValue, TTestFn, true>, TResult>;
77
18
  /**
78
- * Represents a type that maps a test result to a specific return type when the test evaluates to false.
79
- *
80
- * This type is a utility that processes the result of a test operation (`TestResultType`)
81
- * when the provided test condition evaluates as false, associating it with a specific return type (`ReturnType`).
19
+ * Maps the "false" branch of a test to a value or function result type.
82
20
  *
83
- * @typeParam ValueType - The type of the primary value being tested.
84
- * @typeParam TestType - A type extending `TestParam` representing the condition being tested.
85
- * @typeParam ReturnType - The type of the result or output when the test condition evaluates to false.
21
+ * @typeParam TValue - The input value type being tested.
22
+ * @typeParam TTestFn - The test (predicate or type guard).
23
+ * @typeParam TResult - The resulting value type.
86
24
  */
87
- export type FValueFalse<TValue, TTestFn extends TestFn, TResult> = FValue<TestFnResult<TValue, TTestFn, false>, TResult>;
25
+ export type FValueFalse<TValue, TTestFn extends Predicate, TResult> = FValue<TestFnResult<TValue, TTestFn, false>, TResult>;
88
26
  /**
89
27
  * Represents a parsed Node.js (npm) package name split into its optional scope and the bare name.
28
+ *
29
+ * @inline
30
+ * @category Package Name
90
31
  */
91
32
  export interface ParsedPackageName {
33
+ /**
34
+ * The unscoped package name (the segment after the scope or the whole name if unscoped).
35
+ * For "@scope/pkg", this is "pkg"; for "pkg", this is "pkg".
36
+ */
37
+ name: string;
92
38
  /**
93
39
  * The scope part of the package name (organization/user), with or without the leading "@" and trail "/".
94
40
  * If the package is unscoped, this will be `null` or `undefined`.
@@ -96,10 +42,49 @@ export interface ParsedPackageName {
96
42
  * @example "scope" for "@scope/pkg", or "undefined" for "pkg"
97
43
  */
98
44
  scope?: string | null;
45
+ }
46
+ /**
47
+ * Options for formatting the package name.
48
+ *
49
+ * @inline
50
+ * @category Package Name
51
+ */
52
+ export interface PackageNameFormatOptions {
99
53
  /**
100
- * The unscoped package name (the segment after the scope or the whole name if unscoped).
101
- * For "@scope/pkg", this is "pkg"; for "pkg", this is "pkg".
54
+ * Array of path chunks to be excluded when constructing the path.
55
+ *
56
+ * @defaultValue `['packages']`
102
57
  */
103
- name: string;
58
+ excludePathChunks?: Undef<readonly string[]>;
59
+ /**
60
+ * The delimiter used to separate parents name from the base name of the package.
61
+ *
62
+ * @defaultValue `'_'`
63
+ */
64
+ nameDelimiter?: Undef<string>;
65
+ /**
66
+ * The parent package name.
67
+ *
68
+ * @defaultValue `options.root`
69
+ */
70
+ parent?: Maybe<string>;
71
+ /**
72
+ * The delimiter used to separate path chunks.
73
+ *
74
+ * @defaultValue `'-'`
75
+ */
76
+ pathDelimiter?: Undef<string>;
77
+ /**
78
+ * The path to the package, relative to its parent.
79
+ *
80
+ * @defaultValue `''`
81
+ */
82
+ relCwd?: Undef<string>;
83
+ /**
84
+ * The root identifier for the package.
85
+ *
86
+ * @defaultValue `null`
87
+ */
88
+ root?: Maybe<string>;
104
89
  }
105
90
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,137 +1,86 @@
1
1
  {
2
2
  "name": "@budsbox/lib-es",
3
- "version": "2.3.0",
4
- "homepage": "https://gitlab.com/budsbox/fe/seed",
3
+ "version": "3.0.0",
4
+ "homepage": "https://github.com/budsbox/seed",
5
5
  "bugs": {
6
- "url": "https://gitlab.com/budsbox/fe/seed/-/issues"
6
+ "url": "https://github.com/budsbox/seed/issues"
7
7
  },
8
- "repository": "gitlab:budsbox/fe/seed",
8
+ "repository": "git@github.com:budsbox/seed.git",
9
9
  "license": "MIT",
10
10
  "author": "Konstantin Kutsyllo <trikadin@pm.me>",
11
11
  "type": "module",
12
12
  "imports": {
13
13
  "#package.json": "./package.json",
14
+ "#types": "./dist/types.d.ts",
14
15
  "#array": {
15
- "import": {
16
- "default": "./dist/array.js",
17
- "types": "./dist/array.d.ts"
18
- },
19
- "require": {
20
- "default": "./dist/array.js",
21
- "types": "./dist/array.d.ts"
22
- }
16
+ "types": "./dist/array.d.ts",
17
+ "default": "./dist/array.js"
23
18
  },
24
19
  "#object": {
25
- "import": {
26
- "default": "./dist/object.js",
27
- "types": "./dist/object.d.ts"
28
- },
29
- "require": {
30
- "default": "./dist/object.js",
31
- "types": "./dist/object.d.ts"
32
- }
20
+ "types": "./dist/object.d.ts",
21
+ "default": "./dist/object.js"
33
22
  },
34
23
  "#string": {
35
- "import": {
36
- "default": "./dist/string.js",
37
- "types": "./dist/string.d.ts"
38
- },
39
- "require": {
40
- "default": "./dist/string.js",
41
- "types": "./dist/string.d.ts"
42
- }
24
+ "types": "./dist/string.d.ts",
25
+ "default": "./dist/string.js"
43
26
  },
44
27
  "#guards": {
45
- "import": {
46
- "default": "./dist/guards.js",
47
- "types": "./dist/guards.d.ts"
48
- },
49
- "require": {
50
- "default": "./dist/guards.js",
51
- "types": "./dist/guards.d.ts"
52
- }
28
+ "types": "./dist/guards/index.d.ts",
29
+ "default": "./dist/guards/index.js"
30
+ },
31
+ "#guards/*": {
32
+ "types": "./dist/guards/*.d.ts",
33
+ "default": "./dist/guards/*.js"
53
34
  },
54
35
  "#logical": {
55
- "import": {
56
- "default": "./dist/logical.js",
57
- "types": "./dist/logical.d.ts"
58
- },
59
- "require": {
60
- "default": "./dist/logical.js",
61
- "types": "./dist/logical.d.ts"
62
- }
36
+ "types": "./dist/logical.d.ts",
37
+ "default": "./dist/logical.js"
63
38
  },
64
39
  "#function": {
65
- "import": {
66
- "default": "./dist/function.js",
67
- "types": "./dist/function.d.ts"
68
- },
69
- "require": {
70
- "default": "./dist/function.js",
71
- "types": "./dist/function.d.ts"
72
- }
40
+ "types": "./dist/function.d.ts",
41
+ "default": "./dist/function.js"
42
+ },
43
+ "#set": {
44
+ "types": "./dist/set.d.ts",
45
+ "default": "./dist/set.js"
46
+ },
47
+ "#map": {
48
+ "types": "./dist/map.d.ts",
49
+ "default": "./dist/map.js"
73
50
  }
74
51
  },
75
52
  "exports": {
76
53
  "./array": {
77
- "import": {
78
- "default": "./dist/array.js",
79
- "types": "./dist/array.d.ts"
80
- },
81
- "require": {
82
- "default": "./dist/array.js",
83
- "types": "./dist/array.d.ts"
84
- }
54
+ "types": "./dist/array.d.ts",
55
+ "default": "./dist/array.js"
85
56
  },
86
57
  "./object": {
87
- "import": {
88
- "default": "./dist/object.js",
89
- "types": "./dist/object.d.ts"
90
- },
91
- "require": {
92
- "default": "./dist/object.js",
93
- "types": "./dist/object.d.ts"
94
- }
58
+ "types": "./dist/object.d.ts",
59
+ "default": "./dist/object.js"
95
60
  },
96
61
  "./string": {
97
- "import": {
98
- "default": "./dist/string.js",
99
- "types": "./dist/string.d.ts"
100
- },
101
- "require": {
102
- "default": "./dist/string.js",
103
- "types": "./dist/string.d.ts"
104
- }
62
+ "types": "./dist/string.d.ts",
63
+ "default": "./dist/string.js"
105
64
  },
106
65
  "./guards": {
107
- "import": {
108
- "default": "./dist/guards.js",
109
- "types": "./dist/guards.d.ts"
110
- },
111
- "require": {
112
- "default": "./dist/guards.js",
113
- "types": "./dist/guards.d.ts"
114
- }
66
+ "types": "./dist/guards/index.d.ts",
67
+ "default": "./dist/guards/index.js"
115
68
  },
116
69
  "./logical": {
117
- "import": {
118
- "default": "./dist/logical.js",
119
- "types": "./dist/logical.d.ts"
120
- },
121
- "require": {
122
- "default": "./dist/logical.js",
123
- "types": "./dist/logical.d.ts"
124
- }
70
+ "types": "./dist/logical.d.ts",
71
+ "default": "./dist/logical.js"
125
72
  },
126
73
  "./function": {
127
- "import": {
128
- "default": "./dist/function.js",
129
- "types": "./dist/function.d.ts"
130
- },
131
- "require": {
132
- "default": "./dist/function.js",
133
- "types": "./dist/function.d.ts"
134
- }
74
+ "types": "./dist/function.d.ts",
75
+ "default": "./dist/function.js"
76
+ },
77
+ "./set": {
78
+ "types": "./dist/set.d.ts",
79
+ "default": "./dist/set.js"
80
+ },
81
+ "./map": {
82
+ "types": "./dist/map.d.ts",
83
+ "default": "./dist/map.js"
135
84
  },
136
85
  "./package.json": "./package.json"
137
86
  },
@@ -140,34 +89,38 @@
140
89
  "dist/**/*.js"
141
90
  ],
142
91
  "scripts": {
92
+ "build": "run p:ts:build",
143
93
  "name": "echo $npm_package_name",
144
- "prepack": "yarn p:ts:prepack"
94
+ "prepack": "yarn p:ts:prepack",
95
+ "test": "run p:vitest",
96
+ "watch": "yarn p:ts:watch"
145
97
  },
146
98
  "dependencies": {
147
- "@budsbox/lib-types": "^1.2.0",
148
- "@types/node": "^22.15.2",
99
+ "@budsbox/lib-types": "^1.4.0",
100
+ "@types/node": "^22.19.1",
149
101
  "tslib": "^2.8.1",
150
- "type-fest": "^4.32.0"
102
+ "type-fest": "^5.3.1"
151
103
  },
152
104
  "devDependencies": {
153
- "@budsbox/eslint": "^1.2.0",
154
- "@budsbox/eslint_presets-lib": "^1.0.4",
155
- "@budsbox/eslint_presets-tools": "^1.0.4",
156
- "@budsbox/tsconfigs": "^4.3.1",
157
- "@eslint/js": "^9.26.0",
105
+ "@budsbox/eslint": "^1.3.0",
106
+ "@budsbox/eslint_presets-lib": "^1.0.5",
107
+ "@budsbox/eslint_presets-tools": "^1.0.5",
108
+ "@budsbox/tsconfigs": "^4.4.0",
109
+ "@eslint/js": "^9.39.1",
158
110
  "@types/eslint": "^9.6.1",
159
- "@typescript-eslint/parser": "^8.32.1",
160
- "eslint": "^9.26.0",
161
- "eslint-config-prettier": "^10.1.5",
162
- "eslint-import-resolver-typescript": "^4.3.4",
163
- "eslint-plugin-import-x": "^4.11.1",
164
- "eslint-plugin-jsdoc": "^50.6.17",
111
+ "@typescript-eslint/parser": "^8.48.1",
112
+ "eslint": "^9.39.1",
113
+ "eslint-config-prettier": "^10.1.8",
114
+ "eslint-import-resolver-typescript": "^4.4.4",
115
+ "eslint-plugin-import-x": "^4.16.1",
116
+ "eslint-plugin-jsdoc": "^61.5.0",
165
117
  "eslint-plugin-react": "^7.37.5",
166
118
  "eslint-plugin-react-hooks": "^5.2.0",
167
- "eslint-plugin-react-refresh": "^0.4.20",
168
- "globals": "^16.1.0",
169
- "typescript": "^5.8.3",
170
- "typescript-eslint": "^8.32.1"
119
+ "eslint-plugin-react-refresh": "^0.4.24",
120
+ "globals": "^16.5.0",
121
+ "typescript": "^5.9.3",
122
+ "typescript-eslint": "^8.48.1",
123
+ "vitest": "^4.1.0"
171
124
  },
172
125
  "packageManager": "yarn@4.9.2"
173
126
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=class-name.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=class-name.js.map