Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@nevware21/ts-utils

nevware211.9mMIT0.12.5TypeScript support: included

Comprehensive TypeScript/JavaScript utility library with cross-environment support (Node.js, browser, web worker) providing helper functions, polyfills (ES5-ES2023), type checking utilities, and optimized implementations for better minification and code r

ts, typescript, js, javascript, minification, minify, utils, helper, node, browser, worker, webworker, polyfill, ES5, ES6, ES7, ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ECMAScript 5, ECMAScript 6, ECMAScript 7, ECMAScript 2015, ECMAScript 2016, ECMAScript 2017, ECMAScript 2018, ECMAScript 2019, ECMAScript 2020, ECMAScript 2021, ECMAScript 2022, ECMAScript 2023, getDocument, getGlobal, getHistory, getInst, getNavigator, getWindow, hasDocument, hasHistory, hasNavigator, hasWindow, isNode, isWebWorker, isArray, isArrayBuffer, isBlob, isBoolean, isDate, isError, isFile, isFormData, isFunction, isIterable, isIterator, isNullOrUndefined, isNumber, isObject, isPromise, isPromiseLike, isThenable, isRegExp, isStrictNullOrUndefined, isStrictUndefined, isString, isTypeof, isUndefined, hasValue, isDefined, isNotTruthy, isTruthy, string left, strLeft, string right, strRight, normalize js name, letter case, lettercase, camel case, camelcase, kebab case, kebabcase, snake case, snakecase, uppercase, lowercase, custom error, asString, hasOwn, defineProperty, timeout, idle timer, timer, interval, includes, string contains, html encode, deep-copy, deep-clone, throttle, debounce, memoize, utility-functions, cross-platform, environment-detection, tree-shaking, bundle-size-optimization, esm, commonjs, umd, type-guards, object-manipulation, array-utilities, string-manipulation, promise-utilities, async-utilities, zero-dependency, universal, isomorphic, cross-runtime, environment-agnostic, lodash-alternative, underscore-alternative, ramda-alternative, starts-with, ends-with, string-padding, string-trim, string-repeat, array-map, array-reduce, array-filter, array-find, object-copy, object-keys, lightweight, performance-optimized, type-safe

readme

@nevware21/ts-utils

Comprehensive TypeScript/JavaScript Utility Library

GitHub Workflow Status (main) codecov npm version downloads downloads Sponsor

Overview

A comprehensive TypeScript/JavaScript utility library that provides:

  • Cross-Environment Support: Works seamlessly in Node.js, browsers, and web workers
  • Helper Functions: Extensive collection of utility functions for common operations
  • Type Checking: Robust type checking utilities to improve code reliability
  • Optimized for Minification: Function naming designed for better minification
  • Zero Dependencies: Lightweight and self-contained
  • ECMAScript Support: Supports modern JavaScript features across ES5 to ES2023, ensuring broad usability in various environments
  • Polyfills: Uses built-in functions to support older environments, providing modern JavaScript features without sacrificing compatibility

If you find this library useful, please consider sponsoring @nevware21 to support ongoing development and maintenance.

Installation

npm install @nevware21/ts-utils --save

Recommended Version Specification:

"@nevware21/ts-utils": ">= 0.12.5 < 2.x"

Note: v0.x and v1.x maintain ES5 compatibility. Future v2.x releases will update the baseline to newer ECMAScript versions.

Key Features

Environment Utilities

  • Global object detection and access
  • Environment detection (Node.js, browser, web worker)
  • Safe access to environment-specific APIs

Type Checking

  • Comprehensive type checking for all JavaScript types
  • Value validation helpers
  • Advanced type checks for promises, iterables, and more

Array Helpers

  • Safe array manipulation with polyfills for older environments
  • Cross-environment array utilities
  • Performance-optimized implementations

Object Utilities

  • Property manipulation
  • Deep copy/extend
  • Object transformation helpers

String Manipulation

  • Case conversion (camelCase, kebab-case, snake_case)
  • String transformation utilities
  • HTML and JSON encoding

Function Helpers

  • Function binding and proxying utilities
  • Argument manipulation
  • Function creation helpers

Time and Performance

  • Consistent timing APIs across environments
  • Performance measurement utilities
  • Scheduling helpers with automatic polyfills
  • Customizable timeout handling via package-level and global overrides

For advanced timeout customization options, including global overrides, see our Timeout Overrides Guide.

And More

  • Math utilities
  • Symbol polyfills
  • RegExp helpers
  • Iterator utilities

Documentation & API Reference

Visit our documentation site for comprehensive guides and references.

Category Documentation
Getting Started Usage Guide
Advanced Features Timeout Overrides, Deep Copy
Performance Bundle Size Optimization
API Reference TypeDoc Documentation

Available Utilities

Below is a categorized list of all available utilities with direct links to their documentation:

Type Functions / Helpers / Aliases / Polyfills
Runtime Environment Checks getCancelIdleCallback(); getDocument(); getGlobal(); getHistory(); getIdleCallback(); getInst(); getNavigator(); getPerformance(); getWindow(); hasDocument(); hasHistory(); hasNavigator(); hasPerformance(); hasWindow(); isNode(); isWebWorker(); hasIdleCallback(); lazySafeGetInst();
Type Identity isArray(); isArrayBuffer(); isAsyncFunction(); isAsyncGenerator(); isBigInt(); isBlob(); isBoolean(); isDate(); isElement(); isElementLike(); isError(); isFile(); isFiniteNumber(); isFormData(); isFunction(); isGenerator(); isInteger(); isIterable(); isIterator(); isMap(); isMapLike(); isNullOrUndefined(); isNumber(); isObject(); isPlainObject(); isPrimitive(); isPrimitiveType(); isPromise(); isPromiseLike(); isRegExp(); isSet(); isSetLike(); isStrictNullOrUndefined(); isStrictUndefined(); isString(); isThenable(); isTypeof(); isUndefined(); isWeakMap(); isWeakSet();
Value Check hasValue(); isDefined(); isEmpty(); isNotTruthy(); isNullOrUndefined(); isStrictNullOrUndefined(); isStrictUndefined(); isTruthy(); isUndefined();
Value getValueByKey(); setValueByKey(); getValueByIter(); setValueByIter(); encodeAsJson(); encodeAsHtml(); asString(); getIntValue(); normalizeJsName();
   
Array arrAppend(); arrContains(); arrEvery(); arrFilter(); arrFind(); arrFindIndex(); arrFindLast(); arrFindLastIndex(); arrForEach(); arrFrom(); arrIncludes(); arrIndexOf(); arrLastIndexOf(); arrMap(); arrReduce(); arrSlice(); arrSome(); getLength(); isArray();
polyIsArray(); polyArrIncludes(); polyArrFind(); polyArrFindIndex(); polyArrFindLastIndex(); polyArrFindLast(); polyArrFindLastIndex(); polyArrFrom();
ArrayLike arrContains(); arrEvery(); arrFilter(); arrFind(); arrFindIndex(); arrFindLast(); arrFindLastIndex(); arrForEach(); arrFrom(); arrIncludes(); arrIndexOf(); arrLastIndexOf(); arrMap(); arrReduce(); arrSlice(); arrSome(); getLength(); objEntries(); objValues();
DOM isElement(); isElementLike();
Enum createEnum(); createEnumKeyMap(); createEnumValueMap(); createSimpleMap(); createTypeMap();
Error createCustomError(); isError(); throwError(); throwRangeError(); throwTypeError(); throwUnsupported();
Function fnApply(); fnBind(); fnCall(); createFnDeferredProxy(); createProxyFuncs(); readArgs();
Idle getCancelIdleCallback(); getIdleCallback(); hasIdleCallback(); setDefaultIdleTimeout(); setDefaultMaxExecutionTime();
Iterator createArrayIterator(); createIterator(); createIterable(); createRangeIterator(); iterForOf(); isIterable(); isIterator(); makeIterable(); arrAppend(); arrFrom();
Number getIntValue(); isInteger(); isFiniteNumber(); isNumber();
Math mathAbs(); mathAcos(); mathAsin(); mathAtan(); mathAtan2(); mathCeil(); mathCos(); mathExp(); mathFloor(); mathLog(); mathMax(); mathMin(); mathPow(); mathRandom(); mathRound(); mathSin(); mathSqrt(); mathTan(); mathToInt(); mathTrunc();
Object deepExtend(); isObject(); objAssign(); objCopyProps(); objCreate(); objDeepCopy(); objDeepFreeze(); objDefine(); objDefineAccessors(); objDefineGet(); objDefineProp(); objDefineProps(); objDefineProperties(); objEntries(); objExtend(); objForEachKey(); objFreeze(); objFromEntries(); objGetOwnPropertyDescriptor(); objGetOwnPropertyDescriptors(); objGetOwnPropertyNames(); objGetOwnPropertySymbols(); objHasOwn(); objHasOwnProperty(); objIs(); objIsExtensible(); objIsFrozen(); objIsSealed(); objKeys(); objPreventExtensions(); objPropertyIsEnumerable(); objSeal(); objGetPrototypeOf(); objSetPrototypeOf(); objToString(); objValues();
polyObjEntries(); polyObjIs(); polyObjKeys();
String asString(); getLength(); isString(); strEndsWith(); strIndexOf(); strIsNullOrEmpty(); strIsNullOrWhiteSpace(); strLastIndexOf(); strLeft(); strPadEnd(); strPadStart(); strRepeat(); strRight(); strSlice(); strSplit(); strStartsWith(); strSubstr(); strSubstring(); strSymSplit(); strTrim(); strTrimEnd(); strTrimLeft(); strTrimRight(); strTrimStart(); strLetterCase(); strCamelCase(); strKebabCase(); strSnakeCase(); strUpper(); strLower(); strContains(); strIncludes();
polyStrSubstr(); polyStrTrim(); polyStrTrimEnd(); polyStrTrimStart(); polyStrIncludes();
Symbol WellKnownSymbols (const enum);
getKnownSymbol(); getSymbol(); hasSymbol(); isSymbol(); newSymbol(); symbolFor(); symbolKeyFor();
polyGetKnownSymbol(); polyNewSymbol(); polySymbolFor(); polySymbolKeyFor();

Polyfills are used to automatically backfill runtimes that do not support Symbol, not all of the Symbol functionality is provided.
Timer createTimeout(); createTimeoutWith(); elapsedTime(); perfNow(); setGlobalTimeoutOverrides(); setTimeoutOverrides(); utcNow(); scheduleIdleCallback(); scheduleInterval(); scheduleTimeout(); scheduleTimeoutWith(); hasIdleCallback();
For runtimes that don't support requestIdleCallback normal setTimeout() is used with the values from setDefaultIdleTimeout() and setDefaultMaxExecutionTime();
polyUtcNow();
Conversion encodeAsJson(); encodeAsHtml(); asString(); getIntValue(); normalizeJsName(); strLetterCase(); strCamelCase(); strKebabCase(); strSnakeCase(); strUpper(); strLower();
Cache createCachedValue(); createDeferredCachedValue(); getDeferred(); getWritableDeferred();
Lazy getLazy(); getWritableLazy(); lazySafeGetInst(); safeGetLazy(); safeGetLazy(); setBypassLazyCache();
Safe safe(); safeGetLazy(); safeGet(); safeGetDeferred(); safeGetWritableDeferred(); lazySafeGetInst(); safeGetWritableLazy();
Diagnostic dumpObj();
RegEx createFilenameRegex(); createWildcardRegex(); makeGlobRegex();

Unless otherwise stated in the functions documentation polyfills are used to automatically backfill unsupported functions in older ES5 runtimes

Why Use ts-utils?

1. Better Minification

Using ts-utils helper functions can significantly reduce your bundle size compared to standard JavaScript methods:

// Standard JavaScript - Can't be minified effectively
function stdCode(obj) {
  if (Array.isArray(obj)) {
    for (let i = 0; i < obj.length; i++) {
      if (Object.prototype.hasOwnProperty.call(obj, i)) {
        // Do something
      }
    }
  }
}

// Using ts-utils - Allows better minification
import { isArray, arrForEach, objHasOwnProperty } from "@nevware21/ts-utils";

function optimizedCode(obj) {
  if (isArray(obj)) {
    arrForEach(obj, (value, idx) => {
      if (objHasOwnProperty(obj, idx)) {
        // Do something
      }
    });
  }
}

When minified, the ts-utils version is significantly smaller as function names can be reduced to single characters.

2. Cross-Environment Compatibility

Write code once that works across all environments without worrying about platform-specific APIs:

import { getGlobal, isNode, isWebWorker } from "@nevware21/ts-utils";

// Safely access the global object in any environment
const globalObj = getGlobal();

// Environment detection
if (isNode()) {
  // Node.js specific code
} else if (isWebWorker()) {
  // Web Worker specific code
} else {
  // Browser specific code
}

3. Type Safety

Robust type checking utilities to make your code more reliable:

import { 
  isString, isNumber, isObject, isArray, 
  isNullOrUndefined, isPromise 
} from "@nevware21/ts-utils";

function processValue(value: any) {
  if (isString(value)) {
    return value.toUpperCase();
  } else if (isNumber(value)) {
    return value * 2;
  } else if (isArray(value)) {
    return value.length;
  } else if (isPromise(value)) {
    return value.then(result => result);
  } else if (isNullOrUndefined(value)) {
    return "No value provided";
  }

  return "Unknown type";
}

4. Modern ECMAScript Features

Support for newer ECMAScript features with backward compatibility:

import {
  arrFindLast, arrFindLastIndex, // ES2023
  objGetOwnPropertyDescriptors, // ES2017
  strPadStart, strPadEnd, // ES2017
  isBigInt, // ES2020
  isWeakMap, isWeakSet // ES2015+
} from "@nevware21/ts-utils";

// Using ES2023 array methods with backward compatibility
const numbers = [5, 12, 8, 130, 44];
const lastBigNumber = arrFindLast(numbers, num => num > 10); // 44
const lastBigNumberIndex = arrFindLastIndex(numbers, num => num > 10); // 4

// Safe property descriptor access (ES2017)
const descriptors = objGetOwnPropertyDescriptors(myObject);

// String padding (ES2017)
const paddedString = strPadStart("123", 5, "0"); // "00123"
const paddedEnd = strPadEnd("hello", 10, "."); // "hello....."

// Safe type checks for modern types
if (isBigInt(someValue)) {
  // Handle BigInt (ES2020) safely
}

Test Environments

This library is thoroughly tested in:

  • Node.js (16, 18, 20, 22)
  • Modern browsers (via Chromium headless)
  • Web Workers (via Chromium headless)

All polyfill functions are tested against native implementations to ensure full compatibility.

Module Support

The library supports multiple module formats to accommodate different project setups:

  • ES Modules (ESM)
  • CommonJS (CJS)
  • Universal Module Definition (UMD)

Language Support

ES5 Compatibility

This library maintains ES5 compatibility for all v0.x and v1.x releases, ensuring support for any runtime that supports ES5 or higher.

Internal polyfills are used to backfill ES5 functionality which is not provided by older runtimes / browsers.

Future ECMAScript Support

Starting with v2.x, the library plans to update its baseline to target newer ECMAScript versions, reducing the need for polyfills as browser and runtime support evolves.

Browser Support

Chrome Firefox Edge Opera Safari IE
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔
9+ ✔

Internet Explorer support will be dropped in v2.x

Polyfills

All of the included polyfills are tested against the current native implementation running in node, browser and worker environments to ensure that they conform to the current specification, these polyfills are only internally used for ES5 compatibility and when running in an environment (mostly IE) that does not support the required function.

Some additional polyfills are provided for simple backward compatibility to enable the utility functions in older environments, however, you don't have to use or include these provided polyfils. If you need to use them you will need to import the pre-packaged "polyfill" bundle (bundle/ts-polyfills-utils.min.js) directly by hosting it on your own CDN or all of the non-internal polyfill implementations are exported so you could implement your own version of the polyfill initializer or more simply provide your own alternatives.

Notes:

  • While some polyfills are provided to "somewhat" support older environments this library does not intend to become a fully fledged polyfill library. And the polyfills provided (or contributed) are just the minimum set that have been required over time. And should be less necessary are time moves forward.
  • Several functions use the Object.defineProperty and therefore support is limited to runtimes or good polyfills that can correctly implement this functionality. (eg. createIterator; createIterable)

TypeScript Support

Built with TypeScript v5.2.2, with minimal requirements of TypeScript v2.8+ for the type definitions.

Size Analysis and Bundle Optimization

Bundle Size Impact

The ts-utils library is designed with size optimization as a primary goal. Each function is independently importable and has been optimized for tree-shaking in modern bundlers like Webpack and Rollup. This allows you to include only what you need in your final bundle.

Here's a comparison of bundle sizes when using ts-utils versus standard JavaScript approaches:

Scenario Standard JS With ts-utils Size Reduction
Basic type checking ~1.2KB ~0.3KB ~75%
Array operations ~0.9KB ~0.4KB ~55%
String utilities ~1.5KB ~0.6KB ~60%
Object helpers ~2.1KB ~0.8KB ~62%

For detailed byte-level measurements and concrete size optimization strategies, check out our Bundle Size Optimization Guide.

Note: Actual size savings depend on your specific usage patterns, minification settings, and bundler configuration.

When to Use ts-utils for Repeated Functions

You should consider using ts-utils helper functions when:

  1. Your code uses the same operations repeatedly: If you're frequently checking types, manipulating arrays/objects, or working with strings, using ts-utils can reduce repetition and improve minification.

  2. Bundle size is a concern: For applications where download size matters (e.g., mobile web apps, SPAs), ts-utils can significantly reduce your bundle size through better minification.

  3. Cross-environment compatibility is needed: When your code needs to run across Node.js, browsers, and web workers without environment-specific code paths.

  4. You want better tree-shaking: The library is designed to allow bundlers to eliminate unused code effectively.

  5. Consistent API access is important: ts-utils provides a unified API for accessing functionality that might be implemented differently across environments.

For example, instead of repeating this pattern across your codebase:

// Before: Multiple instances of this pattern across your code
if (typeof value === 'object' && value !== null && Array.isArray(value)) {
  for (let i = 0; i < value.length; i++) {
    if (Object.prototype.hasOwnProperty.call(value, i)) {
      // Do something with value[i]
    }
  }
}

Use ts-utils to make it more concise and minification-friendly:

// After: More concise, better minification
import { isArray, arrForEach, objHasOwnProperty } from "@nevware21/ts-utils";

if (isArray(value)) {
  arrForEach(value, (item, idx) => {
    if (objHasOwnProperty(value, idx)) {
      // Do something with item
    }
  });
}

For more information on performance and minification benefits, see our Usage Guide.

For detailed documentation on all available utilities, refer to the main documentation site.

License

MIT

changelog

v0.12.5 May 20th, 2025

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

v0.12.4 May 17th, 2025

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

v0.12.3 May 4th, 2025

Changelog

Features

  • #424 Add additional is function tests (isAsyncFunction, isGenerator, isAsyncGenerator)
  • #420 [Feature] Add a new getDeferredValue that gets passed the function and optional parameters
  • #416 Add setGlobalTimeoutOverrides

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

v0.12.2 Apr 17th, 2025

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

v0.12.1 Apr 14th, 2025

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

v0.12.0 Apr 14th, 2025

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

v0.11.7 Feb 24th, 2025

Changelog

  • #369 Bump ts-mocha from 10.1.0 to 11.1.0
  • #370 Add mathRound alias for Math.round

v0.11.7 Feb 17th, 2025

Changelog

  • #366 [Bug] getWritableLazy() intriduced in 0.9.4 has not been exported
  • #353 Bump @rollup/plugin-node-resolve from 15.3.1 to 16.0.0
  • #355 Bump puppeteer from 23.11.1 to 24.0.0
  • #356 Bump glob from 11.0.0 to 11.0.1

v0.11.6 Dec 12th, 2024

Changelog

  • #337 Update dependabot.yml
  • #338 Bump github/codeql-action from 2 to 3
  • #340 Bump actions/checkout from 2 to 4
  • #339 Bump codecov/codecov-action from 2 to 4
  • #341 Bump actions/configure-pages from 4 to 5
  • #342 Bump actions/setup-node from 3 to 4
  • #343 Update to use ts-build-tools
    • #344 Bump @nevware21/ts-build-tools to ^0.1.3
  • #345 Bump codecov/codecov-action from 4 to 5
  • #347 Create FUNDING.yml
    • #348 Update FUNDING.yml
  • #350 [doc] TSDoc Error During Build

v0.11.5 Oct 23rd, 2024

Changelog

  • #324 [Doc] Auto deploy docs and remove from repo
  • #325 chore: Auto deploy docs
  • #326 Update auto-docs generation
  • #328 Bump @rollup/plugin-typescript from 11.1.6 to 12.1.0
  • #327 Typedoc: rename workflow
  • #330 Bump @rollup/plugin-commonjs from 26.0.3 to 28.0.0
  • #331 Bump puppeteer from 22.15.0 to 23.4.0
  • #333 [Bug] Glob is missing from the dev dependencies -- unable to build a clean repo
  • #332 [BUG] Sourcemap load errors in debugger from @nevware21 dependencies

v0.11.4 Sept 21st, 2024

Changelog

  • #289 Bump @typescript-eslint/parser from 6.21.0 to 7.14.1
  • #292 Bump @nevware21/grunt-eslint-ts from 0.2.4 to 0.2.5
  • #291 Bump @nevware21/grunt-ts-plugin from 0.4.5 to 0.4.6
  • #300 [Bug] The createRangeIterator() function is getting mis-optimized for a worker on chrome. #298
    • Bump @nevware21/grunt-eslint-ts from 0.2.5 to 0.5.0
    • Bump @nevware21/grunt-ts-plugin from 0.4.5 to 0.5.0
  • #302 [Bug] getInst() function is getting mis-optimized for a worker with rollup #303
    • Bump @nevware21/grunt-eslint-ts from 0.5.0 to ^0.5.1
    • Bump @nevware21/grunt-ts-plugin from 0.5.0 to ^0.5.1
  • #306 [Bug] CI Tests are failing #319
  • #318 Bump puppeteer from 22.15.0 to 23.4.0
  • #320 bug: update objDefine to use strict undefined
  • #322 Revert "Bump puppeteer from 22.15.0 to 23.4.0 (#318)"

v0.11.3 Jun 26th, 2024

Changelog

  • 286 [Feature] Don't use objDeepFreeze for enums

  • 285 Update Copyright message to conform with LLC operating agreement

  • 278 Bump @rollup/plugin-commonjs from 25.0.8 to 26.0.1

  • 288 Bump typedoc from 0.25.13 to 0.26.2

  • 279 Bump nyc from 15.1.0 to 17.0.0

v0.11.2 Apr 16th, 2024

Changelog

  • 263 Generate single unified es module for exports

v0.11.1 Mar 31st, 2024

Changelog

  • 258 Remove exports defintion from package.json

v0.11.0 Mar 18th, 2024

Changelog

  • 252 [Bug] TypeError: Illegal invocation when calling setTimeout

  • 246 [Bug] Package sizes are too large

  • 241 Remove removed function link from readme

  • 244 Fix CreateIteratorContext n documentation

v0.10.5 Feb 6th, 2024

Minification and minor performance improvements, adds createcacheValue, safe implementations.

Changelog

  • 239 Stop using internal functions for diagnostic to help with base minification for smaller usages

  • 238 Bump puppeteer from 21.11.0 to 22.0.0

v0.10.4 Jan 10th, 2024

Changelog

  • 230 [Bug] Tree-Shaking is not working properly

    • Tags additional (everything else) functions as NO_SIDE_EFFECTS so that rollup (and webpack) can tree-shake
    • Explicitly did not include all functions like isXXXX (specifically isNode) as this was causing the main entry-points for @nevware21/ts-async to drop the node support code (as it's defined as a browser package) resulting in it not supporting all environments as desired with a single package.

v0.10.3 Jan 7th, 2024

Changelog

  • 230 [Bug] Tree-Shaking is not working properly

  • 226 [Feature] Add size tests

v0.10.2 Jan 4th, 2024

Changelog

  • 211 Update signature of getInst and lazySafeGetInst to support any PropertyKey type

  • 228 Minor Performance updates

Dependencies

  • 212 Bump typedoc from 0.24.8 to 0.25.0

  • 218 Bump rollup-plugin-istanbul from 4.0.0 to 5.0.0 #218

  • 220 Fix issue with node version in ci.yml

  • 217 Bump rollup from 3.29.4 to 4.1.4

  • 223 Bump @types/sinon from 10.0.20 to 17.0.1

v0.10.1 Aug 18th, 2023

This is a critical bug fix if you are using symbolKeyFor and/or symbolFor, as the current implementations will always return a new polyfill version rather than using the native Symbol.keyFor and Symbol.for methods

Changelog

  • 208 [Bug] symbolFor and symbolKeyFor are not caching / returning the underlying instance

v0.10.0 Aug 17th, 2023

Changelog

  • 204 [Bug] Remove typescript as a peer dependency

  • 206 Update enum type definitions to provide better validation and auto code completion

  • 202 Bump @typescript-eslint/eslint-plugin from 5.62.0 to 6.1.0

  • 203 Bump puppeteer from 19.11.1 to 21.0.0

v0.9.8 June 18th, 2023

Changelog

  • 192 [Bug] iterForOf does not always process elements correctly

  • 193 [Bug] Calling return or throw on an iterator does not mark it as done

  • 194 [Bug] iterForOf swallows errors caused during the iteration

  • 196 [Feature] Add aliases for functions apply, bind and call

  • 197 [Feature] Add function proxies

v0.9.7 June 11th, 2023

Changelog

  • 185 [Feature] Add Object.entries and Array.from alias / implementations

  • 187 [Feature] Add Object.values alias / implementation

  • 189 [Feature] Update issue templates

v0.9.6 May 31st, 2023

Changelog

  • 178 [Bug] objDeepCopy creates copies of classes by default

  • 181 [Bug] customError definition is not correct, it's a mixture of constructor and implmentation

  • 182 [Feature] Allow creation of sub-class custom errors

    • Set stack trace to the top-most error class

v0.9.5 Apr 25th, 2023

Changelog

  • 173 Support: expose the internal safe helpers to allow reuse.

  • 172 Update publishing scripts

  • 171 Update publishing scripts

  • 170 Bump typedoc to ^0.24.4

v0.9.4 Mar 25th, 2023

Changelog

  • 166 Add writable Lazy support and lazy option to objDefine

    • getWritableLazy()
    • objDefine(target, "name", { l: ILazyValue });

v0.9.3 Mar 25th, 2023

Changelog

  • 164 Add arrSlice and replace _extractArgs usages

v0.9.2 Mar 24th, 2023

Changelog

  • 162 Update Lazy implementation to reduce required for getGlobal()

v0.9.1 Mar 23rd, 2023

Changelog

  • 158 Migrate get/set value by key and strSplit

  • 159 [Packaging] The single module file is causing some packagere issues

v0.9.0 Mar 15th, 2023

Changelog

  • 153 chore: Migrate encoding and conversion functions

    • strLetterCase(); strCamelCase(); strKebabCase(); strSnakeCase(); strUpper(); strLower();
    • encodeAsJson(); encodeAsHtml(); normalizeJsName();
  • 154 Minor enhancements for perf and minification and additional examples

  • 155 Add strIncludes, strContains

    • strContains(); strIncludes();

v0.8.1 Mar 2nd, 2023

Changelog

  • 148 (Priotity 1) [Bug] Creating more than 1 createCustomError() overwrites the "name" of the error.

    • Issue was causing the Error class name to be reassigned to the last created Custom Error, if no custom error was created (including the UnsupportedError) then the Error class was unaffected
  • 146 [Feature] Add an enabled / running flag to the timers to enable checking current state

v0.8.0 Feb 21st, 2023

Changelog

  • 143 Add additional Array functions and update to support ArrayLike objects

    • new Functions: arrEvery, arrFilter, arrFind, arrFindIndex, arrFindLast, arrFindLastIndex, arrIncludes, arrContains, arrLastIndexOf, arrSome
    • Updated examples and added tests for Array like
    • some polyfill versions also added

v0.7.3 Feb 17th, 2023

Changelog

  • 141 Update packaging to create single rollup resources

    • Create single module export
    • Include comments in the d.ts

v0.7.2 Feb 5th, 2023

Changelog

  • 139 Apply additional minification for enum, dumpObj, timers

v0.7.1 Feb 4th, 2023

Changelog

  • 134 Update build link

  • 135 Update to use root LICENSE and README.md in the npm published package

  • 136 chore: Update coverage reporting to include worker test run

  • 138 Add .npmignore for release

v0.7.0 Jan 12th, 2023

Changelog

  • 124 [Request] Add/expose additional NodeJS.Timer functions to the timer implementations

  • 132 Add "esnext" (es6) to package.json and available pre-bundle packages

  • 121 Bump sinon from 14.0.2 to 15.0.0

  • 123 Bump karma-spec-reporter from 0.0.34 to 0.0.35

  • 125 Bump karma-spec-reporter from 0.0.35 to 0.0.36

  • 127 Bump @rollup/plugin-json from 5.0.2 to 6.0.0

  • 126 Bump @rollup/plugin-commonjs from 23.0.7 to 24.0.0

  • 130 Bump @rollup/plugin-typescript from 10.0.1 to 11.0.0

v0.6.0 Nov 28th, 2022

Changelog

  • 115 Add optional enumerable argument to objDefineGet and objDefineAccessors

  • 116 Bump rollup from 2.79.1 to 3.3.0

  • 117 Add objDefine, objDefineProperties and objDefineProps

  • 118 Update package.json and docs for release

v0.5.0 Oct 18th, 2022

Changelog

  • 110 [Test Hook] Need the ability to clear the new lazy cache values for environment values

    • Introduces the ability to cause lazy implmentations to bypass cached values
    • Moved the location of the polyfill global symbol registry

v0.4.6 Oct 15th, 2022

Changelog

  • 106 v0.4.5 has Circular dependencies

v0.4.5 Oct 14th, 2022

Changelog

  • 99 [Bug] Fix issue where Arrays with non-indexed values are not copied

  • 100 Add lazy initialization of globals to provide better tree-shaking when not used.

  • 101 Add clearTimeout override option for the scheduleTimeoutWith

v0.4.4 Oct 10th, 2022

Changelog

  • 83 [Typing] arrForEach - the signature for the callback is incorrect

  • 84 [Bug] objDeepCopy incorrectly tries to copy classes (like Date)

    • 87 [Bug] objDeepCopy incorrectly tries to copy classes (like Date) #84

    • 90 [Bug] objDeepCopy incorrectly tries to copy classes (like Date) #84

  • 88 Add timer support

v0.4.3 Sept 9th, 2022

Changelog

  • 79 [Bug] objForEachKey() is not iterating over defined properties which are enumerable

  • 80 [Bug] toString() added in 0.4.2 is not exported from the main module

v0.4.2 Aug 15th, 2022

Changelog

  • 72 Add mathMin and mathMax

    • Add strSubstring; strSubstr; strLeft; strRight
    • Add getLength
  • 73 Add iterator and iterable creation and processing functions

    • Add creatorIterator
    • Add createArrayIterator
    • Add createIterator; createIterable; makeIterable
    • Add iterForOf
    • Add createRangeIterator
    • Update copyright notices on tests
    • Update ReadMe
  • 74 Update typedoc groups and readme

v0.4.1 Aug 12th, 2022

Changelog

  • 69 [Bug] isObject() throws a TypeError when an object is created via Object.create(null)

v0.4.0 Aug 10th, 2022

Changelog

  • 66 [Bug] strStartsWith and strEndsWith are converting all arguments to strings even if they are not

  • 67 Add isIterator() and isIterable()

    • Break out array functions into separate files
    • Update string stubs to use generated function

v0.3.4 Aug 8th, 2022

Changelog

  • 61 [Compatibilty] ReactNative uses a JavaScript Core that does not support regex lookbehinds

  • 62 [Bug] The generic definition of the arrReduce does not handle different arguments correctly

v0.3.3 Aug 5th, 2022

Changelog

  • 55 Add generic typing's to some functions

  • 56 Move source folder from ts-utils to lib and upgrade typedoc

  • 57 Bump puppeteer from 15.5.0 to 16.0.0

  • 58 Add arrMap and update typedoc groupings

v0.3.2 Aug 3rd, 2022

Changelog

  • [Bug] String trim functions are not exported #51

    • Added missing exports for
      • strEndsWith
      • strPadEnd
      • strPadStart
      • strRepeat
      • strSlice
      • strTrim
      • strTrimEnd
      • strTrimStart
      • strTrimLeft
      • strTrimRight
  • Added functions

    • arrIndexOf
    • arrReduce
    • strIndexOf
    • strLastIndexOf
  • 53 [Bug] The build generated polyfill bundle is missing from the npm package

v0.3.1 Jul, 27th, 2022

Changelog

  • 45 [TreeShaking Issue] The createCustomError is always getting included in the output.

  • 46 [Symbol support] Have the ability to always return the polyfill symbols if not supported

v0.3.0 Jul, 25th, 2022

Changelog

  • 32 Bump @types/estree from 0.0.52 to 1.0.0

  • 34 Add more Object.create and objSetPrototypeOf tests

    • Add symbol support
    • Rollup back typedoc version so descriptions are published (there is an issue with isArray and isArrayBuffer)
    • Switch to HTML Docs
  • 42 Add enum helpers and update symbol support

    • Update Custom Error to support custom error types (not just messages)
    • Add some more examples

Documentation Updates

  • 35 Update HTML link to preview

  • 36 Update to use github pages link

  • 37 Restore Old documentation references for npm

  • 40 Update readme path

  • 41 Remove old pages folder

v0.2.0 Jun 29th, 2022

Changelog

  • 26 Add Object.create and objSetPrototypeOf tests

    • Rollup back typedoc version so descriptions are published
  • 23 Add initial math, additional string and throwRangeError

    • Add math floor, ceil, trunc and toInt
    • Add string, pad, slice and trim, rework string file layout
    • Add throwRangeError
  • 25 Bump @types/estree from 0.0.51 to 0.0.52

  • 24 Bump typedoc from 0.22.18 to 0.23.1

  • 22 Bump puppeteer from 14.4.1 to 15.0.2

  • 20 Add more tests, add additional string, object helpers and custom error support

    • Split out extend
    • Split out object to avoid circular dependencies
    • Remove partial ES3 compatibility from objDefine functions
    • Add string startsWith and endsWith (with polyfills for IE)
    • Add throwUnsupportedError and createCustomError
    • Increase test coverage
  • 19 Add string and object tests -- fixing issues

    • Add combined (merge) coverage report and summary
  • 18 Add Security policy and fix a few copyright header comments

  • 17 Add web worker tests

    • Add more tests coverage
    • Fix identified issues
  • 16 Add Local browser based debugging option

  • 15 Add additional tests and browser coverage

  • 13 Update Documentation

    • Rework some base functions for better minification
    • Update the polyfill bundle to include more used functions
  • 14 Bump mocha from 9.2.2 to 10.0.0

  • 12 Add Tests and Coverage, remove rush usage

  • 10 Bump @nevware21/grunt-ts-plugin from 0.4.3 to 0.4.5

  • 11 Bump @nevware21/grunt-eslint-ts from 0.2.2 to 0.2.4

v0.1.1 May 30th, 2022

Changelog

  • [Bug] v0.1.0 has an invalid entry point defined in the package.json #5