���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /proc/self/root/home/real/node_modules/object-component/test/ |
/** * Module dependencies. */ var object = require('..'); describe('.keys(obj)', function(){ it('should return the keys of an object', function(){ var obj = { name: 'tobi', age: 1 }; object.keys(obj).should.eql(['name', 'age']); }) }) describe('.values(obj)', function(){ it('should return the values of an object', function(){ var obj = { name: 'tobi', age: 1 }; object.values(obj).should.eql(['tobi', 1]); }) }) describe('.length(obj)', function(){ it('should return key count', function(){ var obj = { name: 'tobi', age: 1 }; object.length(obj).should.equal(2); }) }) describe('.merge(a, b)', function(){ it('should merge two objects', function(){ var a = { foo: 'bar' }; var b = { bar: 'baz' }; object.merge(a, b).should.eql({ foo: 'bar', bar: 'baz' }); }) it('should give precedence to b', function(){ var a = { foo: 'bar' }; var b = { foo: 'baz' }; object.merge(a, b).should.eql({ foo: 'baz' }); }) }) describe('.isEmpty()', function(){ it('should check if the object is empty', function(){ object.isEmpty({}).should.be.true; object.isEmpty({ foo: 'bar' }).should.be.false; }) })