Ensured Node.js 18 support.
deepClone
typings have become more strict due to the goal to remove any
.
Thus, this helper does not expect any
anymore.
Instead it expects boolean | number | bigint | string | undefined | null | Date
, or array of them, or an object with values of these types.
The array and theh object may be nested.
We believe that this is not a breaking change, because this change makes types more correct and more close to the implementation.
It means that if your code does not satisfy the types of deepClone
, you're probably not using it right.
Nevertheless, we've deprecated deepClone
due to existence of structuredClone
.
Now formatNumberString
& formatPhoneNumberString
accept not only numbers, but strings.
Added flag formatThousands
to formatNumberString helper, which forces the helper to format numbers from 1000 to 9999.
Added sleep.
Fixed enableBodyScroll behavior while restoring the previously scrolled position.
Now it tries to ignore scroll-behavior: smooth
on the root node, and jumps instead of smoothly scrolling.
Fixed export of shuffle -_-"
Added shuffle.
Fixed cookieStringToObject handling empty string passed.
Fixed export of cookieStringToObject -_-"
Added cookieStringToObject.
Added bold
mode to colorize.
Fixed pick export.
Added capitalize.
Fixed several security vulnerabilities:
-
Use of a Broken or Risky Cryptographic Algorithm in elliptic. Updated from 6.5.3 to 6.5.4.
-
Regular Expression Denial of Service in hosted-git-info. Updated from 2.8.8 to 2.8.9.
-
Command Injection in lodash. Updated from 4.17.20 to 4.17.21.
Support arrays of primitive types in objectToQueryString.
Replaced plain space by non-breaking space in formatPhoneNumberString.
Changed behavior of enableBodyScroll & disableBodyScroll.
Now they set and clear width: 100%
, because otherwise page width may change because of position: fixed
.
Added formatBytes.
Deprecated getObjectPath. Please use optional chaining instead.
Improved type declarations for pick and omit.
Added pick.
Fixed colorize to wrap only provided string.
Fixed negative numbers handle in getPlural.
Added dim
and reset
colors to colorize.
Removed tslib from dependencies.
Added base64ToUint8Array.
Added findLast.
The package was renamed to @funboxteam/diamonds
and published on Github.
Removed mock-settings.ts
.
Rewrote the lib to TypeScript.
Removed deepFlatten
& getHostnameFromString
.
Added CommonJS version for scripts to make it possible to use them in Node.js env.
To make it work we had to change isMobile notation. For now this helpers exports a function that returns value, not the value itself.
Added functions for ruling mocks settings using ci-mode=dev
cookie,
which is checked, set or removed for the special domain.
Added get-image-orientation.
storage
export was fixed.
Added storage.
Added getDisplayName.
Added sideEffects: false
into package.json to enable webpack's tree shaking.
Added queryStringToObject.
Added Babel, prepared the package for publishing to npm.
Also renamed the package into @funboxteam/helpers.
Renamed the package into @funboxteam/snippets.
Initial version.