prelude-extension
Advanced tools
Comparing version 0.0.5 to 0.0.6
28
index.js
// Generated by LiveScript 1.4.0 | ||
(function(){ | ||
var ref$, all, any, each, filter, find, isType, keys, map, Obj, partition, reverse, sortBy, clamp, findAll, get, isEqualToObject, partitionString, mappend, rextend, set, transpose, slice$ = [].slice, toString$ = {}.toString; | ||
ref$ = require('prelude-ls'), all = ref$.all, any = ref$.any, each = ref$.each, filter = ref$.filter, find = ref$.find, isType = ref$.isType, keys = ref$.keys, map = ref$.map, Obj = ref$.Obj, partition = ref$.partition, reverse = ref$.reverse, sortBy = ref$.sortBy; | ||
var ref$, all, any, concatMap, each, filter, find, isType, keys, map, Obj, objToPairs, partition, reverse, sortBy, clamp, findAll, get, isEqualToObject, partitionString, mappend, rextend, set, transpose, unwrap, slice$ = [].slice, toString$ = {}.toString; | ||
ref$ = require('prelude-ls'), all = ref$.all, any = ref$.any, concatMap = ref$.concatMap, each = ref$.each, filter = ref$.filter, find = ref$.find, isType = ref$.isType, keys = ref$.keys, map = ref$.map, Obj = ref$.Obj, objToPairs = ref$.objToPairs, partition = ref$.partition, reverse = ref$.reverse, sortBy = ref$.sortBy; | ||
clamp = curry$(function(n, min, max){ | ||
@@ -30,3 +30,3 @@ return Math.max(min, Math.min(max, n)); | ||
}); | ||
isEqualToObject = function(o1, o2){ | ||
isEqualToObject = curry$(function(o1, o2){ | ||
if (any(function(it){ | ||
@@ -68,3 +68,3 @@ return isType(it, o1); | ||
} | ||
}; | ||
}); | ||
partitionString = curry$(function(text, search){ | ||
@@ -153,2 +153,19 @@ var indices, first, x, last, high, low; | ||
}; | ||
unwrap = curry$(function(f, depth, object){ | ||
var r; | ||
r = curry$(function(f, ks, i, j, object){ | ||
return concatMap(function(arg$){ | ||
var k, v; | ||
k = arg$[0], v = arg$[1]; | ||
if (i < j) { | ||
return r(f, ks.concat(k), i + 1, j, v); | ||
} else { | ||
return f(ks.concat(k), v); | ||
} | ||
})( | ||
objToPairs( | ||
object)); | ||
}); | ||
return r(f, [], 0, depth, object); | ||
}); | ||
module.exports = { | ||
@@ -163,3 +180,4 @@ clamp: clamp, | ||
set: set, | ||
transpose: transpose | ||
transpose: transpose, | ||
unwrap: unwrap | ||
}; | ||
@@ -166,0 +184,0 @@ function curry$(f, bound){ |
{ | ||
"name": "prelude-extension", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "prelude-extension", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,4 +21,6 @@ # Functions | ||
`unwrap :: ([String] -> a -> b) -> Int -> c -> [b]` | ||
# Test | ||
`./test.sh` |
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
6850
199
25