Initial commit
This commit is contained in:
commit
b3a51a4115
10336 changed files with 2381973 additions and 0 deletions
1
node_modules/remeda/dist/dropLastWhile.cjs.map
generated
vendored
Normal file
1
node_modules/remeda/dist/dropLastWhile.cjs.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"dropLastWhile.cjs","names":["purry"],"sources":["../src/dropLastWhile.ts"],"sourcesContent":["import type { IterableContainer } from \"./internal/types/IterableContainer\";\nimport { purry } from \"./purry\";\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * R.dropLastWhile(data, predicate)\n * @example\n * R.dropLastWhile([1, 2, 10, 3, 4], x => x < 10) // => [1, 2, 10]\n * @dataFirst\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): T[number][];\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * R.dropLastWhile(predicate)(data)\n * @example\n * R.pipe([1, 2, 10, 3, 4], R.dropLastWhile(x => x < 10)) // => [1, 2, 10]\n * @dataLast\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => T[number][];\n\nexport function dropLastWhile(...args: readonly unknown[]): unknown {\n return purry(dropLastWhileImplementation, args);\n}\n\nfunction dropLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): T[number][] {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(0, i + 1);\n }\n }\n return [];\n}\n"],"mappings":"wCAuCA,SAAgB,EAAc,GAAG,EAAmC,CAClE,OAAOA,EAAAA,EAAM,EAA6B,EAAK,CAGjD,SAAS,EACP,EACA,EACa,CACb,IAAK,IAAI,EAAI,EAAK,OAAS,EAAG,GAAK,EAAG,IACpC,GAAI,CAAC,EAAU,EAAK,GAAI,EAAG,EAAK,CAC9B,OAAO,EAAK,MAAM,EAAG,EAAI,EAAE,CAG/B,MAAO,EAAE"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue