socket-function 0.151.0 → 0.152.0
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 +1 -1
- package/src/misc.ts +4 -0
package/package.json
CHANGED
package/src/misc.ts
CHANGED
|
@@ -77,6 +77,7 @@ export function recursiveFreeze<T>(obj: T): T {
|
|
|
77
77
|
if (!canHaveChildren(obj)) return;
|
|
78
78
|
if (visited.has(obj)) return;
|
|
79
79
|
visited.add(obj);
|
|
80
|
+
if (ArrayBuffer.isView(obj)) return;
|
|
80
81
|
Object.freeze(obj);
|
|
81
82
|
let keys = getKeys(obj);
|
|
82
83
|
for (let key of keys) {
|
|
@@ -338,6 +339,9 @@ export class QueueLimited<T> {
|
|
|
338
339
|
export function binarySearchBasic<T, V>(array: T[], getVal: (val: T) => V, searchValue: V): number {
|
|
339
340
|
return binarySearchIndex(array.length, i => compare(getVal(array[i]), searchValue));
|
|
340
341
|
}
|
|
342
|
+
export function binarySearchBasic2<T, V>(array: T[], getVal: (val: T) => V, searchValue: T): number {
|
|
343
|
+
return binarySearchIndex(array.length, i => compare(getVal(array[i]), getVal(searchValue)));
|
|
344
|
+
}
|
|
341
345
|
|
|
342
346
|
/**
|
|
343
347
|
* Searches indexes, allowing you to query structures that aren't arrays. To search an array, use:
|