@ntnyq/utils 0.9.0 → 0.9.1

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 (2) hide show
  1. package/dist/index.d.ts +9 -1
  2. package/package.json +19 -17
package/dist/index.d.ts CHANGED
@@ -134,6 +134,14 @@ type Merge<T, U> = keyof T & keyof U extends never ? T & U : Omit<T, keyof T & k
134
134
  * Non empty object `{}`
135
135
  */
136
136
  type NonEmptyObject<T> = T extends Record<string, never> ? never : T;
137
+ /**
138
+ * A type that represents the values of an object type.
139
+ */
140
+ type ValueOf<T> = T[keyof T];
141
+ /**
142
+ * A type that represents the elements of an array type.
143
+ */
144
+ type ElementOf<T extends unknown[] | null | undefined> = T extends Array<infer U> ? U : never;
137
145
  //#endregion
138
146
  //#region src/types/module.d.ts
139
147
  /**
@@ -849,4 +857,4 @@ declare const RE_LINE_COMMENT: RegExp;
849
857
  */
850
858
  declare const RE_BLOCK_COMMENT: RegExp;
851
859
  //#endregion
852
- export { AnyFn, Arrayable, Awaitable, Callable, CleanObjectOptions, Color, CreatePadStringOptions, DeepRequired, GetStringSimilarityOptions, InteropModuleDefault, JsonArray, JsonObject, JsonPrimitive, JsonValue, LiteralUnion, MayBe, Merge, NOOP, NonEmptyObject, NonEmptyString, Nullable, OpenExternalURLOptions, Overwrite, Prettify, PrettifyV2, Primitive, RE_BLOCK_COMMENT, RE_COMMENTS, RE_LINE_COMMENT, RamdomNumberOptions, ResolvedOptions, SPECIAL_CHAR, STORAGE_UNITS, SortObjectOptions, StorageUnit, TIME_UNITS, ThrottleDebounceOptions, TimeUnit, ToIntegerOptions, Whitespace, at, cAF, chunk, clamp, cleanObject, convertFromBytes, convertFromMilliseconds, convertStorageUnit, convertTimeUnit, convertToBytes, convertToMilliseconds, createPadString, debounce, enhance, ensurePrefix, ensureSuffix, escapeHTML, flattenArrayable, getObjectType, getRoot, getStringLength, getStringSimilarity, hasOwn, interopDefault, intersect, isArray, isArrayEqual, isBigInt, isBoolean, isBrowser, isDeepEqual, isElementVisibleInViewport, isEmptyArray, isEmptyMap, isEmptyObject, isEmptySet, isEmptyString, isEmptyStringOrWhitespace, isError, isFunction, isHTMLElement, isInteger, isIterable, isMap, isNaN, isNativePromise, isNil, isNonEmptyArray, isNonEmptyString, isNull, isNullOrUndefined, isNumber, isNumbericString, isObject, isPromise, isRegExp, isSet, isString, isTruthy, isUndefined, isWhitespaceString, isZero, join, last, mergeArrayable, noop, omit, once, openExternalURL, pick, rAF, randomHexColor, randomNumber, randomRGBAColor, randomRGBColor, randomString, removeFileExtension, resolveSubOptions, scrollElementIntoView, slash, slugify, sortObject, throttle, toArray, toInteger, unescapeHTML, unindent, unique, uniqueBy, waitFor, warnOnce };
860
+ export { AnyFn, Arrayable, Awaitable, Callable, CleanObjectOptions, Color, CreatePadStringOptions, DeepRequired, ElementOf, GetStringSimilarityOptions, InteropModuleDefault, JsonArray, JsonObject, JsonPrimitive, JsonValue, LiteralUnion, MayBe, Merge, NOOP, NonEmptyObject, NonEmptyString, Nullable, OpenExternalURLOptions, Overwrite, Prettify, PrettifyV2, Primitive, RE_BLOCK_COMMENT, RE_COMMENTS, RE_LINE_COMMENT, RamdomNumberOptions, ResolvedOptions, SPECIAL_CHAR, STORAGE_UNITS, SortObjectOptions, StorageUnit, TIME_UNITS, ThrottleDebounceOptions, TimeUnit, ToIntegerOptions, ValueOf, Whitespace, at, cAF, chunk, clamp, cleanObject, convertFromBytes, convertFromMilliseconds, convertStorageUnit, convertTimeUnit, convertToBytes, convertToMilliseconds, createPadString, debounce, enhance, ensurePrefix, ensureSuffix, escapeHTML, flattenArrayable, getObjectType, getRoot, getStringLength, getStringSimilarity, hasOwn, interopDefault, intersect, isArray, isArrayEqual, isBigInt, isBoolean, isBrowser, isDeepEqual, isElementVisibleInViewport, isEmptyArray, isEmptyMap, isEmptyObject, isEmptySet, isEmptyString, isEmptyStringOrWhitespace, isError, isFunction, isHTMLElement, isInteger, isIterable, isMap, isNaN, isNativePromise, isNil, isNonEmptyArray, isNonEmptyString, isNull, isNullOrUndefined, isNumber, isNumbericString, isObject, isPromise, isRegExp, isSet, isString, isTruthy, isUndefined, isWhitespaceString, isZero, join, last, mergeArrayable, noop, omit, once, openExternalURL, pick, rAF, randomHexColor, randomNumber, randomRGBAColor, randomRGBColor, randomString, removeFileExtension, resolveSubOptions, scrollElementIntoView, slash, slugify, sortObject, throttle, toArray, toInteger, unescapeHTML, unindent, unique, uniqueBy, waitFor, warnOnce };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@ntnyq/utils",
3
3
  "type": "module",
4
- "version": "0.9.0",
4
+ "version": "0.9.1",
5
+ "packageManager": "pnpm@10.14.0",
5
6
  "description": "Common used utils.",
6
7
  "keywords": [
7
8
  "utils"
@@ -29,16 +30,28 @@
29
30
  "dist"
30
31
  ],
31
32
  "sideEffects": false,
33
+ "scripts": {
34
+ "build": "tsdown",
35
+ "dev": "tsdown --watch src",
36
+ "lint": "eslint",
37
+ "prepare": "husky",
38
+ "prepublishOnly": "pnpm run build",
39
+ "release": "run-s release:check release:version",
40
+ "release:check": "run-s lint typecheck test",
41
+ "release:version": "bumpp",
42
+ "test": "vitest",
43
+ "typecheck": "tsc --noEmit"
44
+ },
32
45
  "devDependencies": {
33
- "@ntnyq/eslint-config": "^5.2.0",
46
+ "@ntnyq/eslint-config": "^5.3.1",
34
47
  "@ntnyq/prettier-config": "^3.0.1",
35
- "bumpp": "^10.2.2",
36
- "eslint": "^9.32.0",
48
+ "bumpp": "^10.2.3",
49
+ "eslint": "^9.33.0",
37
50
  "husky": "^9.1.7",
38
51
  "nano-staged": "^0.8.0",
39
52
  "npm-run-all2": "^8.0.4",
40
53
  "prettier": "^3.6.2",
41
- "tsdown": "^0.13.1",
54
+ "tsdown": "^0.14.1",
42
55
  "typescript": "^5.9.2",
43
56
  "vitest": "^3.2.4"
44
57
  },
@@ -47,16 +60,5 @@
47
60
  },
48
61
  "nano-staged": {
49
62
  "*.{js,ts,mjs,cjs,md,yml,yaml,toml,json}": "eslint --fix"
50
- },
51
- "scripts": {
52
- "build": "tsdown",
53
- "dev": "tsdown --watch src",
54
- "lint": "eslint",
55
- "release": "run-s release:check release:version release:publish",
56
- "release:check": "run-s lint typecheck test",
57
- "release:publish": "pnpm publish",
58
- "release:version": "bumpp",
59
- "test": "vitest",
60
- "typecheck": "tsc --noEmit"
61
63
  }
62
- }
64
+ }