Comparing version 0.2.0 to 0.3.0
@@ -6,2 +6,3 @@ module.exports = { | ||
curry: require('./src/curry'), | ||
flatten: require('./src/flatten'), | ||
gt: require('./src/gt'), | ||
@@ -13,7 +14,10 @@ gte: require('./src/gte'), | ||
map: require('./src/map'), | ||
multiply: require('./src/multiply'), | ||
or: require('./src/or'), | ||
pipe: require('./src/pipe'), | ||
range: require('./src/range'), | ||
slice: require('./src/slice'), | ||
subtract: require('./src/subtract'), | ||
tail: require('./src/tail'), | ||
type: require('./src/type'), | ||
type: require('./src/type') | ||
} |
{ | ||
"name": "bukk", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
@@ -11,4 +11,5 @@ "repository": "christianhg/bukk", | ||
"scripts": { | ||
"test": "ava", | ||
"watch:test": "ava --watch" | ||
"lint": "standard", | ||
"test": "standard && ava", | ||
"watch:test": "standard && ava --watch" | ||
}, | ||
@@ -19,4 +20,5 @@ "ava": { | ||
"devDependencies": { | ||
"ava": "^0.17.0" | ||
"ava": "^0.17.0", | ||
"standard": "^8.6.0" | ||
} | ||
} |
const head = require('./head') | ||
const tail = require('./tail') | ||
module.exports = _pipe = (fs, result) => | ||
const _pipe = (fs, result) => | ||
fs.length === 0 | ||
? result | ||
: _pipe(tail(fs), head(fs)(result)) | ||
module.exports = _pipe |
@@ -5,4 +5,6 @@ const _pipe = require('./_pipe') | ||
module.exports = compose = (...fs) => | ||
const compose = (...fs) => | ||
(...args) => | ||
_pipe(tail(fs.reverse()), head(fs.reverse()).apply(undefined, args)) | ||
module.exports = compose |
@@ -1,2 +0,4 @@ | ||
module.exports = head = xs => | ||
const head = xs => | ||
xs[0] | ||
module.exports = head |
@@ -18,5 +18,5 @@ const curry = require('./curry') | ||
'Symbol': () => a, | ||
'Undefined': () => undefined, | ||
'Undefined': () => undefined | ||
}[type(a)]()) | ||
module.exports = curry(map) |
@@ -5,4 +5,6 @@ const _pipe = require('./_pipe') | ||
module.exports = pipe = (...fs) => | ||
const pipe = (...fs) => | ||
(...args) => | ||
_pipe(tail(fs), head(fs).apply(undefined, args)) | ||
module.exports = pipe |
const slice = require('./slice') | ||
module.exports = tail = xs => | ||
const tail = xs => | ||
slice(1, xs.length, xs) | ||
module.exports = tail |
@@ -7,2 +7,2 @@ const curry = require('./curry') | ||
module.exports = curry(type) | ||
module.exports = curry(type) |
import test from 'ava' | ||
import add from '../src/add' | ||
import type from '../src/type' | ||
test('should be defined', t => { | ||
t.is(typeof add, 'function') | ||
t.is(type(add), 'Function') | ||
}) | ||
test('should be curried', t => { | ||
t.is(typeof add(1), 'function') | ||
t.is(type(add(1)), 'Function') | ||
}) | ||
@@ -12,0 +13,0 @@ |
import test from 'ava' | ||
import curry from '../src/curry' | ||
import type from '../src/type' | ||
@@ -17,3 +18,3 @@ const add = (a, b) => a + b | ||
test('should return a function when insufficient arguments are applied', t => { | ||
t.is(typeof addCurried(1), 'function') | ||
t.is(type(addCurried(1)), 'Function') | ||
}) | ||
@@ -20,0 +21,0 @@ |
import test from 'ava' | ||
import B from '../' | ||
import type from '../src/type' | ||
test('should export add', t => { | ||
t.is(typeof B.add, 'function') | ||
t.is(type(B.add), 'Function') | ||
}) | ||
test('should export and', t => { | ||
t.is(typeof B.and, 'function') | ||
t.is(type(B.and), 'Function') | ||
}) | ||
test('should export compose', t => { | ||
t.is(typeof B.compose, 'function') | ||
t.is(type(B.compose), 'Function') | ||
}) | ||
test('should export curry', t => { | ||
t.is(typeof B.curry, 'function') | ||
t.is(type(B.curry), 'Function') | ||
}) | ||
test('should export B.flatten', t => { | ||
t.is(type(B.flatten), 'Function') | ||
}) | ||
test('should export gt', t => { | ||
t.is(typeof B.gt, 'function') | ||
t.is(type(B.gt), 'Function') | ||
}) | ||
test('should export gte', t => { | ||
t.is(typeof B.gte, 'function') | ||
t.is(type(B.gte), 'Function') | ||
}) | ||
test('should export head', t => { | ||
t.is(typeof B.head, 'function') | ||
t.is(type(B.head), 'Function') | ||
}) | ||
test('should export lt', t => { | ||
t.is(typeof B.lt, 'function') | ||
t.is(type(B.lt), 'Function') | ||
}) | ||
test('should export lte', t => { | ||
t.is(typeof B.lte, 'function') | ||
t.is(type(B.lte), 'Function') | ||
}) | ||
test('should export map', t => { | ||
t.is(typeof B.map, 'function') | ||
t.is(type(B.map), 'Function') | ||
}) | ||
test('should export B.multiply', t => { | ||
t.is(type(B.multiply), 'Function') | ||
}) | ||
test('should export or', t => { | ||
t.is(typeof B.or, 'function') | ||
t.is(type(B.or), 'Function') | ||
}) | ||
test('should export pipe', t => { | ||
t.is(typeof B.pipe, 'function') | ||
t.is(type(B.pipe), 'Function') | ||
}) | ||
test('should export B.range', t => { | ||
t.is(type(B.range), 'Function') | ||
}) | ||
test('should export slice', t => { | ||
t.is(typeof B.slice, 'function') | ||
t.is(type(B.slice), 'Function') | ||
}) | ||
test('should export B.subtract', t => { | ||
t.is(type(B.subtract), 'Function') | ||
}) | ||
test('should export tail', t => { | ||
t.is(typeof B.tail, 'function') | ||
t.is(type(B.tail), 'Function') | ||
}) | ||
test('should export type', t => { | ||
t.is(typeof B.type, 'function') | ||
t.is(type(B.type), 'Function') | ||
}) |
@@ -5,2 +5,3 @@ import test from 'ava' | ||
import map from '../src/map' | ||
import type from '../src/type' | ||
@@ -11,7 +12,7 @@ const inc = add(1) | ||
test('should be curried', t => { | ||
t.is(typeof map(inc), 'function') | ||
t.is(type(map(inc)), 'Function') | ||
}) | ||
test('should map an Array', t => { | ||
t.deepEqual(map(inc, [1,2,3]), [2,3,4]) | ||
t.deepEqual(map(inc, [1, 2, 3]), [2, 3, 4]) | ||
}) | ||
@@ -40,3 +41,3 @@ | ||
test('should not map a Symbol', t => { | ||
const one = Symbol(1); | ||
const one = Symbol(1) | ||
@@ -58,3 +59,3 @@ t.deepEqual(map(inc, one), one) | ||
test('should map a Set', t => { | ||
t.deepEqual(map(inc, new Set([1,2,3])), new Set([2,3,4])) | ||
t.deepEqual(map(inc, new Set([1, 2, 3])), new Set([2, 3, 4])) | ||
}) |
@@ -26,3 +26,3 @@ import test from 'ava' | ||
test('should recognize Set', t => { | ||
t.is(type(new Set([1,2,3])), 'Set') | ||
t.is(type(new Set([1, 2, 3])), 'Set') | ||
}) | ||
@@ -29,0 +29,0 @@ |
Sorry, the diff of this file is not supported yet
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
131578
36
342
2