class OrderedMap {

  constructor() {
    this.entries = [];
  }

  clear() {
    this.entries.length = 0;
    return this;
  }

  add(keyArg) {
    return this.set(keyArg);
  }

  set(key, value) {
    for (let i = 0; i < this.entries.length; i++) {
      const entry = this.entries[i];

      if (key === entry.key) {
        entry.value = value;
        return this;
      }
    }
    this.entries.push({key, value, visited: false});
    return this;
  }

  remove(key) {
    for (let i = 0; i < this.entries.length; i++) {
      const entry = this.entries[i];
      if (key === entry.key) {
        this.entries.splice(i, 1);
        return entry.value;
      }
    }
  }

  move(key, afterKey) {
    if (key === afterKey) return this;
    let fromIndex = null;
    let toIndex = null;
    for (let i = 0; i < this.entries.length; i++) {
      const entry = this.entries[i];
      if (key === entry.key) {
        fromIndex = i;
        break;
      }
    }
    if (fromIndex == null) return this;
    if (afterKey == null) {
      toIndex = 0;
    } else {
      for (let i = 0; i < this.entries.length; i++) {
        const entry = this.entries[i];
        if (afterKey === entry.key) {
          toIndex = i;
          break;
        }
      }
    }
    if (toIndex == null) return this;
    if (fromIndex > toIndex) toIndex++;
    const [entry] = this.entries.splice(fromIndex, 1);
    this.entries.splice(toIndex, 0, entry);
    return this;
  }


  get(key) {
    for (let i = 0; i < this.entries.length; i++) {
      const entry = this.entries[i];
      if (key === entry.key) return entry.value;
    }
  }

  has(key) {
    for (let i = 0; i < this.entries.length; i++) {
      const entry = this.entries[i];
      if (key === entry.key) return true;
    }
    return false;
  }

  *[Symbol.iterator]() {
    for (let i = 0; i < this.entries.length; i++) {
      const entry = this.entries[i];
      yield [entry.key, entry.value];
    }
  }

  getSize() {
    return this.entries.length;
  }

  visit(key) {
    for (let i = 0; i < this.entries.length; i++) {
      const entry = this.entries[i];

      if (key === entry.key) {
        entry.visited = true;
        return this;
      }
    }
    return this;
  }

  *clearVisitedAndIterateUnvisited() {
    for (let i = 0; i < this.entries.length; i++) {
      const entry = this.entries[i];
      if (!entry.visited) yield entry.key;
      entry.visited = false;
    }
  }
}


export default function createOrderedMap() {
  return new OrderedMap();
}

@@ -1,8 +1,47 @@
+import keysEqual from '../keysEqual';%0A%0A
 class Or
@@ -326,36 +326,43 @@
 ;%0A%0A      if (key
- ===
+sEqual(key,
  entry.key) %7B%0A  
@@ -348,32 +348,33 @@
 (key, entry.key)
+)
  %7B%0A        entry
@@ -609,36 +609,43 @@
 %5D;%0A      if (key
- ===
+sEqual(key,
  entry.key) %7B%0A  
@@ -631,32 +631,33 @@
 (key, entry.key)
+)
  %7B%0A        this.
@@ -760,20 +760,27 @@
  if (key
- ===
+sEqual(key,
  afterKe
@@ -781,16 +781,17 @@
 fterKey)
+)
  return 
@@ -940,36 +940,43 @@
 %5D;%0A      if (key
- ===
+sEqual(key,
  entry.key) %7B%0A  
@@ -962,32 +962,33 @@
 (key, entry.key)
+)
  %7B%0A        fromI
@@ -1226,24 +1226,34 @@
 %0A        if 
+(keysEqual
 (afterKey ==
@@ -1249,20 +1249,17 @@
 afterKey
- ===
+,
  entry.k
@@ -1253,32 +1253,33 @@
 rKey, entry.key)
+)
  %7B%0A          toI
@@ -1636,36 +1636,43 @@
 %5D;%0A      if (key
- ===
+sEqual(key,
  entry.key) retu
@@ -1658,32 +1658,33 @@
 (key, entry.key)
+)
  return entry.va
@@ -1806,36 +1806,43 @@
 %5D;%0A      if (key
- ===
+sEqual(key,
  entry.key) retu
@@ -1836,16 +1836,17 @@
 try.key)
+)
  return 
@@ -2216,12 +2216,19 @@
 (key
- ===
+sEqual(key,
  ent
@@ -2230,24 +2230,25 @@
 , entry.key)
+)
  %7B%0A        e

Make ordered map use keysEqual function