Discard unused utility now that we use Object.fromEntries

This commit is contained in:
Michael Telatynski 2021-07-23 18:40:22 +01:00
parent 05a9023bac
commit c8d9294350
3 changed files with 1 additions and 38 deletions

View file

@ -29,7 +29,6 @@ import {
ArrayUtil,
GroupedArray,
} from "../../src/utils/arrays";
import { objectFromEntries } from "../../src/utils/objects";
function expectSample(i: number, input: number[], expected: number[], smooth = false) {
console.log(`Resample case index: ${i}`); // for debugging test failures
@ -336,7 +335,7 @@ describe('arrays', () => {
expect(result).toBeDefined();
expect(result.value).toBeDefined();
const asObject = objectFromEntries(result.value.entries());
const asObject = Object.fromEntries(result.value.entries());
expect(asObject).toMatchObject(output);
});
});

View file

@ -18,7 +18,6 @@ import {
objectClone,
objectDiff,
objectExcluding,
objectFromEntries,
objectHasDiff,
objectKeyChanges,
objectShallowClone,
@ -242,21 +241,4 @@ describe('objects', () => {
expect(result.test.third).not.toBe(a.test.third);
});
});
describe('objectFromEntries', () => {
it('should create an object from an array of entries', () => {
const output = { a: 1, b: 2, c: 3 };
const result = objectFromEntries(Object.entries(output));
expect(result).toBeDefined();
expect(result).toMatchObject(output);
});
it('should maintain pointers in values', () => {
const output = { a: {}, b: 2, c: 3 };
const result = objectFromEntries(Object.entries(output));
expect(result).toBeDefined();
expect(result).toMatchObject(output);
expect(result['a']).toBe(output.a);
});
});
});