pepka 1.6.9 → 1.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs +2 -2
- package/dist/bundle.d.ts +1 -1
- package/dist/bundle.mjs +2 -2
- package/package.json +1 -1
- package/src/safe.ts +2 -2
package/dist/bundle.cjs
CHANGED
|
@@ -291,7 +291,7 @@ const slice = curry3((from, to, o) => o.slice(from, (isNum(to) ? to : inf)));
|
|
|
291
291
|
const flip = (fn) => curry2((b, a) => fn(a, b));
|
|
292
292
|
/** @returns first element of an array or a string. */
|
|
293
293
|
const head = nth(0);
|
|
294
|
-
/** @returns
|
|
294
|
+
/** @returns all elements of an array or a string after first one. */
|
|
295
295
|
const tail = slice(1, inf);
|
|
296
296
|
/** Returns last element of an array, readonly array or a string.
|
|
297
297
|
* @param s Array to extract that element.
|
|
@@ -391,7 +391,7 @@ const diff = curry2((_xs1, _xs2) => {
|
|
|
391
391
|
const genBy = curry2((generator, length) => [...Array(length)].map((_, i) => generator(i)));
|
|
392
392
|
const once = (fn) => {
|
|
393
393
|
let done = false, cache;
|
|
394
|
-
return (...args)
|
|
394
|
+
return function (...args) {
|
|
395
395
|
if (done)
|
|
396
396
|
return cache;
|
|
397
397
|
done = true;
|
package/dist/bundle.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ type TailOverload = {
|
|
|
115
115
|
] ? U : T;
|
|
116
116
|
<T extends any>(s: T[]): null;
|
|
117
117
|
};
|
|
118
|
-
/** @returns
|
|
118
|
+
/** @returns all elements of an array or a string after first one. */
|
|
119
119
|
export declare const tail: TailOverload;
|
|
120
120
|
type LastChar<T extends string> = T extends `${string}${infer Rest}` ? (Split<T>["length"] extends 1 ? T : LastChar<Rest>) : T;
|
|
121
121
|
type LastOverload = {
|
package/dist/bundle.mjs
CHANGED
|
@@ -289,7 +289,7 @@ const slice = curry3((from, to, o) => o.slice(from, (isNum(to) ? to : inf)));
|
|
|
289
289
|
const flip = (fn) => curry2((b, a) => fn(a, b));
|
|
290
290
|
/** @returns first element of an array or a string. */
|
|
291
291
|
const head = nth(0);
|
|
292
|
-
/** @returns
|
|
292
|
+
/** @returns all elements of an array or a string after first one. */
|
|
293
293
|
const tail = slice(1, inf);
|
|
294
294
|
/** Returns last element of an array, readonly array or a string.
|
|
295
295
|
* @param s Array to extract that element.
|
|
@@ -389,7 +389,7 @@ const diff = curry2((_xs1, _xs2) => {
|
|
|
389
389
|
const genBy = curry2((generator, length) => [...Array(length)].map((_, i) => generator(i)));
|
|
390
390
|
const once = (fn) => {
|
|
391
391
|
let done = false, cache;
|
|
392
|
-
return (...args)
|
|
392
|
+
return function (...args) {
|
|
393
393
|
if (done)
|
|
394
394
|
return cache;
|
|
395
395
|
done = true;
|
package/package.json
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"prod": "npm run gentypes && npm run prod:es && npm run prod:cjs",
|
|
42
42
|
"all": "npm run dev && npm run prod"
|
|
43
43
|
},
|
|
44
|
-
"version": "1.6.
|
|
44
|
+
"version": "1.6.10",
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
47
47
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
package/src/safe.ts
CHANGED
|
@@ -72,7 +72,7 @@ type TailOverload = {
|
|
|
72
72
|
: T extends readonly [any, ...infer U] ? U : T
|
|
73
73
|
<T extends any>(s: T[]): null
|
|
74
74
|
}
|
|
75
|
-
/** @returns
|
|
75
|
+
/** @returns all elements of an array or a string after first one. */
|
|
76
76
|
export const tail = slice(1, inf) as TailOverload
|
|
77
77
|
type LastChar<T extends string> = T extends `${string}${infer Rest}`
|
|
78
78
|
? (Split<T>['length'] extends 1 ? T : LastChar<Rest>) : T
|
|
@@ -194,7 +194,7 @@ export const genBy = curry2(
|
|
|
194
194
|
)
|
|
195
195
|
export const once = <Func extends AnyFunc>(fn: Func) => {
|
|
196
196
|
let done = false, cache: any
|
|
197
|
-
return (...args: Parameters<Func>)
|
|
197
|
+
return function(...args: Parameters<Func>) {
|
|
198
198
|
if(done) return cache
|
|
199
199
|
done = true
|
|
200
200
|
return cache = fn(...args)
|