Comparing version 0.2.4 to 0.2.5
import curry from "./curry.js"; | ||
import takeAll from "./takeAll.js"; | ||
import dropLazy from "./Lazy/dropLazy.js"; | ||
import go1 from "./go1.js"; | ||
import take from "./take.js"; | ||
export default curry(function drop(l, iter) { | ||
return takeAll(dropLazy(l, iter)); | ||
return go1(takeAll(iter), arr => take(arr.length - l, arr)); | ||
}); |
@@ -85,3 +85,5 @@ export { default as minBy, default as min_by } from './minBy.js'; | ||
export { default as range } from './range.js'; | ||
export { default as drop } from './drop.js'; | ||
export { default as dropRight, default as drop_right } from './dropRight.js'; | ||
export * from './L.js'; | ||
export * from './C.js'; |
@@ -6,2 +6,3 @@ import curry from "../curry.js"; | ||
export default curry(function *dropLazy(l, iter) { | ||
if (l < 1) return yield *safety(iter); | ||
for (const a of safety(iter)) { | ||
@@ -8,0 +9,0 @@ if (a instanceof Promise) yield a.then(a => l ? (l--, Promise.reject(nop)) : a); |
@@ -5,2 +5,3 @@ import curry from "../curry.js"; | ||
export default curry(function *takeLazy(l, iter) { | ||
if (l < 1) return; | ||
for (const a of safety(iter)) { | ||
@@ -7,0 +8,0 @@ if (a instanceof Promise) yield a.then(a => (--l, a)); |
{ | ||
"name": "fxjs2", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Functional Extensions for Javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,5 +1,5 @@ | ||
[EN](https://github.com/marpple/FxJS) | [KR](https://github.com/marpple/FxJS/blob/master/README_kr.md) | ||
## FxJS - Functional Extensions for Javascript | ||
[EN](https://github.com/marpple/FxJS) | [KR](https://github.com/marpple/FxJS/blob/master/README_kr.md) | ||
FxJS is a functional programming library that uses basic JavaScript values and emphasizes repeatable programming and Promise. | ||
@@ -6,0 +6,0 @@ |
@@ -6,3 +6,3 @@ import curry from "./curry.js"; | ||
export default curry(function take(l, iter) { | ||
if (l === 0) return []; | ||
if (l < 1) return []; | ||
let res = []; | ||
@@ -9,0 +9,0 @@ iter = toIter(iter); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39997
935