Rename ol/objectutil.js to ol/obj.js
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
goog.provide('ol.test.object');
|
||||
|
||||
describe('ol.object.assign()', function() {
|
||||
describe('ol.obj.assign()', function() {
|
||||
|
||||
it('is an alias for Object.assign() where available', function() {
|
||||
if (typeof Object.assign === 'function') {
|
||||
expect(ol.object.assign).to.be(Object.assign);
|
||||
expect(ol.obj.assign).to.be(Object.assign);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('ol.object.assign()', function() {
|
||||
targetProp1: 'targetValue1'
|
||||
};
|
||||
|
||||
var assigned = ol.object.assign(target, source);
|
||||
var assigned = ol.obj.assign(target, source);
|
||||
expect(assigned).to.be(target);
|
||||
expect(assigned.sourceProp1).to.be('sourceValue1');
|
||||
expect(assigned.sourceProp2).to.be('sourceValue2');
|
||||
@@ -30,11 +30,11 @@ describe('ol.object.assign()', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('ol.object.clear()', function() {
|
||||
describe('ol.obj.clear()', function() {
|
||||
|
||||
it('removes all properties from an object', function() {
|
||||
var clear = ol.object.clear;
|
||||
var isEmpty = ol.object.isEmpty;
|
||||
var clear = ol.obj.clear;
|
||||
var isEmpty = ol.obj.isEmpty;
|
||||
expect(isEmpty(clear({foo: 'bar'}))).to.be(true);
|
||||
expect(isEmpty(clear({foo: 'bar', num: 42}))).to.be(true);
|
||||
expect(isEmpty(clear({}))).to.be(true);
|
||||
@@ -43,24 +43,24 @@ describe('ol.object.clear()', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('ol.object.getValues()', function() {
|
||||
describe('ol.obj.getValues()', function() {
|
||||
|
||||
it('gets a list of property values from an object', function() {
|
||||
expect(ol.object.getValues({foo: 'bar', num: 42}).sort()).to.eql([42, 'bar']);
|
||||
expect(ol.object.getValues(null)).to.eql([]);
|
||||
expect(ol.obj.getValues({foo: 'bar', num: 42}).sort()).to.eql([42, 'bar']);
|
||||
expect(ol.obj.getValues(null)).to.eql([]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('ol.object.isEmpty()', function() {
|
||||
describe('ol.obj.isEmpty()', function() {
|
||||
|
||||
it('checks if an object has any properties', function() {
|
||||
expect(ol.object.isEmpty({})).to.be(true);
|
||||
expect(ol.object.isEmpty(null)).to.be(true);
|
||||
expect(ol.object.isEmpty({foo: 'bar'})).to.be(false);
|
||||
expect(ol.object.isEmpty({foo: false})).to.be(false);
|
||||
expect(ol.obj.isEmpty({})).to.be(true);
|
||||
expect(ol.obj.isEmpty(null)).to.be(true);
|
||||
expect(ol.obj.isEmpty({foo: 'bar'})).to.be(false);
|
||||
expect(ol.obj.isEmpty({foo: false})).to.be(false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
|
||||
Reference in New Issue
Block a user