Use Object.values
This commit is contained in:
@@ -25,7 +25,6 @@ import {
|
||||
doubleClick,
|
||||
never,
|
||||
} from '../../../../../src/ol/events/condition.js';
|
||||
import {getValues} from '../../../../../src/ol/obj.js';
|
||||
|
||||
describe('ol.interaction.Modify', function () {
|
||||
let target, map, layer, source, features;
|
||||
@@ -965,7 +964,7 @@ describe('ol.interaction.Modify', function () {
|
||||
beforeEach(function () {
|
||||
getModifyListeners = function (feature, modify) {
|
||||
const listeners = feature.listeners_['change'];
|
||||
const candidates = getValues(modify);
|
||||
const candidates = Object.values(modify);
|
||||
return listeners.filter(function (listener) {
|
||||
return candidates.indexOf(listener) !== -1;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import expect from '../expect.js';
|
||||
import {assign, clear, getValues, isEmpty} from '../../../src/ol/obj.js';
|
||||
import {assign, clear, isEmpty} from '../../../src/ol/obj.js';
|
||||
|
||||
describe('ol/obj.js', () => {
|
||||
describe('assign()', function () {
|
||||
@@ -49,13 +49,6 @@ describe('ol/obj.js', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getValues()', function () {
|
||||
it('gets a list of property values from an object', function () {
|
||||
expect(getValues({foo: 'bar', num: 42}).sort()).to.eql([42, 'bar']);
|
||||
expect(getValues([])).to.eql([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isEmpty()', function () {
|
||||
it('checks if an object has any properties', function () {
|
||||
expect(isEmpty({})).to.be(true);
|
||||
|
||||
Reference in New Issue
Block a user