Lines Matching refs:fp

41     var baseConvert = root.fp || require('../fp/_baseConvert.js');
42 if (!root.fp) {
67 var fp = root.fp variable
68 ? (fp = _.noConflict(), _ = root._, fp)
260 isArray = fp.isArray.convert({ 'curry': true });
262 assert.strictEqual(fp.isArray(array), true);
269 var all = fp.all.convert({ 'rearg': false }),
278 var extendAll = fp.extendAll.convert({ 'immutable': false }),
292 func = isFp ? fp.convert : fp.remove.convert;
328 var methodNames = _.filter(_.functions(fp), function(methodName) {
329 return fp[methodName].length > 1;
362 result.push([alias, fp[alias] === fp[realName]]);
387 result = _.attempt(function() { return fp[methodName](arg); });
416 result = _.attempt(function() { return fp[methodName](args[0])(args[1]); });
443 result = _.attempt(function() { return fp[methodName](args[0])(args[1])(args[2]); });
467 actual = fp.difference(array)(other);
471 actual = fp.includes('b')(array);
474 actual = fp.intersection(other)(array);
477 actual = fp.omit(other)(object);
480 actual = fp.union(other)(array);
483 actual = fp.uniq(other);
486 actual = fp.uniqBy(_.identity, other);
489 actual = fp.without(other)(array);
492 actual = fp.xor(other)(array);
495 actual = fp.pull('b')(array);
546 var array = fp.range(0, LARGE_ARRAY_SIZE),
568 var combined = fp.flow(map2, filter2, fp.compact, take2);
586 assert.deepEqual(fp.filter({ 'a': 3 })(objects), [objects[1]]);
592 assert.deepEqual(fp.filter(['a', 3])(objects), [objects[1]]);
598 assert.deepEqual(fp.map('a')(objects), [1, 3]);
610 var actual = fp.add(fp, 'b')('a');
613 actual = fp.fill(fp, 2)(1, '*')([1, 2, 3]);
616 actual = fp.slice(fp, 2)(1)(['a', 'b', 'c']);
623 _.each([[], fp.__], function(ph) {
624 fp.placeholder = ph;
626 var actual = fp.add(ph, 'b')('a');
629 actual = fp.fill(ph, 2)(1, '*')([1, 2, 3]);
632 actual = fp.slice(ph, 2)(1)(['a', 'b', 'c']);
647 var func = fp[methodName];
653 assert.strictEqual(func.placeholder, fp.__);
668 actual = fp.set('a.b.c.d', 5, value);
677 actual = fp.setWith(Object)('[0][1]')('a')(value);
682 actual = fp.unset('a.b')(value);
688 actual = fp.update('a.b')(square)(value);
694 actual = fp.updateWith(Object)('[0][1]')(_.constant('a'))(value);
706 var func = fp[methodName],
721 var func = fp[methodName];
735 var func = fp[methodName];
749 var func = fp[methodName];
765 var func = fp[methodName];
798 actual = fp.castArray(array);
808 actual = fp.castArray(object);
836 var func = fp[methodName];
850 var func = fp[methodName];
868 assert.strictEqual(fp.defaultTo(1)(0), 0);
869 assert.strictEqual(fp.defaultTo(1)(undefined), 1);
881 var actual = fp.difference([2, 1], [2, 3]);
894 var actual = fp.differenceBy(Math.floor, [2.1, 1.2], [2.3, 3.4]);
903 fp.differenceBy(function() {
919 var actual = fp.differenceWith(fp.eq)([2, 1])([2, 3]);
929 var func = fp[methodName],
968 assert.deepEqual(fp.fill(1)(2)('*')(array), [1, '*', 3]);
975 actual = fp.fill(1)(2)('*')(array);
987 var func = fp[methodName];
1008 return fp.flow(fp.property('a'), fp.eq(value));
1016 assert.strictEqual(fp.findFrom(resolve(1))(1)(objects), objects[2]);
1017 assert.strictEqual(fp.findFrom(resolve(2))(-2)(objects), objects[3]);
1027 return fp.flow(fp.property('a'), fp.eq(value));
1035 assert.strictEqual(fp.findLastFrom(resolve(1))(1)(objects), objects[0]);
1036 assert.strictEqual(fp.findLastFrom(resolve(2))(-2)(objects), objects[1]);
1045 var func = fp[methodName],
1046 resolve = methodName == 'findIndexFrom' ? fp.eq : _.identity;
1063 var func = fp[methodName],
1064 resolve = methodName == 'findLastIndexFrom' ? fp.eq : _.identity;
1092 assert.deepEqual(fp.flatMapDepth(duplicate)(2)(array), expected);
1093 assert.deepEqual(fp.flatMapDepth(duplicate)(2)(object), expected);
1102 var func = fp[methodName],
1110 array = fp.range(0, LARGE_ARRAY_SIZE);
1122 var filter = fp.filter(predicate),
1123 map = fp.map(iteratee),
1124 take = fp.take(2);
1128 ? func(map, filter, fp.compact, take)
1129 : func(take, fp.compact, filter, map);
1150 var func = fp[methodName];
1181 var actual = fp.getOr('default')('path')({});
1191 var func = fp[methodName];
1208 assert.strictEqual(fp.inRange(2)(4)(3), true);
1209 assert.strictEqual(fp.inRange(-2)(-6)(-3), true);
1221 var actual = fp.intersectionBy(Math.floor, [2.1, 1.2], [2.3, 3.4]);
1230 fp.intersectionBy(function() {
1246 var actual = fp.intersectionWith(fp.eq)([2, 1])([2, 3]);
1259 var actual = fp.invoke('toUpperCase')('a');
1272 var actual = fp.invokeMap('toUpperCase')(['a', 'b']);
1285 var actual = fp.invokeArgs('concat')(['b', 'c'])('a');
1298 var actual = fp.invokeArgsMap('concat')(['b', 'c'])(['a', 'A']);
1317 fp.isEqualWith(function() {
1343 fp.isMatchWith(function() {
1362 var func = fp.iteratee(function(a, b, c) { return [a, b, c]; }, 3);
1381 var func = fp[methodName];
1400 fp.mapKeys(function() {
1414 func = fp[methodName],
1452 fp.mergeWith(function() {
1466 actual = fp.mergeWith(_.noop, objects[0], objects[1]);
1486 fp.mergeAllWith(function() {
1507 fp.mixin(source);
1509 assert.strictEqual(typeof fp.a, 'function');
1510 assert.notOk('a' in fp.prototype);
1512 delete fp.a;
1513 delete fp.prototype.a;
1521 fp.mixin(new Foo);
1523 assert.notOk('a' in fp);
1524 assert.notOk('a' in fp.prototype);
1526 delete fp.a;
1527 delete fp.prototype.a;
1533 var each1 = fp.each,
1534 each2 = fp.prototype.each;
1536 fp.mixin({ 'each': source.a });
1538 assert.strictEqual(fp.each, source.a);
1539 assert.strictEqual(fp.prototype.each, each2);
1541 fp.each = each1;
1542 fp.prototype.each = each2; class
1551 fp.mixin.apply(fp, index ? [1] : []);
1554 return root[key] !== fp[key];
1558 if (root[key] === fp[key]) {
1590 var func = fp.nthArg(1);
1593 func = fp.nthArg(-1);
1606 _.each([fp.over, convert('over', _.over)], function(func) {
1618 var func = fp[methodName];
1638 var func = fp[methodName],
1658 var func = fp[methodName],
1704 assert.strictEqual(fp.propertyOf(object, 'a'), 1);
1705 assert.strictEqual(fp.propertyOf(object)('a'), 1);
1718 actual = fp.pull(2)(array);
1734 actual = fp.pullAll([1, 3])(array);
1750 actual = fp.pullAt([0, 2])(array);
1771 var result = fp.random(min)(max);
1782 var func = fp[methodName],
1797 var func = fp[methodName],
1819 var rearged = fp.rearg([1, 2, 0])(fn);
1826 var rearged = fp.rearg([1, 2, 0], fn);
1836 var func = fp[methodName],
1879 actual = fp.remove(fp.eq(2))(array);
1894 var actual = fp.restFrom(2)(function() {
1911 actual = fp.reverse(array);
1926 assert.strictEqual(typeof fp.runInContext({}).curryN, 'function');
1946 actual = fp.set('a.b')(3)(object);
1963 fp.setWith(function() {
1974 actual = fp.setWith(Object)('d.e')(4)(object);
1989 var actual = fp.spreadFrom(2)(function() {
2002 var func = fp[methodName],
2031 var actual = fp.unionBy(Math.floor, [2.1], [1.2, 2.3]);
2040 fp.unionBy(function() {
2056 var actual = fp.unionWith(fp.eq)([2, 1])([2, 3]);
2065 fp.unionWith(function() {
2084 actual = fp.uniqBy(_.property('a'))(objects);
2094 fp.uniqBy(function() {
2110 var actual = fp.uniqWith(fp.eq)([2, 1, 2]);
2119 fp.uniqWith(function() {
2135 var actual = fp.update('a.b')(_.identity)({ 'a': { 'b': 1 } });
2143 actual = fp.update('a.b')(_.identity)(object);
2153 actual = fp.update('a.b')(square)(object);
2168 fp.updateWith(function() {
2179 actual = fp.updateWith(Object)('d.e')(_.constant(4))(object);
2195 actual = fp.unset('a.b')(object);
2210 var actual = fp.xorBy(Math.floor, [2.1, 1.2], [2.3, 3.4]);
2219 fp.xorBy(function() {
2235 var actual = fp.xorWith(fp.eq)([2, 1])([2, 3]);
2245 var func = fp[methodName];
2268 assert.deepEqual(fp.zip([1, 2])([3, 4]), [[1, 3], [2, 4]]);
2280 assert.deepEqual(fp.zipAll([[1, 2], [3, 4], [5, 6]]), [[1, 3, 5], [2, 4, 6]]);
2292 assert.deepEqual(fp.zipObject(['a', 'b'])([1, 2]), { 'a': 1, 'b': 2 });
2306 actual = fp.zipWith(add)(array1)(array2);