Skip to content

v0.2.0

Choose a tag to compare

@andreww2012 andreww2012 released this 06 Oct 18:34
· 111 commits to main since this release
Immutable release. Only release title and notes can be modified.
bbdbe93

Minor Changes

  • 47be3d5 Thanks @andreww2012! - Narrowed the supported Node.js versions to ^22.23.1 || ^24.18.0 || >=26.4.0 (was ^22.23.1 || >=24) and exported package.json as /package.json subpath

  • 9fe6fdb Thanks @andreww2012! - Added the following new utilities from ms-ts package:

    • ms (misc group)
    • Ms (types group)
  • 2fecdaf Thanks @andreww2012! - Added a new misc/generateMailtoLink utility

  • ca6a52c Thanks @andreww2012! - Added a new array/arrayHasMaxElements utility - the "at most" counterpart to array/arrayHasMinElements - together with the types/ArrayWithMaxLength type powering its narrowing

  • 280d41e Thanks @andreww2012! - Added the following new utilities from typed-query-selector package, belonging to the new dom group:

    • querySelectorTyped
    • querySelectorAllTyped
    • closestTyped
    • ElementFromSelector (type)
    • ElementFromSelectorStrict (type)
    • ElementFromTagName (type)

    Added two opt-in side-effect entrypoints that type the native DOM lookup methods from the selector:

    • unutils/dom/query-selector-typed.global
    • unutils/dom/query-selector-typed-strict.global

    You should import at most one of the two.

  • 19ad83a Thanks @andreww2012! - Added the following new utilities from nanoid package, belonging to the new id group:

    • nanoid
    • nanoidFactory
    • NANOID_URL_ALPHABET (constant)
  • 625e1a3 Thanks @andreww2012! - Added two new map utilities that mirror the native Map#getOrInsert and Map#getOrInsertComputed methods, which are not yet widely available:

    • mapGetOrInsert - returns the value stored under a key, inserting an eagerly built default first when the key is missing
    • mapGetOrInsertComputed - the lazy counterpart, building the default only on a miss

    Both return a non-optional value, so mapGetOrInsertComputed(map, key, () => []).push(item) replaces the usual read-check-insert dance.

  • 2c764a4 Thanks @andreww2012! - Updated type-fest from v5.8.0 to v5.10.0:

    • Added RenameKeys (as-is) and MaxNumberInUnion (renamed from UnionMax) utilities
  • 17d62ef Thanks @andreww2012! - Updated es-toolkit from v1.49.0 to v1.52.0:

    • Added the following utilities:
      • object group:
      • function group:
        • flowAsync (flowAsync from es-toolkit/fp, taking the functions as an array like flow)
        • toDisposable (consolidates defer and deferAsync)
      • iterable group, from the new es-toolkit/iterator entrypoint (all of them accept any iterable, not only iterators):
        • generateSequence (renamed from iterate)
        • iterableCartesianProduct (renamed from cartesianProduct)
        • iterableChunks (renamed from chunk)
        • iterableCount (renamed from count)
        • iterableDropWhile (renamed from dropWhile)
        • iterableFirst (renamed from head)
        • iterablePartition (renamed from partition)
        • iterableRange (renamed from range)
        • iterableScan (renamed from scan)
        • iterableTakeWhile (renamed from takeWhile)
        • iterableTranspose (renamed from zip)
        • iterableUnique (renamed from uniqBy)
      • math group, from the new es-toolkit/bigint entrypoint:
    • The following utilities now also accept bigints, consolidated with their counterparts from the new es-toolkit/bigint entrypoint:
    • toConstantCaseKeysDeep, toKebabCaseKeysDeep and toPascalCaseKeysDeep are now based on the new toConstantCaseKeys, toKebabCaseKeys and toPascalCaseKeys: non-ASCII letters are no longer treated as word boundaries, and class instances are kept as-is
  • 3c743b5 Thanks @andreww2012! - Updated devalue from v5.8.1 to v6.0.2

    Added the following new utilities from devalue package (json group):

    • structuredStringifyAsync (renamed from stringifyAsync) - the promise-awaiting counterpart of structuredStringify
    • StructuredStringifyError (renamed from DevalueError) - thrown by structuredStringify and structuredStringifyAsync
    • structuredFilterArrayIndexes (renamed from filterArrayIndices) - for custom StructuredStringifyOperations
    • STRUCTURED_STRINGIFY_DEFAULT_OPERATIONS (constant, renamed from defaultStringifyOperations) - default operations of structuredStringify and structuredStringifyAsync
    • STRUCTURED_PARSE_DEFAULT_OPERATIONS (constant, renamed from defaultParseOperations) - default operations of structuredParse
    • StructuredStringifyOptions (type, renamed from StringifyOptions) - options of structuredStringify and structuredStringifyAsync
    • StructuredStringifyOperations (type, renamed from StringifyOperations) - operations option of structuredStringify and structuredStringifyAsync
    • StructuredParseOptions (type, renamed from ParseOptions) - options of structuredParse
    • StructuredParseOperations (type, renamed from ParseOperations) - operations option of structuredParse

Patch Changes

  • 4154dfd Thanks @andreww2012! - Updated nanoid from v6.0.1 to v6.0.2

  • 36aec3b Thanks @andreww2012! - Updated arkregex from v0.0.8 to v0.0.12

  • 9de1274 Thanks @andreww2012! - Fixed jsonParseAsync and jsonStringifyAsync:

    • jsonParseAsync no longer rejects every input with ReferenceError: chunk is not defined
    • jsonStringifyAsync now matches JSON.stringify in more cases:
      • nested objects and arrays are indented correctly with space
      • space is limited like in JSON.stringify: strings are cut to 10 characters, and numbers are truncated
      • values with toJSON (like Date) no longer get extra whitespace, and the replacer gets them after toJSON is called
      • the replacer gets array indexes as strings, and a replacer array accepts numbers and skips duplicates
      • control characters are escaped
    • jsonStringifyAsync now respects intensity instead of always using 1
    • Concurrent jsonStringifyAsync calls no longer mix up long strings or fail with "Circular Structure Detected"
  • 1e232d0 Thanks @andreww2012! - The package now declares the sideEffects field in package.json, so bundlers drop unused modules: for example, importing a single utility from the main entrypoint no longer adds ~19 KB of unused code to the bundle

  • c15d096 Thanks @andreww2012! - Updated remeda from v2.39.0 to v2.51.0

  • 55cfbc6 Thanks @andreww2012! - Updated ts-extras from v1.2.0 to v1.3.0

  • 8edb1b4 Thanks @andreww2012! - Updated typed-query-selector from v2.12.2 to v2.12.3

    Selectors with [] inside a quoted attribute value, like input[name="tags[]"], are now resolved to the right element type instead of falling back to Element