Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,35 @@

### Features

- feat(errors): expose `isOwnInstance` to `createCustomError`'s `constructCb` and skip redundant stack captures
### Bug Fixes

# v0.16.0 July 18th, 2026

## Changelog
Comment on lines +7 to +11

### Features

- [#587](https://github.com/nevware21/ts-utils/pull/587) feat(errors): expose `isOwnInstance` to `createCustomError`'s `constructCb` and skip redundant stack captures
- `constructCb` now receives a 3rd argument, `isOwnInstance`, which is `true` when the class is the leaf-most type actually being instantiated and `false` when its constructor is only running as a base-class step for a subclass further down an inheritance chain
- The internal `Error.captureStackTrace` call is now gated by the same check, so it only fires once per instance (at the leaf-most class) instead of redundantly at every level of a chain
- Lets custom error hierarchies with their own per-level stack-capture logic skip that work except at the leaf
- [#589](https://github.com/nevware21/ts-utils/pull/589) feat(errors): bind `constructCb`'s `this` to the new instance via `fnCall`
- `constructCb` is now invoked with `this` bound to the constructed instance (the same value also passed as the `self` argument), so non-arrow callbacks can use `this.prop = ...` instead of requiring the `self` argument
- `constructCb`'s type signature now declares an explicit `this: any` parameter; existing callbacks (arrow functions, or plain functions that don't declare `this`) remain unaffected

### Bug Fixes

- [#588](https://github.com/nevware21/ts-utils/pull/588) `npm run package` failed with `ERR_REQUIRE_ESM` after `magic-string` moved to an ESM-only release (v1.0.0)
- `lib/rollup.config.js`'s PURE-annotation normalization plugin now loads `magic-string` via a dynamic `import()` inside `renderChunk` instead of a static import, since `--bundleConfigAsCjs` rewrites static imports to `require()`, which throws on Node versions without `require(esm)` support (eg. Node 18)
- Added `skipLibCheck` to the main build and test `tsconfig`s (`lib/tsconfig.base.json` and `lib/test/tsconfig.*.json`) to stop external `@types/node` type errors (`IteratorObject`, `BuiltinIteratorReturn`, etc., introduced by the `@types/node` v26 bump) from leaking into the build and test compiles
- [#585](https://github.com/nevware21/ts-utils/pull/585) Add `skipLibCheck` to the TypeDoc compiler options to fix the same `@types/node` v26 type errors when generating docs

### Repository Improvements

- [#582](https://github.com/nevware21/ts-utils/pull/582) CI: switch Puppeteer loading to ESM `import()` in Karma configs (Puppeteer is ESM-only), pin Size tests to run only on Node 22, and make Codecov upload non-blocking

[Full Changelog](https://github.com/nevware21/ts-utils/compare/v0.15.0...v0.16.0)

# v0.15.0 May 29th, 2026

## Changelog
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ npm install @nevware21/ts-utils --save

**Recommended Version Specification:**
```json
"@nevware21/ts-utils": ">= 0.15.0 < 2.x"
"@nevware21/ts-utils": ">= 0.16.0 < 2.x"
```

> Note: v0.x and v1.x maintain ES5 compatibility. Future v2.x releases will update the baseline to newer ECMAScript versions.
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nevware21/ts-utils",
"description": "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 readability",
"version": "0.15.0",
"version": "0.16.0",
"homepage": "https://github.com/nevware21/ts-utils",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nevware21/ts-utils",
"description": "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 readability",
"version": "0.15.0",
"version": "0.16.0",
"homepage": "https://github.com/nevware21/ts-utils",
"license": "MIT",
"author": {
Expand Down