Releases: untemps/utils
Releases · untemps/utils
Release list
v4.0.0
4.0.0 (2026-06-05)
Bug Fixes
- array: Return extractByIndices values in indices order (#118) (b3ad542)
- dom: Avoid unsafe DOMRect cast in createElement (#81) (6fda5d4)
- dom: Harmonize missing-target behaviour between removeElement and modifyElement (#137) (a6be726)
- dom: Harmonize null/undefined attribute handling in createElement (#154) (94a2b57)
- dom: Honor explicit empty-string textContent in createElement (#140) (a3640bb)
- dom: Reject null and undefined element input in modifyElement and removeElement (#139) (ffcca02)
- dom: Replace for...in with Object.entries on attributes in modifyElement (#61) (0e30f71)
- dom: Skip cross-origin stylesheets in getCSSDeclaration (#101) (b5c4094)
- dom: Snapshot getCSSDeclaration return to prevent live stylesheet mutation (#155) (f0f7f0d)
- dom: Throw ReferenceError when modifyElement selector matches nothing (#119) (8ca987b)
- dom: Tolerate null attributes in modifyElement (#138) (fd55f8b)
- number: Narrow getRandomInteger defaults to safe integer range (#117) (b2e284f)
- object: Copy non-cloneable values by reference in deepMerge (#99) (f44a2d1)
- object: Deep clone non-plain-object source values in deepMerge (#79) (c357715)
- object: Make deepMerge immutable by default, add mutate flag (#60) (d56b2d9)
- object: Preserve source-side aliasing in deepMerge (#141) (dccdfc6)
- object: Return false instead of throwing for nullish values in isObject (#86) (10d7ef5)
- string: Default interpolateLiteral tokens to empty object (#80) (ede8348)
- string: Escape token keys when building the interpolate regex (#91) (9fcb42c)
- string: Harmonize nil-value handling between interpolate and interpolateLiteral (#136) (bdf3a13)
- string: Preserve delimiters in interpolate when token value is nil (#105) (3013b20)
- string: Replace incomplete escapeDivider regex with full metacharacter set (#63) (264905f)
- string: Return value unchanged when interpolate has no tokens (#100) (fe2346a)
- string: Throw RangeError in generateText when dictionary is empty (#62) (e904575)
Code Refactoring
- object: Infer DeepMerge return type from source and target (#157) (8b38c1c)
- string: Replace new Function with regex in interpolateLiteral (#59) (2012626)
Features
- Add debounce and throttle functions to async/ (#64) (467b924)
- Add deepClone function to object/ (#65) (9172bb5)
- dom: Match grouped selectors in getCSSDeclaration (#145) (db66049)
- string: Harmonize missing-key behaviour between interpolate and interpolateLiteral (#124) (119f97e)
Performance Improvements
BREAKING CHANGES
- object: deepMerge no longer returns
Record<string, unknown>. Callers that explicitly annotated the result with that type, or that assigned it to aRecord<string, unknown>-typed variable, now get a narrower inferred type and must drop the annotation (or widen withas Record<string, unknown>if needed).
(cherry picked from commit 9fd4a40)
- dom: getCSSDeclaration with returnText = false (the default) now returns a Record<string, string> snapshot instead of the live CSSStyleDeclaration. Callers relying on CSSStyleDeclaration methods (getPropertyValue, setProperty, ...) must either pass returnText = true and parse the string, switch to getComputedStyle, or update the stylesheet through document.styleSheets directly. Mutations on the returned object no longer propagate to the matched rule.
(cherry picked from commit 16c45fc)
- dom: modifyElement(null), modifyElement(undefined), removeElement(null) and removeElement(undefined) now throw TypeError instead of returning undefined. Callers must either guard the input before calling or wrap the call in try/catch.
(cherry picked from commit e13bd89)
- dom: removeElement no longer silently returns undefined when the string selector matches no element. It now throws a ReferenceError with the same message format as modifyElement. The null/undefined input path and the detached-element path are unchanged.
(cherry picked from commit b0a590c)
- string: interpolateLiteral no longer coerces null and undefined token values to the literal strings "null" and "undefined". The placeholder is preserved instead. Non-nil values, including symbols, are still coerced via String(value).
(cherry picked from commit e0aeb05)
- string: interpolateLiteral no longer throws ReferenceError when a placeholder key is missing from tokens. The placeholder is preserved in the result. Callers relying on the throw must pre-validate the keys against the placeholders found in the input string.
(cherry picked from commit 379b551)
- removeElement now returns a detached element unchanged instead of undefined. Callers that distinguished 'nothing to remove' from 'element removed' via the undefined return must check the element's parent in advance.
(cherry picked from commit 7588ea0)
- dom: modifyElement(selector, attrs) now throws ReferenceError when the selector does not match any element. Callers relying on the null return must catch the error or pre-check with document.querySelector.
(cherry picked from commit 941f091)
- array: extractByIndices result order now follows the indices array. Callers relying on source-order output must sort indices upstream.
(cherry p...
v4.0.0-beta.31
4.0.0-beta.31 (2026-06-05)
Code Refactoring
BREAKING CHANGES
- object: deepMerge no longer returns
Record<string, unknown>. Callers that explicitly annotated the result with that type, or that assigned it to aRecord<string, unknown>-typed variable, now get a narrower inferred type and must drop the annotation (or widen withas Record<string, unknown>if needed).
v4.0.0-beta.30
4.0.0-beta.30 (2026-06-05)
Bug Fixes
BREAKING CHANGES
- dom: getCSSDeclaration with returnText = false (the default) now returns a Record<string, string> snapshot instead of the live CSSStyleDeclaration. Callers relying on CSSStyleDeclaration methods (getPropertyValue, setProperty, ...) must either pass returnText = true and parse the string, switch to getComputedStyle, or update the stylesheet through document.styleSheets directly. Mutations on the returned object no longer propagate to the matched rule.
v4.0.0-beta.29
v4.0.0-beta.28
v4.0.0-beta.27
v4.0.0-beta.26
4.0.0-beta.26 (2026-06-04)
Bug Fixes
BREAKING CHANGES
- dom: modifyElement(null), modifyElement(undefined), removeElement(null) and removeElement(undefined) now throw TypeError instead of returning undefined. Callers must either guard the input before calling or wrap the call in try/catch.
v4.0.0-beta.25
v4.0.0-beta.24
4.0.0-beta.24 (2026-06-04)
Bug Fixes
BREAKING CHANGES
- dom: removeElement no longer silently returns undefined when the string selector matches no element. It now throws a ReferenceError with the same message format as modifyElement. The null/undefined input path and the detached-element path are unchanged.
v4.0.0-beta.23
4.0.0-beta.23 (2026-06-04)
Bug Fixes
BREAKING CHANGES
- string: interpolateLiteral no longer coerces null and undefined token values to the literal strings "null" and "undefined". The placeholder is preserved instead. Non-nil values, including symbols, are still coerced via String(value).