Add fp.restFrom and fp.spreadFrom.

This commit is contained in:
John-David Dalton
2016-03-13 15:13:39 -07:00
parent 81ee5d76b8
commit 4d185ae7b5
2 changed files with 42 additions and 7 deletions

View File

@@ -1447,6 +1447,22 @@
/*--------------------------------------------------------------------------*/
QUnit.module('fp.restFrom');
(function() {
QUnit.test('should accept a `start` param', function(assert) {
assert.expect(1);
var actual = fp.restFrom(2)(function() {
return slice.call(arguments);
})('a', 'b', 'c', 'd');
assert.deepEqual(actual, ['a', 'b', ['c', 'd']]);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('fp.runInContext');
(function() {
@@ -1466,6 +1482,22 @@
/*--------------------------------------------------------------------------*/
QUnit.module('fp.spreadFrom');
(function() {
QUnit.test('should accept a `start` param', function(assert) {
assert.expect(1);
var actual = fp.spreadFrom(2)(function() {
return slice.call(arguments);
})('a', 'b', ['c', 'd']);
assert.deepEqual(actual, ['a', 'b', 'c', 'd']);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('fp.trimChars');
_.each(['trimChars', 'trimCharsStart', 'trimCharsEnd'], function(methodName, index) {