toolbox
toolbox copied to clipboard
A zero-dependency 📦 tree-shakable🌲 collection of missing JavaScript utilities.
ref-to: #58 issue to bind only arguments without `this` argument include: - implement (partial) - tests (partial) - JSDoc (partial)
### Function Signature ```typescript declare global { export interface Function { bindArgs(this: T, ...args: A): OmitThisParameter; } } ``` ### Motivation With the `bind` method, we must pass `thisArg` as...
This PR adds replace function
### Describe the bug The `isNull` guard is not working for the nested nullable chain. ### Expected behavior The following code should compile with the `--strict` flag. ```typescript function f(x:...
### Function Signature ```JavaScript const minuteFormat = (value) => { const minutes = Math.trunc(value / 60); const seconds = value % 60; return `${minutes < 10 ? `0${minutes}` : minutes}:${seconds...
### Function Signature ```JavaScript const getUrlParams = () => { const pl = /\+/g; const search = /([^&=]+)=?([^&]*)/g; const decode = (s) => { return decodeURIComponent(s.replace(pl, " ")); }; const...
The `once` function was caching error states - when the wrapped function threw on first invocation, subsequent calls returned `undefined` instead of retrying. This differs from standard `once` semantics where...
### Function Signature function once any>(fn: T): T; ### Motivation once restricts a function to be invoked only once. Subsequent calls return the cached result: ```ts const initialize = once(()...
https://the-guild.dev/blog/nextra-4#nextra-theme-docs-changes