Sha256: 25d29bea10ca3e4a92c4a4676daa57f154cc0c49dc516872a21d09fe2f9c0243
Contents?: true
Size: 1.03 KB
Versions: 10
Compression:
Stored size: 1.03 KB
Contents
/*! * object.omit <https://github.com/jonschlinkert/object.omit> * * Copyright (c) 2014 Jon Schlinkert, contributors. * Licensed under the MIT License */ 'use strict'; var should = require('should'); var omit = require('./'); describe('.omit()', function () { it('should omit the given key from the object.', function () { omit({a: 'a', b: 'b', c: 'c'}, 'a').should.eql({ b: 'b', c: 'c' }); }); it('should omit the given keys from the object.', function () { omit({a: 'a', b: 'b', c: 'c'}, ['a', 'c']).should.eql({ b: 'b' }); }); it('should return the object if no keys are specified.', function () { omit({a: 'a', b: 'b', c: 'c'}, []).should.eql({a: 'a', b: 'b', c: 'c'}); omit({a: 'a', b: 'b', c: 'c'}).should.eql({a: 'a', b: 'b', c: 'c'}); }); it('should return an empty object if the first arg is not an object.', function () { omit(null, {a: 'a', b: 'b', c: 'c'}).should.eql({}); }); it('should return an empty object if no object is specified.', function () { omit().should.eql({}); }); });
Version data entries
10 entries across 10 versions & 1 rubygems