Skip to content

Releases: nevware21/ts-utils

0.15.0

30 May 04:27
66b5fba

Choose a tag to compare

Changelog

Features

  • #570 Add microtask scheduling helpers with native queueMicrotask, Promise, and timer-backed fallbacks
    • New functions: scheduleMicrotask, hasQueueMicrotask, getQueueMicrotask, setMicroTaskFallbackOptions
    • New public types: ScheduleMicrotaskFn, MicroTaskOptions
    • Extends microtask support by providing cancellable microtasks via ITimerHandler, plus fallback ordering to run microtasks before queued timers when using the timer-backed implementation
    • Provides runtime parity across all supported environments by using native queueMicrotask when present, Promise-backed scheduling when available, and a timer-backed microtask queue otherwise
  • #573 Add nextTick scheduling support and new helper exports
    • New timer/runtime functions: scheduleNextTick, getProcessNextTick, hasProcessNextTick, setNextTickFallbackOptions
    • Uses native process.nextTick in Node runtimes when available, while providing equivalent nextTick behavior in browser and worker runtimes via Promise and timer-backed fallbacks
    • Adds shared queue logic and callback-argument support across microtask and nextTick scheduling
    • Adds arrConcat as a dedicated array helper and fnBindArgs as a dedicated function helper
    • Improves function binding typing with exported BoundFunction and updated signatures for fnBind / fnBindArgs
  • #574 feat(iterator,array): add iterator collection helpers, split helper modules, and align collection membership semantics
    • Added new iterator helpers: iterMap, iterFilter, iterTake, iterReduce, iterSome, iterEvery, iterToArray, iterUnion, iterIntersection, iterDifference
    • Added arrToMap helper in the array module and moved callback/type declarations into iterator/types
    • Refactored iterator helper implementation/tests into per-function files and updated root exports
    • Added NaN regression coverage and switched iterator set-operation membership checks to arrIncludes semantics for parity with array helpers
  • #576 Refactor timer microtask/nextTick shared types and environment helpers, with expanded fallback coverage
    • Moved MicrotaskFn and ScheduleMicrotaskFn to helpers/types and updated timer internals to consume shared type definitions
    • Moved getQueueMicrotask and hasQueueMicrotask to helpers/environment, updated root exports, and aligned scheduleNextTick fallback resolution to prefer queueMicrotask when available
    • Added internal microtaskQueue scheduler helper wiring and expanded tests for queue fallback behavior, Promise ordering, and no-Promise edge cases

Bug Fixes

  • #568 Rolldown INVALID_ANNOTATION warnings caused by non-canonical PURE annotation spacing in generated output
    • #569 Add generated-chunk PURE annotation normalization so spaced forms are rewritten to canonical (/*#__PURE__*/ / (/*@__PURE__*/ in rollup output
    • #575 Add packaged artifact validation for PURE annotation spacing and update normalization tolerance, with per-file logging while scanning lib/bundle and lib/dist

New Contributors

Full Changelog: 0.14.0...0.15.0

0.14.0

19 May 06:24
45cb369

Choose a tag to compare

Changelog

Features

  • #525 feat(array): add new array helpers and array-like detection
    • New helpers: isArrayLike, arrUnique, arrCompact, arrFlatten, arrGroupBy, arrChunk and export previously missed isArrayLike
  • #527 feat(string): add strReplace and strReplaceAll helpers with refactored internal replacements
  • #528 feat(string): add strCapitalizeWords helper
  • #529 / #530 feat(string): add strTruncate, strCount, strAt, and strMatchAll helpers with shared literal regex helper
  • #533 feat(array): add arrFlatMap with ES5 polyfill support
  • #535 docs(types): add typing utilities for v0.14.0 and expand TSDoc examples
  • #536 feat: add isAsyncIterable and isIntegerInRange type/value inspection helpers
  • #543 feat(string): add strStartsWithAny, strEndsWithAny, strWrap, strUnwrap, and strNormalizeNewlines helpers
  • #564 feat(object): add new object utility helpers and harden defaults against prototype pollution
    • New helpers: objPick, objOmit, objPickBy, objOmitBy — property selection and omission with typed overloads
    • New helpers: objMapValues — create a new object with values transformed by a mapper function
    • New helpers: objMergeIf, objDefaults — conditional merge and shallow defaults (similar to Lodash _.defaults) hardened against prototype pollution
    • New helper: objDiff — shallow diff returning only changed/added keys from a modified object vs a base
    • New helpers: forEachOwnKey, forEachOwnKeySafe — iteration over both string and symbol keys (existing forEachOwnKeySafe was string-only)
    • New helper: objForEachKeySafe — safe string-key iteration that filters __proto__, constructor, prototype
    • Extended isUnsafeTarget coverage to TypedArrays, ArrayBuffer, DataView, WeakRef, FinalizationRegistry

Security Issue

  • CVE-2026-46681 Prototype Pollution in objDeepCopy/objCopyProps via for...in without hasOwnProperty
    • Also affected setValueByKey and setValueByIter
    • #565 feat: add prototype-pollution guards and array key helpers

Bug Fixes

  • #558 Fix ES2015 built-in type errors in consumers by adding lib reference directive to published declarations
    • Consumers using "lib": ["ES5", "DOM"] (or omitting lib) received Cannot find name 'Symbol' / Cannot find name 'Iterator' errors because the published .d.ts exposed ES2015 types without declaring the dependency
    • Added /// <reference lib="es2015" /> to the source entry points (index.ts, polyfills.ts) and a new post-processing script (lib/scripts/setTsReferences.js) that prepends the directive to the api-extractor bundled output (api-extractor strips these directives from its rollup)
    • Added "lib": ["ES2015", "DOM"] to all library and test tsconfig files for consistent compile-time validation
    • Net effect: consumers no longer need to add "ES2015" to their own tsconfig.json lib settings
  • #561 Bug: Falsy thisArg (0, '', false) overridden in arrForEach/iterForOf/objForEachKey
    • #566 Fix falsy thisArg (0, '', false) being overridden in arrForEach, iterForOf, objForEachKey
  • #562 Fix thisArg binding in polyArrFindIndex / polyArrFindLastIndex polyfills

Repository Improvements

  • #549 Drop Node.js 16 from CI matrix and add Node.js 24
  • #552 Upgrade Grunt devDependency to v1.6.2
  • #554 Add funding metadata to published package manifests
  • #556 Add release PR instructions to Copilot instructions

Full Changelog

0.13.0

26 Feb 07:46
077f469

Choose a tag to compare

Changelog

Features

  • Added comprehensive encoding and decoding functions for multiple formats:

    • Base64 Encoding/Decoding: encodeAsBase64() and decodeBase64() with native fallbacks and ES5 polyfill support
    • URL-Safe Base64: encodeAsBase64Url() and decodeBase64Url() for safe Base64 encoding in URLs (replaces + with -, / with _, removes padding)
    • Hexadecimal Encoding/Decoding: encodeAsHex() and decodeHex() for hex string conversion
    • URI Encoding/Decoding: encodeAsUri() and decodeUri() for URL component encoding
    • All encoding functions include internal polyfills (_encodeBase64Polyfill, _decodeBase64Polyfill) for ES5 environment compatibility
    • Consistent handling of null/undefined values across all encoding functions
  • Enhanced createCustomError() with superArgsFn parameter:

    • New optional superArgsFn parameter allows custom transformation of constructor arguments before passing to base class
    • Enables support for different argument orders and subsetting arguments passed to the base class constructor
    • Useful for creating custom error subclasses with different constructor signatures than their base classes
    • Example: HTTP error with (statusCode, message) signature can map to base Error(message) constructor

Performance Improvements

  • Improved performance of worker test execution
    • Optimized test runner for faster execution in web worker environments

What's Changed

  • Bump glob from 13.0.0 to 13.0.1 by @dependabot[bot] in #500
  • Add automation team to CODEOWNERS by @nev21 in #504
  • Update CODEOWNERS to reflect approver changes by @nev21 in #505
  • Update CODEOWNERS to consolidate ownership by @nev21 in #506
  • Delete .github/workflows/dependabot-force-rebase.yml by @nev21 in #502
  • Delete .github/workflows/pr-auto-approve.yml by @nev21 in #501
  • Bump glob from 13.0.1 to 13.0.2 by @dependabot[bot] in #510
  • Bump glob from 13.0.2 to 13.0.3 by @dependabot[bot] in #511
  • Bump typedoc-github-theme from 0.3.1 to 0.4.0 by @dependabot[bot] in #512
  • Bump glob from 13.0.3 to 13.0.4 by @dependabot[bot] in #513
  • Bump glob from 13.0.4 to 13.0.5 by @dependabot[bot] in #514
  • Bump glob from 13.0.5 to 13.0.6 by @dependabot[bot] in #515
  • chore: Bump @nevware21 dependencies to latest recommended version ranges by @Copilot in #518
  • perf: Fix worker test execution excessive delay by @nev21 in #519
  • Bump nyc from 17.1.0 to 18.0.0 by @dependabot[bot] in #520
  • feat(error): Add superArgsFn to createCustomError for flexible base-class argument mapping by @Copilot in #522
  • feat: Add comprehensive encoding utilities (Base64, Hex, URI) with ES5 polyfill support by @nev21 in #523
  • [Release] Increase version to 0.13.0 by @nev21 in #526

Full Changelog: 0.12.6...0.13.0

0.12.6

03 Feb 16:38
7fd394c

Choose a tag to compare

Changelog

Features

  • #497 Improve generic type signatures for deferred and lazy value functions
    • Updated getLazy, getWritableLazy, getDeferred, and getWritableDeferred with more flexible callback type signatures
    • Added union type to callback parameters: cb: F | ((...args: any[]) => T/R)
    • Aligned type parameter defaults to (...args: any[]) => T/R for consistency
    • Updated JSDoc to reflect new generic defaults
  • #498 Extend generic signature improvements to safe wrapper functions
    • Updated safe() to use ReturnType<F> instead of any for better type inference
    • Aligned safeGet, safeGetLazy, safeGetWritableLazy, safeGetDeferred, and safeGetWritableDeferred with flexible callback signatures
    • Removed unnecessary default T = boolean from safeGet

Bug Fixes

  • #491 Update incorrect documentation
    • Fixed TSDoc for strTrim() (was incorrectly documented as trim())

What's Changed

  • Bump glob from 11.0.2 to 11.0.3 by @dependabot[bot] in #440
  • Pin @sinonjs/samsam and @sinonjs/fake-timers to fix CI parser errors by @Copilot in #451
  • Downgrade @sinonjs/samsam dependency to resolve workflow parsing errors by @Copilot in #454
  • Bump actions/checkout from 4 to 5 by @dependabot[bot] in #448
  • Bump actions/upload-pages-artifact from 3 to 4 by @dependabot[bot] in #457
  • Bump github/codeql-action from 3 to 4 by @dependabot[bot] in #464
  • Bump @rollup/plugin-commonjs from 28.0.9 to 29.0.0 by @dependabot[bot] in #465
  • Bump cross-env from 7.0.3 to 10.1.0 by @dependabot[bot] in #463
  • Bump actions/setup-node from 4 to 5 by @dependabot[bot] in #461
  • Bump actions/setup-node from 5 to 6 by @dependabot[bot] in #466
  • Bump @types/sinon from 17.0.4 to 20.0.0 by @dependabot[bot] in #467
  • Bump @types/sinon from 20.0.0 to 21.0.0 by @dependabot[bot] in #468
  • Bump glob from 11.0.3 to 11.1.0 by @dependabot[bot] in #469
  • Bump glob from 11.0.3 to 13.0.0 by @dependabot[bot] in #471
  • Bump actions/checkout from 5 to 6 by @dependabot[bot] in #472
  • Enhance Dependabot configuration for GitHub Actions and npm by @nev21 in #473
  • Update dependabot configuration for npm packages by @nev21 in #474
  • Update Dependabot Force Rebase workflow configuration by @nev21 in #480
  • Refactor Dependabot rebase workflow by @nev21 in #481
  • Bump size-limit from 11.2.0 to 12.0.0 by @dependabot[bot] in #475
  • Delete .github/workflows/dependabot-auto-merge.yml by @nev21 in #484
  • Add workflow to sync rush.json with Dependabot updates by @nev21 in #483
  • Add GitHub Actions workflow for auto-approving PRs by @nev21 in #486
  • Bump peter-evans/rebase from 2 to 4 by @dependabot[bot] in #482
  • Update incorrect documentation by @nev21 in #491
  • Add GitHub Copilot instructions for repository by @Copilot in #490
  • Delete .github/workflows/sync-rush-versions.yml by @nev21 in #494
  • Update pr-auto-approve.yml by @nev21 in #495
  • Bump lewagon/wait-on-check-action from 1.4.1 to 1.5.0 by @dependabot[bot] in #496
  • fix: Improve generic type signatures for deferred and lazy value functions by @nev21 in #497
  • fix: Extend generic signature improvements to safe wrapper functions by @nev21 in #498
  • [Release] Increase version to 0.12.6 by @nev21 in #499

New Contributors

  • @Copilot made their first contribution in #451

Full Changelog: 0.12.5...0.12.6

0.12.5

20 May 16:40
1e5aabc

Choose a tag to compare

Changelog

Issues

  • #434 [Bug] Tree-Shaking: _wellKnownSymbolMap using createEnumKeyMap is not always tree-shaken

Commits

  • #435 [Bug] Tree-Shaking: _wellKnownSymbolMap using createEnumKeyMap is not always tree-shaken #434

What's Changed

  • [Bug] Tree-Shaking: _wellKnownSymbolMap using createEnumKeyMap is not always tree-shaken #434 by @MSNev in #435
  • [Release] Increase version to 0.12.5 by @nev21 in #436

Full Changelog: 0.12.4...0.12.5

0.12.4

18 May 01:34
b22597d

Choose a tag to compare

Changelog

Issues

  • #428 [Bug] Tree-Shaking strSymSplit is not always getting tree-shaken

Commits

  • #429 [Bug] Tree-Shaking strSymSplit is not always getting tree-shaken #428

What's Changed

  • [Bug] Tree-Shaking strSymSplit is not always getting tree-shaken #428 by @nev21 in #429
  • [Release] Increase version to 0.12.4 by @nev21 in #432

Full Changelog: 0.12.3...0.12.4

0.12.3

05 May 02:47
6df0c92

Choose a tag to compare

Changelog

Features

  • #424 [Feature] Add additional is function tests (isAsyncFunction, isGenerator, isAsyncGenerator)
  • #420 [Feature] Add a new getDeferredValue that gets passed the function and optional parameters
    • Added: getDeferred, getWritableDeferred, safeGetDeferred, safeGetWritableDeferred
    • Updated existing functions to support the passing of optional additional arguments: getLazy, getWritableLazy, safeGet
  • #416 [Feature] Added: setGlobalTimeoutOverrides, setTimeoutOverrides

Commits

  • #412 Increase code coverage
  • #413 Enable CI Merge_Queue
  • #411 Add additional size tests for the "isXXX" functions
  • #410 Bump glob from 11.0.1 to 11.0.2
  • #415 Reduce the code required for polyfills
  • #417 Update README.md and documentation
  • #418 Remove module documentation link
  • #419 Update global and package level default timeout functions
  • #421 Update size-optimization.md

What's Changed

  • Increase code coverage by @nev21 in #412
  • Enable CI Merge_Queue by @nev21 in #413
  • Update codeql-analysis.yml to support merge-queue by @nev21 in #414
  • Add additional size tests for the "isXXX" functions by @MSNev in #411
  • Bump glob from 11.0.1 to 11.0.2 by @dependabot in #410
  • Reduce the code required for polyfills by @nev21 in #415
  • Add setGlobalTimeoutOverrides by @nev21 in #416
  • Update README.md and documentation by @nev21 in #417
  • Remove module documentation link by @nev21 in #418
  • Update global and package level default timeout functions by @nev21 in #419
  • Update size-optimization.md by @nev21 in #421
  • [Feature] Add a new getDeferred that gets passed the function and optional parameters #420 by @nev21 in #423
  • Add additional is function tests (isAsyncFunction, isGenerator, isAsyncGenerator) by @nev21 in #424
  • [Release] Increase version to 0.12.3 by @nev21 in #425

Full Changelog: 0.12.2...0.12.3

0.12.2

17 Apr 17:50
75903ff

Choose a tag to compare

Changelog

Issues

  • #403 [Bug] Excessive increase in 0.12.0/0.12.1 which introduced a polyfill for objGetOwnPropertyDescriptor
  • #405 [Bug] createWildcardRegex has an invalid regular expression

Tasks

  • (Partial) #401 [Task] Add pre-release testing validation with external projects
    • Adds a simple check that validates that all of the links in the readme map to the typedoc generated docs, this should catch unexpected dropped exports

Commits

  • #402 [Bug] createWildcardRegex invalid regular expression #405 and link checker #401
  • #406 [Bug] Excessive increase in 0.12.0/0.12.1 which introduced a polyfill for objGetOwnPropertyDescriptor #403

What's Changed

  • [Bug] createWildcardRegex invalid regular expression #405 and link checker #401 by @nev21 in #402
  • [Bug] Excessive increase in 0.12.0/0.12.1 which introduced a polyfill for objGetOwnPropertyDescriptor #403 by @nev21 in #406
  • [Release] Increase version to 0.12.2 by @nev21 in #407

Full Changelog: 0.12.1...0.12.2

0.12.1

14 Apr 15:38
eb00ee9

Choose a tag to compare

Changelog

Issues

  • #398 [Bug] setValueByKey function is no longer exported in version 0.12.0

Commits

  • #399 Reinstate the dropped exports due to code re-organization

What's Changed

  • [Bug] setValueByKey function is no longer exported in version 0.12.0 #398 by @nev21 in #399
  • [Release] Increase version to 0.12.1 by @nev21 in #400

Full Changelog: 0.12.0...0.12.1

0.12.0

14 Apr 06:12
21a2fb2

Choose a tag to compare

Changelog

Issues

  • #387 [Bug] Polyfill symbol doesn't work as expected as unique key for an object
  • #389 [Bug] objCreate doesn't support additional optional properties argument
  • #392 [Bug] mathMax is defined to use using Math.min

Commits

  • #378 Bump mocha from 10.8.2 to 11.2.0
  • #383 Add objIs and polyObjIs
  • #384 Add additional Object alias functions
    • objPropertyIsEnumerable, objFromEntries, objGetOwnPropertyDescriptors,objGetOwnPropertyNames, objGetOwnPropertySymbols, objIsFrozen, objIsSealed, objPreventExtensions, objIsExtensible
    • Add new type check functions
      • isMap, isMapLike
    • Update symbol polyfill to enable isSymbol
  • #390 Fixup exports and readme for new functions
  • #391 Bump to typedoc ^0.28.2, Bump to typescript ~5.2.2
    • Use github theme
    • tag alias constants as functions
    • Bump to typescript ~5.2.2
      • remove suppressImplicitAnyIndexErrors
  • #393 [Bug] mathMax is defined to use using Math.min #392
    • Add additional ES5 Math aliases
      • mathAbs, mathExp, mathLog, mathAsin, mathAcos, mathAtan, mathAtan2, mathPow, mathSqrt, mathRandom, mathSin, mathCos, mathTan
  • #394 Add isSet, SetLike, WeakSet and isWeakMap helpers
  • #395 Add isBigInt, isElement, isEmpty, isInteger, isFiniteNumber
  • #396 Add isElementLike helper

What's Changed

  • Bump mocha from 10.8.2 to 11.2.0 by @dependabot in #378
  • Add objIs and polyObjIs by @nev21 in #383
  • Add additional Object alias functions by @nev21 in #384
  • Fixup exports and readme for new functions by @nev21 in #390
  • Bump to typedoc ^0.28.2, Bump to typescript ~5.2.2 by @nev21 in #391
  • [Bug] mathMax is defined to use using Math.min #392 by @nev21 in #393
  • Add isSet, SetLike, WeakSet and isWeakMap helpers by @nev21 in #394
  • Add isBigInt, isElement, isEmpty, isInteger, isFiniteNumber by @nev21 in #395
  • Add isElementLike helper by @nev21 in #396
  • [Release] Increase version to 0.12.0 by @nev21 in #397

Full Changelog: 0.11.8...0.12.0