diff --git a/shallow.js b/shallow.js new file mode 100644 index 0000000..66702db --- /dev/null +++ b/shallow.js @@ -0,0 +1,9 @@ +var lib = require('./lib/deap'); + +var deap = module.exports = lib.extendShallow; + +deap(deap, { + clone: lib.clone, + extend: lib.extendShallow, + merge: lib.mergeShallow +}); diff --git a/test/shallow.test.js b/test/shallow.test.js new file mode 100644 index 0000000..cd12949 --- /dev/null +++ b/test/shallow.test.js @@ -0,0 +1,22 @@ +var assert = require('chai').assert, + lib = require('../lib/deap'), + shallow = require('../shallow'); + +describe('shallow', function() { + + it('should be defined correctly', function() { + assert.isFunction(shallow); + + assert.isFunction(shallow.extend); + assert.isFunction(shallow.merge); + assert.isFunction(shallow.clone); + }); + + it('should be shallow functions', function() { + assert.equal(shallow, lib.extendShallow); + assert.equal(shallow.extend, lib.extendShallow); + assert.equal(shallow.merge, lib.mergeShallow); + assert.equal(shallow.clone, lib.clone); + }); + +});