Skip to content

v4.0.0

Choose a tag to compare

@github-actions github-actions released this 29 May 23:46
· 83 commits to master since this release

4.0.0 (2024-05-29)

⚠ BREAKING CHANGES

  • Removed mixin and the Mixin types
  • testName was removed from library
  • If using override's first type param, it is now the second.
    Pass unknown to the first param to keep types as before.
  • root util exports now require .js extension
  • Some of the changes to walk might cause existing code to work slightly different.
  • MULTISPLICE_ITEM is no longer exported by types/index.js
  • This moves a lot of exports around, see README.
  • Minimum node version is now 20.
  • partialDeepEqual has been removed
  • walker callback is now passed the keypath as an array instead of a dot separated string
  • pushIfNotIn no longer takes in non array values
  • This requires switching to full paths for anything but the main sub exports.
  • This is technically a breaking change, though I'm not sure it was quite working before either.
  • run now returns two objects {promise, child}
  • Move to using exports in package makes this a breaking change since imports that previously worked (e.g. from /dist directly), might not work anymore.

⭐ New Features

  • removed the mixin utility (64ac233)

They were a bad idea, like trying to fit a square peg into a round hole of a language.
I refuse to ever write a library with them ever again.
BREAKING CHANGE: Removed mixin and the Mixin types

  • removed testName (90fa7e4)

    BREAKING CHANGE: testName was removed from library

  • added clampNumber utility (1a0130c)

  • added ability to pass initial array to RingBuffer (8ec746c)

  • added stage parameter to walk callback to easily tell when it's called before/after iteration (bad6b1d)

  • added RingBuffer (9fdf528)

  • added assertKeyInObjectIs utility (3ab5c83)

  • added snapNumber utility (ed8302a)

  • added changeObjectKeys utility (b51ec4b)

  • added set utility (55da7e7)

  • made walker more flexible (512309b)

  • before/after run without save:true
  • before/after run even on the root object (breaking change)
  • after correctly runs on the modified object, not the original
  • clarified res vs walkerRes in code
  • opts are now not recreated with each recursive call
  • removed need to know if we're in a recursive call
  • added better tests about object identity when using before/after
  • added better and more complex examples
    BREAKING CHANGE: Some of the changes to walk might cause existing code to work slightly different.
  • added ability to clone using walk without specifying a walker (d540257)

  • improved walk walker callback (ed227b2)

    BREAKING CHANGE: walker callback is now passed the keypath as an array instead of a dot separated string

  • added TypedError class for easily creating typed error classes (76d0974)

  • made pushIfNotIn slightly more performant for the average case (6de5711)

Usually we want to push another array, not values, and spreading is slow,
and the old way the function required spreading out arrays then internally,
it would gather them back up.

Now in the worst case we have to wrap a few values in an array and this array
isn't re-collected internally.
BREAKING CHANGE: pushIfNotIn no longer takes in non array values

  • added ExtractByValue (38df57a)

  • converted to esm only (f4fe5ce)

    BREAKING CHANGE: This is technically a breaking change, though I'm not sure it was quite working before either.

  • run - added spawn options and improved usage (d9c3a0e)

    BREAKING CHANGE: run now returns two objects {promise, child}

  • run - can now be passed array of args (357fb95)

  • added generateCopyrightNotice (c7aec7a)

  • improved run util to include stdout on errors (2811c1b)

  • improved walker with key path (5f6b691)

  • added esm support (5bec52d)

    BREAKING CHANGE: Move to using exports in package makes this a breaking change since imports that previously worked (e.g. from /dist directly), might not work anymore.

  • added isEven, isInt (6f07640)

  • added captilize, last, removeIfIn (9e4be54)

🐛 Fixes

  • fixed debounce return type, it now differentiates between function/promise/function+promisify (86c74e1)

  • added missing tsconfig in tests/ (afa8b3b)

Appears to be needed for eslint to work correctly in neovim.

  • fixed incorrect/missing exports (087c2e1)

  • run now prints entire stream as error message if stderr is blank (62cc36e)

  • this might still miss a few edge cases, but is better than logging blank
  • fixed wrong indexit version and missing exports (ee78e39)

  • disabled minification (7e55dab)

  • fix unresolved type aliases (7a2c998)

it seems we stil need the custom types plugin since dts is not compatible with tsconfigPaths

  • improved exports (2e82c28)

    BREAKING CHANGE: This requires switching to full paths for anything but the main sub exports.

  • removed babel (d92b622)

  • externalize all deps correctly (b254e71)

  • missing peer dep error when installing (02641ae)

Misunderstood babel docs. @babel/runtime should be a dependency, @babel/plugin-transform-runtime should NOT.

  • remove unneeded tsconfig settings (6fd78e4)

  • missing babel runtime imports (08971f8)

  • fix types test (3686e4c)

  • added babel transpilation back (e941e9d)

should fix support for node 14

Somehow omit was just pick??? and the options were flipped around. Must have been asleep when I wrote...

Also added ignoreNonexistent key option to pick.

📖 Documentation

  • updated expectType docs (efe38ac)

  • updated readme description (8381cf9)

  • fixed override/merge docs, they incorrectly implied deep immutability under certain conditions (0091529)

  • improved Results docs with MultipleErrors discriminated unions (13dcbe8)

  • improved readme (23dfb8f)

  • fixed incorrect get doc (8e379c3)

  • fixed docs (f0ec460)

🔗 Dependency Updates

  • updated deps + node version (edc28eb)

    BREAKING CHANGE: Minimum node version is now 20.

📦 Code Refactoring

  • changed override's first type param to be the output type for easier overriding (e3519cf)

    BREAKING CHANGE: If using override's first type param, it is now the second.
    Pass unknown to the first param to keep types as before.

  • removed automatic adding of extension in root export path (01d1731)

    BREAKING CHANGE: root util exports now require .js extension

  • moved MULTISPLICE_ITEM enum (dae861e)

  • now also exports a more convenient MultispliceItem type
    BREAKING CHANGE: MULTISPLICE_ITEM is no longer exported by types/index.js
  • changed export structure for better vite experience (7298bba)

    BREAKING CHANGE: This moves a lot of exports around, see README.

  • removed partialDeepEqual chai plugin (e9801b1)

    BREAKING CHANGE: partialDeepEqual has been removed