网页 综合 更新时间 2026-11-14 16:26:40

compat - @es-toolkit/es-toolkit - JSR

自动蜘蛛 jsr.io 正文约 4102 字
compat - @es-toolkit/es-toolkit - JSR
A modern JavaScript utility library that's 2-3 times faster and up to 97% smaller—a major upgrade to lodash.
es-toolkit/compat will offer complete compatibility with lodash, ensuring a seamless transition.
To guarantee identical behavior, es-toolkit/compat will be thoroughly tested using actual lodash test cases.
The primary goal of es-toolkit/compat is to serve as a drop-in replacement for lodash.
It's important to note that while es-toolkit/compat will mirror the behavior of lodash functions with 100% accuracy, it will deliberately omit unsafe features, such as:
Adds two numbers while safely handling NaN values.
The opposite of _.before; this method creates a function that invokes func once it's called n or more times.
Creates a function that invokes func, with up to n arguments, ignoring any additional arguments. If n is not provided, it defaults to the function's length.
Assigns properties from one source object to a target object.
Assigns own and inherited properties from one source object to a target object.
Assigns own and inherited properties from one source object to a target object.
Assigns own and inherited properties from one source object to a target object using a customizer function.
Assigns own and inherited properties from one source object to a target object using a customizer function.
Assigns own properties from one source object to a target object using a customizer function.
Gets values at given paths from a dictionary or numeric dictionary.
Attempts to execute a function with the provided arguments. If the function throws an error, it catches the error and returns it. If the caught error is not an instance of Error, it wraps it in a new Error.
Creates a function that invokes func, with the this binding and arguments of the created function, while it's called less than n times. Subsequent calls to the created function return the result of the last func invocation.
Creates a function that invokes func with the this binding of thisArg and partials prepended to the arguments it receives.
Binds methods of an object to the object itself, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names.
Creates a function that invokes the method at object[key] with partialArgs prepended to the arguments it receives.
Converts a string to camel case.
Converts the first character of string to upper case and the remaining to lower case.
Casts value as an array if it's not one.
Computes number rounded up to precision.
Splits an array into smaller arrays of a specified length.
Clamps a number within the specified bounds.
Creates a shallow clone of the given object.
Creates a deep clone of the given object.
Creates a deep clone of the given value using a customizer function.
Creates a shallow clone of a value with customizer that returns a specific result type.
Removes falsey values (false, null, 0, 0n, '', undefined, NaN) from an array.
Concatenates multiple arrays and values into a single array.
Creates a function that checks conditions one by one and runs the matching function.
Creates a function that invokes the predicate properties of source with the corresponding property values of a given object, returning true if all predicates return truthy, else false.
Checks if object conforms to source by invoking the predicate properties of source with the corresponding property values of object.
Creates a new function that always returns value.
Creates an object composed of keys generated from the results of running each element of collection through iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The iteratee is invoked with one argument: (value).
Creates an object that inherits from the prototype object.
Creates a curried function that accepts a single argument.
Creates a debounced function that delays invoking the provided function until after debounceMs milliseconds have elapsed since the last time the debounced function was invoked. The debounced function also has a cancel method to cancel any pending execution.
访问原文 返回搜索 https://jsr.io/@es-toolkit/es-toolkit/doc/compat/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。