ran npm tdd

This commit is contained in:
King
2018-01-11 05:27:49 -05:00
parent 8fd7e51ede
commit 7c805e941a
6 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,2 @@
module.exports = decapitalize = ([first, ...rest], upperRest = false) =>
first.toLowerCase() + (upperRest ? rest.join('').toUpperCase() : rest.join(''));

View File

@ -0,0 +1,13 @@
const test = require('tape');
const decapitalize = require('./decapitalize.js');
test('Testing decapitalize', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof decapitalize === 'function', 'decapitalize is a Function');
//t.deepEqual(decapitalize(args..), 'Expected');
//t.equal(decapitalize(args..), 'Expected');
//t.false(decapitalize(args..), 'Expected');
//t.throws(decapitalize(args..), 'Expected');
t.end();
});

View File

@ -0,0 +1,4 @@
module.exports = flattenDepth = (arr, depth = 1) =>
depth != 1
? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flattenDepth(v, depth - 1) : v), [])
: arr.reduce((a, v) => a.concat(v), []);

View File

@ -0,0 +1,13 @@
const test = require('tape');
const flattenDepth = require('./flattenDepth.js');
test('Testing flattenDepth', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof flattenDepth === 'function', 'flattenDepth is a Function');
//t.deepEqual(flattenDepth(args..), 'Expected');
//t.equal(flattenDepth(args..), 'Expected');
//t.false(flattenDepth(args..), 'Expected');
//t.throws(flattenDepth(args..), 'Expected');
t.end();
});

View File

@ -0,0 +1 @@
module.exports = isObject = obj => obj === Object(obj);

View File

@ -0,0 +1,13 @@
const test = require('tape');
const isObject = require('./isObject.js');
test('Testing isObject', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof isObject === 'function', 'isObject is a Function');
//t.deepEqual(isObject(args..), 'Expected');
//t.equal(isObject(args..), 'Expected');
//t.false(isObject(args..), 'Expected');
//t.throws(isObject(args..), 'Expected');
t.end();
});