Use Object.values

This commit is contained in:
Tim Schaub
2022-07-27 15:03:47 -06:00
parent f2d989b299
commit 641bd7af33
6 changed files with 6 additions and 35 deletions

View File

@@ -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;
});

View File

@@ -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);