@ntnyq/utils 0.11.4 → 0.11.6

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 +48 -5
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -125,10 +125,6 @@ type Awaitable<T> = Promise<T> | T;
125
125
  type Callable<T> = AnyFn<any, T> | T;
126
126
  type MayBe<T> = T | undefined;
127
127
  type Nullable<T> = T | null;
128
- /**
129
- * Overwrite some keys type
130
- */
131
- type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
132
128
  /**
133
129
  * Prettify object type
134
130
  */
@@ -186,6 +182,53 @@ type InteropModuleDefault<T> = T extends {
186
182
  */
187
183
  type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
188
184
  //#endregion
185
+ //#region src/types/effect.d.ts
186
+ /**
187
+ * Overwrite some keys
188
+ *
189
+ * @example
190
+ *
191
+ * ```ts
192
+ * type A = { a: string, b: number }
193
+ * type B = { b: number }
194
+ *
195
+ * type C = Overwrite<A, B>
196
+ *
197
+ * // C is { a: string, b: number }
198
+ * ```
199
+ */
200
+ type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
201
+ /**
202
+ * Exclude some keys
203
+ *
204
+ * @example
205
+ *
206
+ * ```ts
207
+ * type A = { a: string, b: number }
208
+ * type B = { b: number }
209
+ *
210
+ * type C = Without<A, B>
211
+ *
212
+ * // C is { a: string }
213
+ * ```
214
+ */
215
+ type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
216
+ /**
217
+ * Exclusive or
218
+ *
219
+ * @example
220
+ *
221
+ * ```ts
222
+ * type A = { a: string }
223
+ * type B = { b: number }
224
+ *
225
+ * type C = Exclusive<A, B>
226
+ *
227
+ * // C is either A or B, but not both
228
+ * ```
229
+ */
230
+ type Exclusive<T, U> = (T & Without<U, T>) | (U & Without<T, U>);
231
+ //#endregion
189
232
  //#region src/dom/openExternalURL.d.ts
190
233
  interface OpenExternalURLOptions {
191
234
  /**
@@ -1017,4 +1060,4 @@ declare const RE_LINE_COMMENT: RegExp;
1017
1060
  */
1018
1061
  declare const RE_BLOCK_COMMENT: RegExp;
1019
1062
  //#endregion
1020
- export { AnyFn, Arrayable, Awaitable, Callable, CleanObjectOptions, Color, CreatePadStringOptions, DeepRequired, ElementOf, FlatTreeOptions, 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, UrlString, ValueOf, Whitespace, at, cAF, chunk, clamp, cleanObject, convertFromBytes, convertFromMilliseconds, convertStorageUnit, convertTimeUnit, convertToBytes, convertToMilliseconds, createPadString, debounce, enhance, ensurePrefix, ensureSuffix, escapeHTML, escapeStringRegexp, flatTree, flattenArrayable, getFileExtension, getObjectType, getRoot, getStringLength, getStringSimilarity, hasOwn, interopDefault, intersect, isAllEmpty, isArray, isArrayEqual, isBigInt, isBlob, isBoolean, isBrowser, isDeepEqual, isElementVisibleInViewport, isEmptyArray, isEmptyMap, isEmptyObject, isEmptySet, isEmptyString, isEmptyStringOrWhitespace, isError, isFile, isFormData, isFunction, isHTMLElement, isInteger, isIterable, isKeyOf, isMap, isNaN, isNativePromise, isNil, isNonEmptyArray, isNonEmptyString, isNull, isNullOrUndefined, isNumber, isNumbericString, isObject, isPlainObject, isPromise, isRegExp, isSet, isString, isTruthy, isUndefined, isUrlString, isWhitespaceString, isZero, join, last, mergeArrayable, noop, omit, once, openExternalURL, pick, rAF, randomHexColor, randomNumber, randomRGBAColor, randomRGBColor, randomString, remove, removeFileExtension, resolveSubOptions, scrollElementIntoView, shuffle, slash, slugify, sortObject, throttle, toArray, toInteger, toNumber, unescapeHTML, unindent, unique, uniqueBy, waitFor, warnOnce };
1063
+ export { AnyFn, Arrayable, Awaitable, Callable, CleanObjectOptions, Color, CreatePadStringOptions, DeepRequired, ElementOf, Exclusive, FlatTreeOptions, 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, UrlString, ValueOf, Whitespace, Without, at, cAF, chunk, clamp, cleanObject, convertFromBytes, convertFromMilliseconds, convertStorageUnit, convertTimeUnit, convertToBytes, convertToMilliseconds, createPadString, debounce, enhance, ensurePrefix, ensureSuffix, escapeHTML, escapeStringRegexp, flatTree, flattenArrayable, getFileExtension, getObjectType, getRoot, getStringLength, getStringSimilarity, hasOwn, interopDefault, intersect, isAllEmpty, isArray, isArrayEqual, isBigInt, isBlob, isBoolean, isBrowser, isDeepEqual, isElementVisibleInViewport, isEmptyArray, isEmptyMap, isEmptyObject, isEmptySet, isEmptyString, isEmptyStringOrWhitespace, isError, isFile, isFormData, isFunction, isHTMLElement, isInteger, isIterable, isKeyOf, isMap, isNaN, isNativePromise, isNil, isNonEmptyArray, isNonEmptyString, isNull, isNullOrUndefined, isNumber, isNumbericString, isObject, isPlainObject, isPromise, isRegExp, isSet, isString, isTruthy, isUndefined, isUrlString, isWhitespaceString, isZero, join, last, mergeArrayable, noop, omit, once, openExternalURL, pick, rAF, randomHexColor, randomNumber, randomRGBAColor, randomRGBColor, randomString, remove, removeFileExtension, resolveSubOptions, scrollElementIntoView, shuffle, slash, slugify, sortObject, throttle, toArray, toInteger, toNumber, unescapeHTML, unindent, unique, uniqueBy, waitFor, warnOnce };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ntnyq/utils",
3
- "version": "0.11.4",
3
+ "version": "0.11.6",
4
4
  "description": "Common used utils.",
5
5
  "keywords": [
6
6
  "utils"
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "@ntnyq/tsconfig": "^3.1.0",
34
- "@typescript/native-preview": "^7.0.0-dev.20260401.1",
34
+ "@typescript/native-preview": "^7.0.0-dev.20260406.1",
35
35
  "bumpp": "^11.0.1",
36
36
  "husky": "^9.1.7",
37
37
  "nano-staged": "^0.9.0",