@ntnyq/utils 0.4.1 → 0.4.2

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/index.cjs CHANGED
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  NOOP: () => NOOP,
24
24
  at: () => at,
25
25
  cAF: () => cAF,
@@ -94,7 +94,7 @@ __export(src_exports, {
94
94
  warnOnce: () => warnOnce,
95
95
  weeks: () => weeks
96
96
  });
97
- module.exports = __toCommonJS(src_exports);
97
+ module.exports = __toCommonJS(index_exports);
98
98
 
99
99
  // src/is/isDeepEqual.ts
100
100
  function isDeepEqual(value1, value2) {
package/dist/index.d.cts CHANGED
@@ -174,6 +174,18 @@ declare function unique<T>(array: T[]): T[];
174
174
  */
175
175
  declare function uniqueBy<T>(array: T[], equalFn: (a: T, b: T) => boolean): T[];
176
176
 
177
+ type JsonArray = JsonValue[] | readonly JsonValue[];
178
+ type JsonObject = {
179
+ [Key in string]: JsonValue;
180
+ } & {
181
+ [Key in string]?: JsonValue | undefined;
182
+ };
183
+ type JsonPrimitive = boolean | number | string | null;
184
+ /**
185
+ * @copyright {@link https://github.com/sindresorhus/type-fest/blob/main/source/basic.d.ts}
186
+ */
187
+ type JsonValue = JsonArray | JsonObject | JsonPrimitive;
188
+
177
189
  /**
178
190
  * interop module
179
191
  */
@@ -184,6 +196,7 @@ type InteropModuleDefault<T> = T extends {
184
196
  type AnyFn<T = any, R = any> = (...args: T[]) => R;
185
197
  type Arrayable<T> = T | T[];
186
198
  type Awaitable<T> = Promise<T> | T;
199
+ type Callable<T> = AnyFn<any, T> | T;
187
200
  type MayBe<T> = T | undefined;
188
201
  type Nullable<T> = T | null;
189
202
  type PrimitiveType = bigint | boolean | number | string | symbol | null | undefined;
@@ -362,4 +375,4 @@ declare function sortObject<T extends Record<string, any>>(obj: T, options?: Sor
362
375
  */
363
376
  declare const capitalize: typeof upperFirst;
364
377
 
365
- export { type AnyFn, type Arrayable, type Awaitable, type CleanObjectOptions, type InteropModuleDefault, type MayBe, NOOP, type NonEmptyString, type Nullable, type Overwrite, type Prettify, type PrettifyV2, type PrimitiveType, type ResolvedOptions, type SortObjectOptions, type ThrottleDebounceOptions, type Whitespace, at, cAF, capitalize, chunk, clamp, cleanObject, days, debounce, ensurePrefix, ensureSuffix, escapeHtml, flattenArrayable, getObjectType, hasOwn, hours, isArray, isArrayEqual, isBoolean, isBrowser, isDeepEqual, isEmptyArray, isEmptyObject, isEmptyString, isEmptyStringOrWhitespace, isFunction, isInteger, isNaN, isNativePromise, isNil, isNonEmptyString, isNull, isNumber, isNumbericString, isObject, isPromise, isRegExp, isSet, isString, isUndefined, isWhitespaceString, isZero, join, last, mergeArrayable, minutes, noop, omit, once, pick, rAF, seconds, slash, sortObject, throttle, toArray, unindent, unique, uniqueBy, waitFor, warnOnce, weeks };
378
+ export { type AnyFn, type Arrayable, type Awaitable, type Callable, type CleanObjectOptions, type InteropModuleDefault, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type MayBe, NOOP, type NonEmptyString, type Nullable, type Overwrite, type Prettify, type PrettifyV2, type PrimitiveType, type ResolvedOptions, type SortObjectOptions, type ThrottleDebounceOptions, type Whitespace, at, cAF, capitalize, chunk, clamp, cleanObject, days, debounce, ensurePrefix, ensureSuffix, escapeHtml, flattenArrayable, getObjectType, hasOwn, hours, isArray, isArrayEqual, isBoolean, isBrowser, isDeepEqual, isEmptyArray, isEmptyObject, isEmptyString, isEmptyStringOrWhitespace, isFunction, isInteger, isNaN, isNativePromise, isNil, isNonEmptyString, isNull, isNumber, isNumbericString, isObject, isPromise, isRegExp, isSet, isString, isUndefined, isWhitespaceString, isZero, join, last, mergeArrayable, minutes, noop, omit, once, pick, rAF, seconds, slash, sortObject, throttle, toArray, unindent, unique, uniqueBy, waitFor, warnOnce, weeks };
package/dist/index.d.ts CHANGED
@@ -174,6 +174,18 @@ declare function unique<T>(array: T[]): T[];
174
174
  */
175
175
  declare function uniqueBy<T>(array: T[], equalFn: (a: T, b: T) => boolean): T[];
176
176
 
177
+ type JsonArray = JsonValue[] | readonly JsonValue[];
178
+ type JsonObject = {
179
+ [Key in string]: JsonValue;
180
+ } & {
181
+ [Key in string]?: JsonValue | undefined;
182
+ };
183
+ type JsonPrimitive = boolean | number | string | null;
184
+ /**
185
+ * @copyright {@link https://github.com/sindresorhus/type-fest/blob/main/source/basic.d.ts}
186
+ */
187
+ type JsonValue = JsonArray | JsonObject | JsonPrimitive;
188
+
177
189
  /**
178
190
  * interop module
179
191
  */
@@ -184,6 +196,7 @@ type InteropModuleDefault<T> = T extends {
184
196
  type AnyFn<T = any, R = any> = (...args: T[]) => R;
185
197
  type Arrayable<T> = T | T[];
186
198
  type Awaitable<T> = Promise<T> | T;
199
+ type Callable<T> = AnyFn<any, T> | T;
187
200
  type MayBe<T> = T | undefined;
188
201
  type Nullable<T> = T | null;
189
202
  type PrimitiveType = bigint | boolean | number | string | symbol | null | undefined;
@@ -362,4 +375,4 @@ declare function sortObject<T extends Record<string, any>>(obj: T, options?: Sor
362
375
  */
363
376
  declare const capitalize: typeof upperFirst;
364
377
 
365
- export { type AnyFn, type Arrayable, type Awaitable, type CleanObjectOptions, type InteropModuleDefault, type MayBe, NOOP, type NonEmptyString, type Nullable, type Overwrite, type Prettify, type PrettifyV2, type PrimitiveType, type ResolvedOptions, type SortObjectOptions, type ThrottleDebounceOptions, type Whitespace, at, cAF, capitalize, chunk, clamp, cleanObject, days, debounce, ensurePrefix, ensureSuffix, escapeHtml, flattenArrayable, getObjectType, hasOwn, hours, isArray, isArrayEqual, isBoolean, isBrowser, isDeepEqual, isEmptyArray, isEmptyObject, isEmptyString, isEmptyStringOrWhitespace, isFunction, isInteger, isNaN, isNativePromise, isNil, isNonEmptyString, isNull, isNumber, isNumbericString, isObject, isPromise, isRegExp, isSet, isString, isUndefined, isWhitespaceString, isZero, join, last, mergeArrayable, minutes, noop, omit, once, pick, rAF, seconds, slash, sortObject, throttle, toArray, unindent, unique, uniqueBy, waitFor, warnOnce, weeks };
378
+ export { type AnyFn, type Arrayable, type Awaitable, type Callable, type CleanObjectOptions, type InteropModuleDefault, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type MayBe, NOOP, type NonEmptyString, type Nullable, type Overwrite, type Prettify, type PrettifyV2, type PrimitiveType, type ResolvedOptions, type SortObjectOptions, type ThrottleDebounceOptions, type Whitespace, at, cAF, capitalize, chunk, clamp, cleanObject, days, debounce, ensurePrefix, ensureSuffix, escapeHtml, flattenArrayable, getObjectType, hasOwn, hours, isArray, isArrayEqual, isBoolean, isBrowser, isDeepEqual, isEmptyArray, isEmptyObject, isEmptyString, isEmptyStringOrWhitespace, isFunction, isInteger, isNaN, isNativePromise, isNil, isNonEmptyString, isNull, isNumber, isNumbericString, isObject, isPromise, isRegExp, isSet, isString, isUndefined, isWhitespaceString, isZero, join, last, mergeArrayable, minutes, noop, omit, once, pick, rAF, seconds, slash, sortObject, throttle, toArray, unindent, unique, uniqueBy, waitFor, warnOnce, weeks };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ntnyq/utils",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "description": "Common used utils.",
6
6
  "keywords": [
7
7
  "utils"
@@ -40,18 +40,18 @@
40
40
  "scule": "^1.3.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@ntnyq/eslint-config": "^3.8.1",
43
+ "@ntnyq/eslint-config": "^3.10.2",
44
44
  "@ntnyq/prettier-config": "^1.22.0",
45
- "@vitest/coverage-v8": "^2.1.8",
46
- "bumpp": "^9.8.1",
47
- "eslint": "^9.16.0",
45
+ "@vitest/coverage-v8": "^3.0.0-beta.3",
46
+ "bumpp": "^9.9.2",
47
+ "eslint": "^9.17.0",
48
48
  "husky": "^9.1.7",
49
49
  "nano-staged": "^0.8.0",
50
- "npm-run-all2": "^7.0.1",
50
+ "npm-run-all2": "^7.0.2",
51
51
  "prettier": "^3.4.2",
52
52
  "tsup": "^8.3.5",
53
53
  "typescript": "^5.7.2",
54
- "vitest": "^2.1.8"
54
+ "vitest": "^3.0.0-beta.3"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=18.18.0"