@woosh/meep-engine 2.48.11 → 2.48.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -589,7 +589,7 @@ export class HashMap {
|
|
|
589
589
|
} else {
|
|
590
590
|
return {
|
|
591
591
|
done: false,
|
|
592
|
-
value: n.value[
|
|
592
|
+
value: n.value[1]
|
|
593
593
|
};
|
|
594
594
|
}
|
|
595
595
|
|
|
@@ -616,7 +616,7 @@ export class HashMap {
|
|
|
616
616
|
} else {
|
|
617
617
|
return {
|
|
618
618
|
done: false,
|
|
619
|
-
value: n.value[
|
|
619
|
+
value: n.value[0]
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HashMap } from "./HashMap.js";
|
|
2
|
-
import { passThrough, strictEquals } from "../function/Functions.js";
|
|
2
|
+
import { passThrough, returnOne, strictEquals } from "../function/Functions.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
@@ -74,3 +74,26 @@ test("retrieval works as intended after hash map grows", () => {
|
|
|
74
74
|
expect(m.get(-7)).toEqual("c");
|
|
75
75
|
|
|
76
76
|
});
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
test("key iterator", () => {
|
|
80
|
+
const map = new HashMap({
|
|
81
|
+
keyHashFunction: returnOne,
|
|
82
|
+
keyEqualityFunction: strictEquals
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
map.set(7, "hello");
|
|
86
|
+
|
|
87
|
+
expect(map.keys().next().value).toBe(7);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test("value iterator", () => {
|
|
91
|
+
const map = new HashMap({
|
|
92
|
+
keyHashFunction: returnOne,
|
|
93
|
+
keyEqualityFunction: strictEquals
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
map.set(7, "hello");
|
|
97
|
+
|
|
98
|
+
expect(map.values().next().value).toBe("hello");
|
|
99
|
+
});
|
|
@@ -10,10 +10,20 @@ import { IsIn } from "./IsIn.js";
|
|
|
10
10
|
import { IsAnything } from "./IsAnything.js";
|
|
11
11
|
import { DescribeAs } from "./DescribeAs.js";
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @template T
|
|
15
|
+
* @param {Matcher<T>} matchers
|
|
16
|
+
* @return {Matcher<T>}
|
|
17
|
+
*/
|
|
13
18
|
export function anyOf(...matchers) {
|
|
14
19
|
return new AnyOf(matchers);
|
|
15
20
|
}
|
|
16
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @template T
|
|
24
|
+
* @param {Matcher<T>} matchers
|
|
25
|
+
* @return {Matcher<T>}
|
|
26
|
+
*/
|
|
17
27
|
export function allOf(...matchers) {
|
|
18
28
|
return new AllOf(matchers);
|
|
19
29
|
}
|