From 0a7f0aba2626a024685dfa978becf0379ce24acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20A=2EJ=2E=20Wrona?= Date: Mon, 30 May 2016 21:10:14 +0200 Subject: [PATCH] FIX: Placeholder curry --- .eslintrc.js | 2 +- index.js | 2 +- test/main.js | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1f7cb82..ca5e7a2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -162,7 +162,7 @@ module.exports = { "no-trailing-spaces": "error", "no-undef-init": "off", "no-undefined": "off", - "no-underscore-dangle": "error", + "no-underscore-dangle": "off", "no-unmodified-loop-condition": "error", "no-unneeded-ternary": "error", "no-unused-expressions": "error", diff --git a/index.js b/index.js index d18c316..38fdfc8 100644 --- a/index.js +++ b/index.js @@ -707,7 +707,7 @@ F.F = function () { } } -F._ = R._ +F._ = R.__ F.resolver = x => () => x F.rejector = x => () => { diff --git a/test/main.js b/test/main.js index d4ac381..ced0029 100644 --- a/test/main.js +++ b/test/main.js @@ -146,6 +146,11 @@ describe("curry", () => { .end(done) }) + it("curry with placeholders", () => { + const push = F.curry((obj, arr) => [ ...arr, obj ]) + const pushInto = push(F._, [ 1, 2, 3 ]) + assert.deepEqual(pushInto(4), [ 1, 2, 3, 4 ]) + }) }) describe("range", () => {