Comparing version 1.53.0 to 1.54.0
@@ -41,2 +41,3 @@ "use strict"; | ||
__exportStar(require("./dropWhile"), exports); | ||
__exportStar(require("./entries"), exports); | ||
__exportStar(require("./equals"), exports); | ||
@@ -58,2 +59,3 @@ __exportStar(require("./evolve"), exports); | ||
__exportStar(require("./forEachObj"), exports); | ||
__exportStar(require("./fromEntries"), exports); | ||
__exportStar(require("./fromKeys"), exports); | ||
@@ -80,3 +82,5 @@ __exportStar(require("./fromPairs"), exports); | ||
__exportStar(require("./isNonNull"), exports); | ||
__exportStar(require("./isNonNullish"), exports); | ||
__exportStar(require("./isNot"), exports); | ||
__exportStar(require("./isNullish"), exports); | ||
__exportStar(require("./isNumber"), exports); | ||
@@ -118,2 +122,3 @@ __exportStar(require("./isObject"), exports); | ||
__exportStar(require("./pipe"), exports); | ||
__exportStar(require("./piped"), exports); | ||
__exportStar(require("./prop"), exports); | ||
@@ -159,2 +164,5 @@ __exportStar(require("./purry"), exports); | ||
__exportStar(require("./uniqWith"), exports); | ||
__exportStar(require("./unique"), exports); | ||
__exportStar(require("./uniqueBy"), exports); | ||
__exportStar(require("./uniqueWith"), exports); | ||
__exportStar(require("./values"), exports); | ||
@@ -161,0 +169,0 @@ __exportStar(require("./zip"), exports); |
@@ -26,3 +26,3 @@ "use strict"; | ||
exports.omit = void 0; | ||
var fromPairs_1 = require("./fromPairs"); | ||
var fromEntries_1 = require("./fromEntries"); | ||
var hasAtLeast_1 = require("./hasAtLeast"); | ||
@@ -47,3 +47,3 @@ var purry_1 = require("./purry"); | ||
var asSet = new Set(propNames); | ||
return (0, fromPairs_1.fromPairs)(Object.entries(data).filter(function (_a) { | ||
return (0, fromEntries_1.fromEntries)(Object.entries(data).filter(function (_a) { | ||
var key = _a[0]; | ||
@@ -50,0 +50,0 @@ return !asSet.has(key); |
@@ -25,2 +25,3 @@ export * from "./add"; | ||
export * from "./dropWhile"; | ||
export * from "./entries"; | ||
export * from "./equals"; | ||
@@ -42,2 +43,3 @@ export * from "./evolve"; | ||
export * from "./forEachObj"; | ||
export * from "./fromEntries"; | ||
export * from "./fromKeys"; | ||
@@ -64,3 +66,5 @@ export * from "./fromPairs"; | ||
export * from "./isNonNull"; | ||
export * from "./isNonNullish"; | ||
export * from "./isNot"; | ||
export * from "./isNullish"; | ||
export * from "./isNumber"; | ||
@@ -102,2 +106,3 @@ export * from "./isObject"; | ||
export * from "./pipe"; | ||
export * from "./piped"; | ||
export * from "./prop"; | ||
@@ -143,2 +148,5 @@ export * from "./purry"; | ||
export * from "./uniqWith"; | ||
export * from "./unique"; | ||
export * from "./uniqueBy"; | ||
export * from "./uniqueWith"; | ||
export * from "./values"; | ||
@@ -145,0 +153,0 @@ export * from "./zip"; |
@@ -23,3 +23,3 @@ var __assign = (this && this.__assign) || function () { | ||
}; | ||
import { fromPairs } from "./fromPairs"; | ||
import { fromEntries } from "./fromEntries"; | ||
import { hasAtLeast } from "./hasAtLeast"; | ||
@@ -43,3 +43,3 @@ import { purry } from "./purry"; | ||
var asSet = new Set(propNames); | ||
return fromPairs(Object.entries(data).filter(function (_a) { | ||
return fromEntries(Object.entries(data).filter(function (_a) { | ||
var key = _a[0]; | ||
@@ -46,0 +46,0 @@ return !asSet.has(key); |
@@ -5,4 +5,3 @@ /** | ||
* | ||
* **DEPRECATED: equivalent to `R.filter(R.isTruthy)` and so will be removed in | ||
* v2**. | ||
* ! **DEPRECATED**: Use `R.filter(items, R.isTruthy)`. Will be removed in V2! | ||
* | ||
@@ -14,6 +13,6 @@ * @param items - The array to compact. | ||
* R.compact([0, 1, false, 2, '', 3]) // => [1, 2, 3] | ||
* @category Array | ||
* @deprecated Equivalent to `R.filter(R.isTruthy)` and so will be removed in v2. | ||
* @category Deprecated | ||
* @deprecated Use `R.filter(items, R.isTruthy)`. Will be removed in V2! | ||
*/ | ||
export declare function compact<T>(items: ReadonlyArray<T | "" | 0 | false | null | undefined>): Array<T>; | ||
//# sourceMappingURL=compact.d.ts.map |
@@ -5,3 +5,3 @@ import type { Pred, PredIndexed } from "./_types"; | ||
* | ||
* **DEPRECATED: equivalent to `R.filter(fn).length` and so will be removed in v2**. | ||
* ! **DEPRECATED**: Use `R.filter(items, fn).length`. Will be removed in v2! | ||
* | ||
@@ -16,6 +16,21 @@ * @param items - The input data. | ||
* @indexed | ||
* @category Array | ||
* @deprecated Equivalent to `R.filter(fn).length` and so will be removed in v2. | ||
* @category Deprecated | ||
* @deprecated Use `R.filter(items, fn).length`. Will be removed in v2. | ||
*/ | ||
export declare function countBy<T>(items: ReadonlyArray<T>, fn: Pred<T, boolean>): number; | ||
/** | ||
* Counts how many values of the collection pass the specified predicate. | ||
* | ||
* ! **DEPRECATED**: Use `<T>(items: ReadonlyArray<T>) => R.filter(items, fn).length` or if in a pipe: `R.pipe(..., R.filter(fn), R.length(), ...)`. Will be removed in v2! | ||
* | ||
* @param fn - The predicate. | ||
* @signature | ||
* R.countBy(fn)(array) | ||
* @example | ||
* R.pipe([1, 2, 3, 4, 5], R.countBy(x => x % 2 === 0)) // => 2 | ||
* @dataLast | ||
* @indexed | ||
* @category Deprecated | ||
* @deprecated Use `<T>(items: ReadonlyArray<T>) => R.filter(items, fn).length` or if in a pipe: `R.pipe(..., R.filter(fn), R.length(), ...)`. Will be removed in v2. | ||
*/ | ||
export declare function countBy<T>(fn: Pred<T, boolean>): (array: ReadonlyArray<T>) => number; | ||
@@ -26,5 +41,7 @@ export declare namespace countBy { | ||
* | ||
* ! **DEPRECATED**: Use `R.filter.indexed(items, fn).length`. Will be removed in v2! | ||
* | ||
* @example | ||
* R.pipe([1, 2, 3, 4, 5], R.countBy(x => x % 2 === 0)) // => 2 | ||
* @deprecated Equivalent to `R.filter.indexed(fn).length` and so will be removed in v2. | ||
* @deprecated Use `R.filter.indexed(items, fn).length`. Will be removed in v2. | ||
*/ | ||
@@ -35,5 +52,7 @@ function indexed<T>(array: ReadonlyArray<T>, fn: PredIndexed<T, boolean>): number; | ||
* | ||
* ! **DEPRECATED**: Use `<T>(items: ReadonlyArray<T>) => R.filter.indexed(items, fn).length` or if in a pipe: `R.pipe(..., R.filter.indexed(fn), R.length(), ...)`. Will be removed in v2! | ||
* | ||
* @example | ||
* R.pipe([1, 2, 3, 4, 5], R.countBy(x => x % 2 === 0)) // => 2 | ||
* @deprecated Equivalent to `R.filter.indexed(fn).length` and so will be removed in v2. | ||
* @deprecated Use `<T>(items: ReadonlyArray<T>) => R.filter.indexed(items, fn).length` or if in a pipe: `R.pipe(..., R.filter.indexed(fn), R.length(), ...)`. Will be removed in v2. | ||
*/ | ||
@@ -40,0 +59,0 @@ function indexed<T>(fn: PredIndexed<T, boolean>): (array: ReadonlyArray<T>) => number; |
/** | ||
* Creates a data-last pipe function. First function must be always annotated. Other functions are automatically inferred. | ||
* | ||
* ! **DEPRECATED**: Use `R.piped(op1, op2, op3)`. Will be removed in V2! | ||
* | ||
* @signature | ||
@@ -11,3 +13,4 @@ * R.createPipe(op1, op2, op3)(data); | ||
* )(1) // => 6 | ||
* @category Function | ||
* @category Deprecated | ||
* @deprecated Use `R.piped(op1, op2, op3)`. Will be removed in V2! | ||
*/ | ||
@@ -14,0 +17,0 @@ export declare function createPipe<A, B>(op1: (input: A) => B): (value: A) => B; |
@@ -5,4 +5,3 @@ import type { LazyEvaluator } from "./pipe"; | ||
* | ||
* **DEPRECATED: equivalent to `R.filter(array, R.isNot(R.isIncludedIn(other)))` | ||
* and will be removed in v2.**. | ||
* ! **DEPRECATED**: Use `R.filter(array, R.isNot(R.isIncludedIn(other)))`. Will be removed in v2! | ||
* | ||
@@ -17,4 +16,4 @@ * @param array - The source array. | ||
* @pipeable | ||
* @category Array | ||
* @deprecated Equivalent to `R.filter(array, R.isNot(R.isIncludedIn(other)))` and will be removed in v2. | ||
* @category Deprecated | ||
* @deprecated Use `R.filter(array, R.isNot(R.isIncludedIn(other)))`. Will be removed in v2. | ||
*/ | ||
@@ -25,4 +24,3 @@ export declare function difference<T>(array: ReadonlyArray<T>, other: ReadonlyArray<T>): Array<T>; | ||
* | ||
* **DEPRECATED: equivalent to `R.filter(R.isNot(R.isIncludedIn(other)))` and | ||
* will be removed in v2.**. | ||
* ! **DEPRECATED**: Use `R.filter(R.isNot(R.isIncludedIn(other)))`. Will be removed in v2! | ||
* | ||
@@ -41,4 +39,4 @@ * @param other - The values to exclude. | ||
* @pipeable | ||
* @category Array | ||
* @deprecated Equivalent to `R.filter(R.isNot(R.isIncludedIn(other)))` and will be removed in v2. | ||
* @category Deprecated | ||
* @deprecated Use `R.filter(R.isNot(R.isIncludedIn(other)))`. Will be removed in v2. | ||
*/ | ||
@@ -45,0 +43,0 @@ export declare function difference<T, K>(other: ReadonlyArray<T>): (array: ReadonlyArray<K>) => Array<T>; |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* **DEPRECATED: use R.isDeepEqual().**. | ||
* ! **DEPRECATED**: Use `R.isDeepEqual(a, b)`. Will be removed in V2. | ||
* | ||
@@ -17,4 +17,4 @@ * @param a - The first object to compare. | ||
* @dataFirst | ||
* @category Object | ||
* @deprecated Use `R.isDeepEqual`. | ||
* @category Deprecated | ||
* @deprecated Use `R.isDeepEqual(a, b)`. Will be removed in V2. | ||
*/ | ||
@@ -26,3 +26,3 @@ export declare function equals(a: unknown, b: unknown): boolean; | ||
* | ||
* **DEPRECATED: use R.isDeepEqual().**. | ||
* ! **DEPRECATED**: Use `R.isDeepEqual(b)`. Will be removed in V2. | ||
* | ||
@@ -38,6 +38,6 @@ * @param a - The first object to compare. | ||
* @dataLast | ||
* @category Object | ||
* @deprecated Use `R.isDeepEqual`. | ||
* @category Deprecated | ||
* @deprecated Use `R.isDeepEqual(b)`. Will be removed in V2. | ||
*/ | ||
export declare function equals(a: unknown): (b: unknown) => boolean; | ||
//# sourceMappingURL=equals.d.ts.map |
/** | ||
* Map each element of an array into an object using a defined callback function and flatten the result. | ||
* | ||
* ! **DEPRECATED**: Use `R.fromEntries.strict(R.flatMap(array, fn))`. Will be removed in V2! | ||
* | ||
* @param array - The array to map. | ||
@@ -20,3 +22,4 @@ * @param fn - The mapping function, which should return an Array of key-value pairs, similar to Object.fromEntries. | ||
* @indexed | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.fromEntries.strict(R.flatMap(array, fn))`. Will be removed in V2! | ||
*/ | ||
@@ -27,2 +30,4 @@ export declare function flatMapToObj<T, K extends PropertyKey, V>(array: ReadonlyArray<T>, fn: (element: T) => Array<[K, V]>): Record<K, V>; | ||
* | ||
* ! **DEPRECATED**: Use `(array: ReadonlyArray<T>) => R.fromEntries.strict(R.flatMap(array, fn))` or if used in a pipe: `pipe(..., R.flatMap(fn), R.fromEntries.strict(), ...)`. Will be removed in V2! | ||
* | ||
* @param fn - The mapping function, which should return an Array of key-value pairs, similar to Object.fromEntries. | ||
@@ -47,9 +52,16 @@ * @returns The new mapped object. | ||
* @indexed | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `(array: ReadonlyArray<T>) => R.fromEntries.strict(R.flatMap(array, fn))` or if used in a pipe: `pipe(..., R.flatMap(fn), R.fromEntries.strict(), ...)`. Will be removed in V2! | ||
*/ | ||
export declare function flatMapToObj<T, K extends PropertyKey, V>(fn: (element: T) => Array<[K, V]>): (array: ReadonlyArray<T>) => Record<K, V>; | ||
export declare namespace flatMapToObj { | ||
/** | ||
* @deprecated Use `R.fromEntries.strict(R.flatten(R.map.indexed(array, fn)))`. Will be removed in V2! | ||
*/ | ||
function indexed<T, K extends PropertyKey, V>(array: ReadonlyArray<T>, fn: (element: T, index: number, array: ReadonlyArray<T>) => Array<[K, V]>): Record<K, V>; | ||
/** | ||
* @deprecated Use `(array: ReadonlyArray<T>) => R.fromEntries.strict(R.flatten(R.map.indexed(array, fn)))` or if used in a pipe: `pipe(..., R.map.indexed(fn), R.flatten(), R.fromEntries.strict(), ...)`. Will be removed in V2! | ||
*/ | ||
function indexed<T, K extends PropertyKey, V>(fn: (element: T, index: number, array: ReadonlyArray<T>) => Array<[K, V]>): (array: ReadonlyArray<T>) => Record<K, V>; | ||
} | ||
//# sourceMappingURL=flatMapToObj.d.ts.map |
@@ -14,2 +14,4 @@ import type { IterableContainer } from "./_types"; | ||
* | ||
* ! **DEPRECATED**: Use `R.fromEntries(pairs)`, for dataLast invocations use the functional form `R.fromEntries()`. Will be removed in V2! | ||
* | ||
* @param pairs - The list of input tuples. | ||
@@ -32,3 +34,4 @@ * @signature | ||
* @strict | ||
* @category Object | ||
* @category Deprecated | ||
* @deprecated Use `R.fromEntries(pairs)`, for dataLast invocations use the functional form `R.fromEntries()`. Will be removed in V2! | ||
*/ | ||
@@ -47,2 +50,5 @@ export declare function fromPairs<V>(pairs: ReadonlyArray<Entry<number, V>>): Record<number, V>; | ||
export declare namespace fromPairs { | ||
/** | ||
* @deprecated Use `R.fromEntries.strict(pairs)`, for dataLast invocations use the functional form `R.fromEntries.strict()`. Will be removed in V2! | ||
*/ | ||
const strict: Strict; | ||
@@ -49,0 +55,0 @@ } |
@@ -25,2 +25,3 @@ export * from "./add"; | ||
export * from "./dropWhile"; | ||
export * from "./entries"; | ||
export * from "./equals"; | ||
@@ -42,2 +43,3 @@ export * from "./evolve"; | ||
export * from "./forEachObj"; | ||
export * from "./fromEntries"; | ||
export * from "./fromKeys"; | ||
@@ -64,3 +66,5 @@ export * from "./fromPairs"; | ||
export * from "./isNonNull"; | ||
export * from "./isNonNullish"; | ||
export * from "./isNot"; | ||
export * from "./isNullish"; | ||
export * from "./isNumber"; | ||
@@ -102,2 +106,3 @@ export * from "./isObject"; | ||
export * from "./pipe"; | ||
export * from "./piped"; | ||
export * from "./prop"; | ||
@@ -143,2 +148,5 @@ export * from "./purry"; | ||
export * from "./uniqWith"; | ||
export * from "./unique"; | ||
export * from "./uniqueBy"; | ||
export * from "./uniqueWith"; | ||
export * from "./values"; | ||
@@ -145,0 +153,0 @@ export * from "./zip"; |
@@ -5,4 +5,3 @@ import type { LazyEvaluator } from "./pipe"; | ||
* | ||
* **DEPRECATED: equivalent to `R.filter(array, R.isIncludedIn(other))` and will | ||
* be removed in v2.**. | ||
* ! **DEPRECATED**: Use `R.filter(array, R.isIncludedIn(other))`. Will be removed in v2! | ||
* | ||
@@ -17,4 +16,4 @@ * @param array - The source array. | ||
* @pipeable | ||
* @category Array | ||
* @deprecated Equivalent to `R.filter(array, R.isIncludedIn(other))` and will be removed in v2. | ||
* @category Deprecated | ||
* @deprecated Use `R.filter(array, R.isIncludedIn(other))`. Will be removed in v2. | ||
*/ | ||
@@ -25,4 +24,3 @@ export declare function intersection<T>(source: ReadonlyArray<T>, other: ReadonlyArray<T>): Array<T>; | ||
* | ||
* **DEPRECATED: equivalent to `R.filter(R.isIncludedIn(other))` and will be | ||
* removed in v2.**. | ||
* ! **DEPRECATED**: Use `R.filter(R.isIncludedIn(other))`. Will be removed in v2! | ||
* | ||
@@ -37,4 +35,4 @@ * @param array - The source array. | ||
* @pipeable | ||
* @category Array | ||
* @deprecated Equivalent to `R.filter(R.isIncludedIn(other))` and will be removed in v2. | ||
* @category Deprecated | ||
* @deprecated Use `R.filter(R.isIncludedIn(other))`. Will be removed in v2. | ||
*/ | ||
@@ -41,0 +39,0 @@ export declare function intersection<T, K>(other: ReadonlyArray<T>): (source: ReadonlyArray<K>) => Array<T>; |
/** | ||
* A function that checks if the passed parameter is defined and narrows its type accordingly. | ||
* To test specifically for `undefined` (and not `null`) use the strict variant of this function. | ||
* A function that checks if the passed parameter is defined and narrows its | ||
* type accordingly. To test specifically for `undefined` (and not `null`) use | ||
* the strict variant of this function. | ||
* | ||
* ! **DEPRECATED**: If your type accepts `null` use `R.isNullish(data)`, otherwise prefer `R.isDefined.strict(data)`. The **non-strict** version will be removed in V2! | ||
* | ||
* @param data - The variable to check. | ||
@@ -18,2 +21,3 @@ * @returns True if the passed input is defined, false otherwise. | ||
* @category Guard | ||
* @deprecated If your type accepts `null` use `R.isNullish(data)`, otherwise prefer `R.isDefined.strict(data)`. The **non-strict** version will be removed in V2! | ||
*/ | ||
@@ -20,0 +24,0 @@ export declare function isDefined<T>(data: T): data is NonNullable<T>; |
/** | ||
* A function that checks if the passed parameter is Nil (null or undefined) and narrows its type accordingly. | ||
* | ||
* ! **DEPRECATED**: Use `R.isNullish(data)`. Will be removed in V2! | ||
* | ||
* @param data - The variable to check. | ||
@@ -12,5 +14,6 @@ * @returns True if the passed input is Nil (null or undefined), false otherwise. | ||
* R.isNil('somethingElse') //=> false | ||
* @category Guard | ||
* @category Deprecated | ||
* @deprecated Use `R.isNullish(data)`. Will be removed in V2! | ||
*/ | ||
export declare function isNil<T>(data: T): data is Extract<T, null | undefined>; | ||
//# sourceMappingURL=isNil.d.ts.map |
@@ -5,3 +5,3 @@ type DefinitelyObject<T> = Exclude<Extract<T, object>, Array<any> | Function | ReadonlyArray<any>> extends never ? Record<string, unknown> : Exclude<Extract<T, object>, Array<any> | Function | ReadonlyArray<any>>; | ||
* | ||
* ! **DEPRECATED: The semantics of this guard are confusing. It excludes Arrays but does not exclude other complex objects like Classes or built-in objects (such as Date, Promise, Error, etc.). Instead, consider using `isObjectType` for a more inclusive validation encompassing any JavaScript "object" type, or `isPlainObject` for a more specific validation targeting simple struct/shape/record-like objects. To replicate the existing logic, use: `const isObject = (x) => isObjectType(x) && !Array.isArray(x)`.** ! | ||
* ! **DEPRECATED**: Use: `R.isObjectType(data) && R.isNonNull(data) && !R.isArray(data)` or `R.isPlainObject(data)`. Will be removed in V2! | ||
* | ||
@@ -18,4 +18,4 @@ * @param data - The variable to check. | ||
* R.isObject('somethingElse') //=> false | ||
* @category Guard | ||
* @deprecated - The semantics of this guard are confusing. It excludes Arrays but does not exclude other complex objects like Classes or built-in objects (such as Date, Promise, Error, etc.). Instead, consider using `isObjectType` for a more inclusive validation encompassing any JavaScript "object" type, or `isPlainObject` for a more specific validation targeting simple struct/shape/record-like objects. To replicate the existing logic, use: `const isObject = (x) => isObjectType(x) && !Array.isArray(x)`. | ||
* @category Deprecated | ||
* @deprecated Use: `R.isObjectType(data) && R.isNonNull(data) && !R.isArray(data)` or `R.isPlainObject(data)`. Will be removed in V2! | ||
*/ | ||
@@ -22,0 +22,0 @@ export declare function isObject<T>(data: T | object): data is DefinitelyObject<T>; |
@@ -5,3 +5,3 @@ import type { PredIndexed } from "./_types"; | ||
* | ||
* If you need more control over how "max" is defined, consider using `firstBy` instead. `maxBy` might be deprecated in the future! | ||
* ! **DEPRECATED**: Use `R.firstBy([fn, "desc"])`. Will be removed in V2! | ||
* | ||
@@ -19,3 +19,4 @@ * @param fn - The predicate. | ||
* @indexed | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.firstBy([fn, "desc"])`. Will be removed in V2! | ||
*/ | ||
@@ -26,2 +27,4 @@ export declare function maxBy<T>(fn: (item: T) => number): (items: ReadonlyArray<T>) => T | undefined; | ||
* | ||
* ! **DEPRECATED**: Use `R.firstBy(items, fn)`. Will be removed in V2! | ||
* | ||
* @param items - The array. | ||
@@ -39,3 +42,4 @@ * @param fn - The predicate. | ||
* @indexed | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.firstBy(items, [fn, "desc"])`. Will be removed in V2! | ||
*/ | ||
@@ -42,0 +46,0 @@ export declare function maxBy<T>(items: ReadonlyArray<T>, fn: (item: T) => number): T | undefined; |
@@ -5,3 +5,3 @@ import type { PredIndexed } from "./_types"; | ||
* | ||
* If you need more control over how "min" is defined, consider using `firstBy` instead. `minBy` might be deprecated in the future! | ||
* ! **DEPRECATED**: Use `R.firstBy(fn)`. Will be removed in V2! | ||
* | ||
@@ -19,3 +19,4 @@ * @param fn - The predicate. | ||
* @indexed | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.firstBy(fn)`. Will be removed in V2! | ||
*/ | ||
@@ -26,2 +27,4 @@ export declare function minBy<T>(fn: (item: T) => number): (items: ReadonlyArray<T>) => T | undefined; | ||
* | ||
* ! **DEPRECATED**: Use `R.firstBy(items, fn)`. Will be removed in V2! | ||
* | ||
* @param items - The array. | ||
@@ -39,3 +42,4 @@ * @param fn - The predicate. | ||
* @indexed | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.firstBy(items, fn)`. Will be removed in V2! | ||
*/ | ||
@@ -42,0 +46,0 @@ export declare function minBy<T>(items: ReadonlyArray<T>, fn: (item: T) => number): T | undefined; |
/** | ||
* Returns a partial copy of an object omitting the keys specified. | ||
* | ||
* @param data - The object. | ||
* @param propNames - The property names. | ||
@@ -6,0 +5,0 @@ * @signature |
@@ -6,2 +6,4 @@ import type { Pred, PredIndexed, PredIndexedOptional } from "./_types"; | ||
* | ||
* ! **DEPRECATED**: Use `R.filter(items, R.isNot(fn))`. Will be removed in V2! | ||
* | ||
* @param items - The array to reject. | ||
@@ -18,3 +20,4 @@ * @param fn - The callback function. | ||
* @pipeable | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.filter(items, R.isNot(fn))`. Will be removed in V2! | ||
*/ | ||
@@ -25,2 +28,4 @@ export declare function reject<T>(items: ReadonlyArray<T>, fn: Pred<T, boolean>): Array<T>; | ||
* | ||
* ! **DEPRECATED**: Use `R.filter(R.isNot(fn))`. Will be removed in V2! | ||
* | ||
* @param items - The array to reject. | ||
@@ -37,7 +42,14 @@ * @param fn - The callback function. | ||
* @pipeable | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.filter(R.isNot(fn))`. Will be removed in V2! | ||
*/ | ||
export declare function reject<T>(fn: Pred<T, boolean>): (items: ReadonlyArray<T>) => Array<T>; | ||
export declare namespace reject { | ||
/** | ||
* @deprecated Use `R.filter.indexed(items, (item, index, array) => !fn(item, index, array))`. Will be removed in V2! | ||
*/ | ||
function indexed<T, K>(array: ReadonlyArray<T>, fn: PredIndexed<T, boolean>): Array<K>; | ||
/** | ||
* @deprecated Use `R.filter.indexed((item, index, array) => !fn(item, index, array))`. Will be removed in V2! | ||
*/ | ||
function indexed<T, K>(fn: PredIndexed<T, boolean>): (array: ReadonlyArray<T>) => Array<K>; | ||
@@ -44,0 +56,0 @@ const lazy: <T>(fn: PredIndexedOptional<T, boolean>) => LazyEvaluator<T>; |
/** | ||
* Returns an array of key/values of the enumerable properties of an object. | ||
* | ||
* ! **DEPRECATED** Use `R.entries(object)`, for dataLast invocations use the functional form `R.entries()`. Will be removed in V2! | ||
* | ||
* @param object - Object to return keys and values of. | ||
@@ -21,3 +23,4 @@ * @signature | ||
* @strict | ||
* @category Object | ||
* @category Deprecated | ||
* @deprecated Use `R.entries(object)`, for dataLast invocations use the functional form `R.entries()`. Will be removed in V2! | ||
*/ | ||
@@ -30,2 +33,5 @@ export declare function toPairs<T>(object: Readonly<Record<string, T>>): Array<[string, T]>; | ||
export declare namespace toPairs { | ||
/** | ||
* @deprecated Use `R.entries.strict(object)`, for dataLast invocations use the functional form `R.entries.strict(object)`. Will be removed in V2! | ||
*/ | ||
const strict: Strict; | ||
@@ -32,0 +38,0 @@ } |
/** | ||
* Gives a single-word string description of the (native) type of a value, returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not attempt to distinguish user Object types any further, reporting them all as 'Object'. | ||
* | ||
* ! **DEPRECATED**: Use `typeof val`, or one of the guards offered by this library. Will be removed in V2! We don't know what the use case for this function is. If you have a use case reach out via a GitHub issue so we can discuss this. | ||
* | ||
* @param val - Value to return type of. | ||
@@ -17,5 +19,6 @@ * @signature | ||
* R.type(undefined); //=> "Undefined" | ||
* @category Type | ||
* @category Deprecated | ||
* @deprecated Use `typeof val`, or one of the guards offered by this library. Will be removed in V2! We don't know what the use case for this function is. If you have a use case reach out via a GitHub issue so we can discuss this. | ||
*/ | ||
export declare function type(val: unknown): string; | ||
//# sourceMappingURL=type.d.ts.map |
@@ -6,2 +6,4 @@ import type { LazyEvaluator } from "./pipe"; | ||
* | ||
* ! **DEPRECATED**: Use `R.unique(array)`. Will be removed in V2. | ||
* | ||
* @param array - The array to filter. | ||
@@ -14,3 +16,4 @@ * @signature | ||
* @pipeable | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.unique(array)`. Will be removed in V2. | ||
*/ | ||
@@ -22,2 +25,4 @@ export declare function uniq<T>(array: ReadonlyArray<T>): Array<T>; | ||
* | ||
* ! **DEPRECATED**: Use `R.unique()`. Will be removed in V2. | ||
* | ||
* @param array - The array to filter. | ||
@@ -34,3 +39,4 @@ * @signature | ||
* @pipeable | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.unique()`. Will be removed in V2. | ||
*/ | ||
@@ -37,0 +43,0 @@ export declare function uniq<T>(): (array: ReadonlyArray<T>) => Array<T>; |
@@ -1,2 +0,1 @@ | ||
export declare function uniqBy<T, K>(array: ReadonlyArray<T>, transformer: (item: T) => K): Array<T>; | ||
/** | ||
@@ -6,3 +5,6 @@ * Returns a new array containing only one copy of each element in the original list transformed by a function. | ||
* | ||
* @param array | ||
* ! **DEPRECATED**: Use `R.uniqueBy(array, fn)`. Will be removed in V2! | ||
* | ||
* @param array - The array to filter. | ||
* @param transformer | ||
* @signature | ||
@@ -15,2 +17,19 @@ * R.uniqBy(array, fn) | ||
* ) // => [{n: 1}, {n: 2}, {n: 5}, {n: 6}, {n: 7}] | ||
* @dataFirst | ||
* @pipeable | ||
* @category Deprecated | ||
* @deprecated Use `R.uniqueBy(array, fn)`. Will be removed in V2! | ||
*/ | ||
export declare function uniqBy<T, K>(array: ReadonlyArray<T>, transformer: (item: T) => K): Array<T>; | ||
/** | ||
* Returns a new array containing only one copy of each element in the original list transformed by a function. | ||
* Elements are compared by reference using Set. | ||
* | ||
* ! **DEPRECATED**: Use `R.uniqueBy(fn)`. Will be removed in V2! | ||
* | ||
* @param array - The array to filter. | ||
* @param transformer | ||
* @signature | ||
* R.uniqBy(fn)(array) | ||
* @example | ||
* R.pipe( | ||
@@ -21,6 +40,8 @@ * [{n: 1}, {n: 2}, {n: 2}, {n: 5}, {n: 1}, {n: 6}, {n: 7}], // only 4 iterations | ||
* ) // => [{n: 1}, {n: 2}, {n: 5}] | ||
* @dataLast | ||
* @pipeable | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.uniqueBy(fn)`. Will be removed in V2! | ||
*/ | ||
export declare function uniqBy<T, K>(transformer: (item: T) => K): (array: ReadonlyArray<T>) => Array<T>; | ||
//# sourceMappingURL=uniqBy.d.ts.map |
@@ -7,2 +7,4 @@ import type { LazyEvaluator } from "./pipe"; | ||
* | ||
* ! **DEPRECATED**: Use `R.uniqueWith(array, isEquals)`. Will be removed in V2! | ||
* | ||
* @param array - The array to filter. | ||
@@ -18,3 +20,4 @@ * @param isEquals - The comparator. | ||
* @dataFirst | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.uniqueWith(array, isEquals)`. Will be removed in V2! | ||
*/ | ||
@@ -26,2 +29,4 @@ export declare function uniqWith<T>(array: ReadonlyArray<T>, isEquals: IsEquals<T>): Array<T>; | ||
* | ||
* ! **DEPRECATED**: Use `R.uniqueWith(isEquals)`. Will be removed in V2! | ||
* | ||
* @param isEquals - The comparator. | ||
@@ -39,3 +44,4 @@ * @signature R.uniqWith(isEquals)(array) | ||
* @dataLast | ||
* @category Object | ||
* @category Deprecated | ||
* @deprecated Use `R.uniqueWith(isEquals)`. Will be removed in V2! | ||
*/ | ||
@@ -42,0 +48,0 @@ export declare function uniqWith<T>(isEquals: IsEquals<T>): (array: ReadonlyArray<T>) => Array<T>; |
@@ -5,2 +5,4 @@ /** | ||
* | ||
* ! **DEPRECATED**: Use `R.fromEntries.strict(R.zip(first, second))`. Will be removed in V2! | ||
* | ||
* @param first - The first input list. | ||
@@ -13,3 +15,4 @@ * @param second - The second input list. | ||
* @dataFirst | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `R.fromEntries.strict(R.zip(first, second))`. Will be removed in V2! | ||
*/ | ||
@@ -21,2 +24,4 @@ export declare function zipObj<F extends PropertyKey, S>(first: ReadonlyArray<F>, second: ReadonlyArray<S>): Record<F, S>; | ||
* | ||
* ! **DEPRECATED**: Use `<F extends PropertyKey>(first: ReadonlyArray<F>) => R.fromEntries.strict(R.zip(first, second))` or if as part of a pipe: `R.pipe(..., R.zip(second), R.fromEntries.strict(), ...)`. Will be removed in V2! | ||
* | ||
* @param second - The second input list. | ||
@@ -28,5 +33,6 @@ * @signature | ||
* @dataLast | ||
* @category Array | ||
* @category Deprecated | ||
* @deprecated Use `<F extends PropertyKey>(first: ReadonlyArray<F>) => R.fromEntries.strict(R.zip(first, second))` or if as part of a pipe: `R.pipe(..., R.zip(second), R.fromEntries.strict(), ...)`. Will be removed in V2! | ||
*/ | ||
export declare function zipObj<S>(second: ReadonlyArray<S>): <F extends PropertyKey>(first: ReadonlyArray<F>) => Record<F, S>; | ||
//# sourceMappingURL=zipObj.d.ts.map |
{ | ||
"name": "remeda", | ||
"version": "1.53.0", | ||
"version": "1.54.0", | ||
"description": "A utility library for JavaScript and Typescript.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -100,3 +100,3 @@ # Remeda | ||
Many functions support lazy evaluation when using `pipe` or `createPipe`. These functions have a `pipeable` tag in the documentation. | ||
Many functions support lazy evaluation when using `pipe` or `piped`. These functions have a `pipeable` tag in the documentation. | ||
Lazy evaluation is not supported in Ramda and only partially supported in lodash. | ||
@@ -149,3 +149,3 @@ | ||
1. The usage must be programmer friendly, and that's more important than following XYZ paradigm strictly. | ||
2. Manual annotation should never be required, and proper typings should infer everything. The only exception is the first function in `createPipe`. | ||
2. Manual annotation should never be required, and proper typings should infer everything. The only exception is the first function in `piped`. | ||
3. ES6 polyfill is required. Core methods are reused, and data structure (like Map/Set) are not re-implemented. | ||
@@ -152,0 +152,0 @@ 4. The implementation of each function should be as minimal as possible. Tree-shaking is supported by default. (Do you know that `lodash.keyBy` has 14KB after minification?) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
602745
691
12302