Skip to content

Commit

Permalink
Revert "refactor: ensure proxyMap/proxySet instance parity with nativ…
Browse files Browse the repository at this point in the history
…e Map/Set"

This reverts commit a63cc14.
  • Loading branch information
chiefGui committed Oct 10, 2022
1 parent d8951dc commit 419f5cd
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/utils/proxyMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export function proxyMap<K, V>(
[Symbol.iterator]() {
return this.entries()
},
__proto__: Map.prototype,
})

Object.defineProperties(map, {
Expand Down
1 change: 0 additions & 1 deletion src/utils/proxySet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export function proxySet<T>(initialValues?: Iterable<T> | null): Set<T> {
// array.entries returns [index, value] while Set [value, value]
return new Set(this.data).entries()
},
__proto__: Set.prototype,
})

Object.defineProperties(set, {
Expand Down
6 changes: 0 additions & 6 deletions tests/proxyMap.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ const inputValues = [

describe('features parity with native Map', () => {
initialValues.forEach(({ name, value }) => {
it(`is an instance of Map`, () => {
const map = proxyMap(value as any)

expect(map).toBeInstanceOf(Map)
})

it(`Support Map operations on ${name}`, () => {
const map = proxyMap(value as any)
const nativeMap = new Map(value as any)
Expand Down
6 changes: 0 additions & 6 deletions tests/proxySet.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ const inputValues = [

describe('features parity with native Set', () => {
initialValues.forEach(({ name, value }) => {
it(`is an instance of Set`, () => {
const set = proxySet<unknown>(value)

expect(set).toBeInstanceOf(Set)
})

it(`support Set operations on ${name}`, () => {
const set = proxySet<unknown>(value)
const nativeSet = new Set<unknown>(value)
Expand Down

0 comments on commit 419f5cd

Please sign in to comment.