Releases: nevware21/ts-utils
Releases · nevware21/ts-utils
0.15.0
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
queueMicrotaskwhen present, Promise-backed scheduling when available, and a timer-backed microtask queue otherwise
- New functions:
- #573 Add nextTick scheduling support and new helper exports
- New timer/runtime functions:
scheduleNextTick,getProcessNextTick,hasProcessNextTick,setNextTickFallbackOptions - Uses native
process.nextTickin 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
arrConcatas a dedicated array helper andfnBindArgsas a dedicated function helper - Improves function binding typing with exported
BoundFunctionand updated signatures forfnBind/fnBindArgs
- New timer/runtime functions:
- #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
arrToMaphelper in the array module and moved callback/type declarations intoiterator/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
arrIncludessemantics for parity with array helpers
- Added new iterator helpers:
- #576 Refactor timer microtask/nextTick shared types and environment helpers, with expanded fallback coverage
- Moved
MicrotaskFnandScheduleMicrotaskFntohelpers/typesand updated timer internals to consume shared type definitions - Moved
getQueueMicrotaskandhasQueueMicrotasktohelpers/environment, updated root exports, and alignedscheduleNextTickfallback resolution to preferqueueMicrotaskwhen available - Added internal
microtaskQueuescheduler helper wiring and expanded tests for queue fallback behavior, Promise ordering, and no-Promise edge cases
- Moved
Bug Fixes
- #568 Rolldown
INVALID_ANNOTATIONwarnings 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/bundleandlib/dist
- #569 Add generated-chunk PURE annotation normalization so spaced forms are rewritten to canonical
New Contributors
- @hrithik-infinite made their first contribution in #569
Full Changelog: 0.14.0...0.15.0
0.14.0
Changelog
Features
- #525 feat(array): add new array helpers and array-like detection
- New helpers:
isArrayLike,arrUnique,arrCompact,arrFlatten,arrGroupBy,arrChunkand export previously missedisArrayLike
- New helpers:
- #527 feat(string): add
strReplaceandstrReplaceAllhelpers with refactored internal replacements - #528 feat(string): add
strCapitalizeWordshelper - #529 / #530 feat(string): add
strTruncate,strCount,strAt, andstrMatchAllhelpers with shared literal regex helper - #533 feat(array): add
arrFlatMapwith ES5 polyfill support - #535 docs(types): add typing utilities for v0.14.0 and expand TSDoc examples
- #536 feat: add
isAsyncIterableandisIntegerInRangetype/value inspection helpers - #543 feat(string): add
strStartsWithAny,strEndsWithAny,strWrap,strUnwrap, andstrNormalizeNewlineshelpers - #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 (existingforEachOwnKeySafewas string-only) - New helper:
objForEachKeySafe— safe string-key iteration that filters__proto__,constructor,prototype - Extended
isUnsafeTargetcoverage to TypedArrays,ArrayBuffer,DataView,WeakRef,FinalizationRegistry
- New helpers:
Security Issue
- CVE-2026-46681 Prototype Pollution in objDeepCopy/objCopyProps via for...in without hasOwnProperty
- Also affected
setValueByKeyandsetValueByIter - #565 feat: add prototype-pollution guards and array key helpers
- Also affected
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 omittinglib) receivedCannot find name 'Symbol'/Cannot find name 'Iterator'errors because the published.d.tsexposed 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 testtsconfigfiles for consistent compile-time validation - Net effect: consumers no longer need to add
"ES2015"to their owntsconfig.jsonlib settings
- Consumers using
- #561 Bug: Falsy
thisArg(0,'',false) overridden inarrForEach/iterForOf/objForEachKey- #566 Fix falsy
thisArg(0,'',false) being overridden inarrForEach,iterForOf,objForEachKey
- #566 Fix falsy
- #562 Fix
thisArgbinding inpolyArrFindIndex/polyArrFindLastIndexpolyfills
Repository Improvements
0.13.0
Changelog
Features
-
Added comprehensive encoding and decoding functions for multiple formats:
- Base64 Encoding/Decoding:
encodeAsBase64()anddecodeBase64()with native fallbacks and ES5 polyfill support - URL-Safe Base64:
encodeAsBase64Url()anddecodeBase64Url()for safe Base64 encoding in URLs (replaces+with-,/with_, removes padding) - Hexadecimal Encoding/Decoding:
encodeAsHex()anddecodeHex()for hex string conversion - URI Encoding/Decoding:
encodeAsUri()anddecodeUri()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
- Base64 Encoding/Decoding:
-
Enhanced
createCustomError()withsuperArgsFnparameter:- New optional
superArgsFnparameter 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 baseError(message)constructor
- New optional
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
superArgsFntocreateCustomErrorfor 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
Changelog
Features
- #497 Improve generic type signatures for deferred and lazy value functions
- Updated
getLazy,getWritableLazy,getDeferred, andgetWritableDeferredwith 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/Rfor consistency - Updated JSDoc to reflect new generic defaults
- Updated
- #498 Extend generic signature improvements to safe wrapper functions
- Updated
safe()to useReturnType<F>instead ofanyfor better type inference - Aligned
safeGet,safeGetLazy,safeGetWritableLazy,safeGetDeferred, andsafeGetWritableDeferredwith flexible callback signatures - Removed unnecessary default
T = booleanfromsafeGet
- Updated
Bug Fixes
- #491 Update incorrect documentation
- Fixed TSDoc for
strTrim()(was incorrectly documented astrim())
- Fixed TSDoc for
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
Changelog
Issues
- #434 [Bug] Tree-Shaking: _wellKnownSymbolMap using createEnumKeyMap is not always tree-shaken
Commits
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
0.12.3
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
- Added:
- #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
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
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
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
- Add additional ES5 Math aliases
- #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