collection-utils
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -50,2 +50,3 @@ export declare const hashCodeInit = 17; | ||
export declare function mapMapSync<K, V, W>(m: Iterable<[K, V]>, f: (v: V, k: K) => Promise<W>): Promise<Map<K, W>>; | ||
export declare function setIsSuperset<T>(set: ReadonlySet<T>, subset: ReadonlySet<T>): boolean; | ||
export declare function setUnionManyInto<T>(dest: Set<T>, srcs: Iterable<Iterable<T>>): Set<T>; | ||
@@ -52,0 +53,0 @@ export declare function setUnionInto<T>(dest: Set<T>, ...srcs: Iterable<T>[]): Set<T>; |
@@ -17,3 +17,3 @@ "use strict"; | ||
const chr = str.charCodeAt(i); | ||
hash = ((hash << 5) - hash) + chr; | ||
hash = (hash << 5) - hash + chr; | ||
hash = hash & hash; // Convert to 32bit integer | ||
@@ -359,2 +359,11 @@ } | ||
exports.mapMapSync = mapMapSync; | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set | ||
function setIsSuperset(set, subset) { | ||
for (const elem of subset) { | ||
if (!set.has(elem)) | ||
return false; | ||
} | ||
return true; | ||
} | ||
exports.setIsSuperset = setIsSuperset; | ||
function setUnionManyInto(dest, srcs) { | ||
@@ -361,0 +370,0 @@ for (const src of srcs) { |
{ | ||
"name": "collection-utils", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Utility functions for Javascript collections", | ||
@@ -16,4 +16,4 @@ "repository": "https://github.com/quicktype/collection-utils", | ||
"devDependencies": { | ||
"tslint": "^5.10.0", | ||
"typescript": "^2.8.3" | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.0.3" | ||
}, | ||
@@ -20,0 +20,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
47673
647