@fp-ts/data
Advanced tools
Comparing version 0.0.38 to 0.0.39
12
Chunk.js
@@ -102,2 +102,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `Chunk(${this.toReadonlyArray().map(String).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "Chunk", | ||
values: this.toReadonlyArray() | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
isNonEmpty() { | ||
@@ -104,0 +116,0 @@ return this.length > 0; |
@@ -93,2 +93,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `HashMap(${Array.from(this).map(([k, v]) => `[${String(k)}, ${String(v)}]`).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "HashMap", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -95,0 +107,0 @@ exports.HashMapImpl = HashMapImpl; |
@@ -57,2 +57,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `HashSet(${Array.from(this).map(String).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "HashSet", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -59,0 +71,0 @@ exports.HashSetImpl = HashSetImpl; |
@@ -14,4 +14,9 @@ import type * as Order from "@fp-ts/core/typeclass/Order"; | ||
[Symbol.iterator](): RedBlackTreeIterator<K, V>; | ||
toString(): string; | ||
toJSON(): { | ||
_tag: string; | ||
values: (readonly [K, V])[]; | ||
}; | ||
} | ||
export declare function isRedBlackTree(u: unknown): u is RBT.RedBlackTree<unknown, unknown>; | ||
//# sourceMappingURL=RedBlackTree.d.ts.map |
@@ -74,2 +74,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `RedBlackTree(${Array.from(this).map(([k, v]) => `[${String(k)}, ${String(v)}]`).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "RedBlackTree", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -76,0 +88,0 @@ exports.RedBlackTreeImpl = RedBlackTreeImpl; |
@@ -72,2 +72,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `MutableHashMap(${Array.from(this).map(([k, v]) => `[${String(k)}, ${String(v)}]`).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableHashMap", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -74,0 +86,0 @@ /** |
@@ -35,2 +35,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `MutableHashSet(${Array.from(this).map(String).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableHashSet", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -37,0 +49,0 @@ /** |
@@ -59,2 +59,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `MutableList(${Array.from(this).map(String).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableList", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -61,0 +73,0 @@ /** @internal */ |
@@ -40,2 +40,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `MutableQueue(${Array.from(this).map(String).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableQueue", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -42,0 +54,0 @@ /** |
@@ -62,2 +62,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `MutableRef(${String(this.current)})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableRef", | ||
current: this.current | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -64,0 +76,0 @@ /** |
{ | ||
"name": "@fp-ts/data", | ||
"version": "0.0.38", | ||
"version": "0.0.39", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -33,2 +33,14 @@ "use strict"; | ||
} | ||
toString() { | ||
return `SortedMap(${Array.from(this).map(([k, v]) => `[${String(k)}, ${String(v)}]`).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "SortedMap", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -35,0 +47,0 @@ /** |
@@ -35,2 +35,7 @@ /** | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
export declare const from: <K>(ord: Order<K>) => (iterable: Iterable<K>) => SortedSet<K>; | ||
/** | ||
* @since 1.0.0 | ||
* @category getters | ||
@@ -37,0 +42,0 @@ */ |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.values = exports.union = exports.toggle = exports.some = exports.size = exports.remove = exports.partition = exports.map = exports.isSubset = exports.isSortedSet = exports.intersection = exports.has = exports.forEach = exports.flatMap = exports.filter = exports.every = exports.empty = exports.difference = exports.add = void 0; | ||
exports.values = exports.union = exports.toggle = exports.some = exports.size = exports.remove = exports.partition = exports.map = exports.isSubset = exports.isSortedSet = exports.intersection = exports.has = exports.from = exports.forEach = exports.flatMap = exports.filter = exports.every = exports.empty = exports.difference = exports.add = void 0; | ||
var Eq = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Equal")); | ||
@@ -33,2 +33,14 @@ var _Function = /*#__PURE__*/require("@fp-ts/data/Function"); | ||
} | ||
toString() { | ||
return `SortedSet(${Array.from(this).map(String).join(", ")})`; | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "SortedSet", | ||
values: Array.from(this) | ||
}; | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON(); | ||
} | ||
} | ||
@@ -48,5 +60,11 @@ /** | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
exports.empty = empty; | ||
const from = ord => iterable => new SortedSetImpl(RBT.from(ord)(Array.from(iterable).map(k => [k, true]))); | ||
/** | ||
* @since 1.0.0 | ||
* @category getters | ||
*/ | ||
exports.empty = empty; | ||
exports.from = from; | ||
const values = self => RBT.keys()(self.keyTree); | ||
@@ -53,0 +71,0 @@ /** |
@@ -226,2 +226,17 @@ /** | ||
toString() { | ||
return `Chunk(${this.toReadonlyArray().map(String).join(", ")})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "Chunk", | ||
values: this.toReadonlyArray() | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
isNonEmpty(this: Chunk<A>): this is NonEmptyChunk<A> { | ||
@@ -228,0 +243,0 @@ return this.length > 0 |
@@ -39,5 +39,7 @@ import * as Equal from "@fp-ts/data/Equal" | ||
) {} | ||
[Symbol.iterator](): Iterator<readonly [K, V]> { | ||
return new HashMapIterator(this, (k, v) => [k, v]) | ||
} | ||
[Equal.symbolHash](): number { | ||
@@ -73,2 +75,17 @@ let hash = Equal.hash("HashMap") | ||
} | ||
toString() { | ||
return `HashMap(${Array.from(this).map(([k, v]) => `[${String(k)}, ${String(v)}]`).join(", ")})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "HashMap", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -75,0 +92,0 @@ |
@@ -33,2 +33,17 @@ import * as Equal from "@fp-ts/data/Equal" | ||
} | ||
toString() { | ||
return `HashSet(${Array.from(this).map(String).join(", ")})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "HashSet", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -35,0 +50,0 @@ |
@@ -46,2 +46,19 @@ import type * as Order from "@fp-ts/core/typeclass/Order" | ||
} | ||
toString() { | ||
return `RedBlackTree(${ | ||
Array.from(this).map(([k, v]) => `[${String(k)}, ${String(v)}]`).join(", ") | ||
})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "RedBlackTree", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -48,0 +65,0 @@ |
@@ -64,2 +64,3 @@ /** | ||
readonly backingMap = new Map<number, Node<K, V>>() | ||
length = 0; | ||
@@ -87,2 +88,19 @@ | ||
} | ||
toString() { | ||
return `MutableHashMap(${ | ||
Array.from(this).map(([k, v]) => `[${String(k)}, ${String(v)}]`).join(", ") | ||
})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableHashMap", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -89,0 +107,0 @@ |
@@ -49,2 +49,17 @@ /** | ||
} | ||
toString() { | ||
return `MutableHashSet(${Array.from(this).map(String).join(", ")})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableHashSet", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -51,0 +66,0 @@ |
@@ -68,2 +68,17 @@ /** | ||
} | ||
toString() { | ||
return `MutableList(${Array.from(this).map(String).join(", ")})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableList", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -70,0 +85,0 @@ |
@@ -63,2 +63,17 @@ /** | ||
} | ||
toString() { | ||
return `MutableQueue(${Array.from(this).map(String).join(", ")})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableQueue", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -65,0 +80,0 @@ |
@@ -134,2 +134,17 @@ /** | ||
} | ||
toString() { | ||
return `MutableRef(${String(this.current)})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "MutableRef", | ||
current: this.current | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -136,0 +151,0 @@ |
@@ -46,2 +46,19 @@ /** | ||
} | ||
toString() { | ||
return `SortedMap(${ | ||
Array.from(this).map(([k, v]) => `[${String(k)}, ${String(v)}]`).join(", ") | ||
})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "SortedMap", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -48,0 +65,0 @@ |
@@ -46,2 +46,17 @@ /** | ||
} | ||
toString() { | ||
return `SortedSet(${Array.from(this).map(String).join(", ")})` | ||
} | ||
toJSON() { | ||
return { | ||
_tag: "SortedSet", | ||
values: Array.from(this) | ||
} | ||
} | ||
[Symbol.for("nodejs.util.inspect.custom")]() { | ||
return this.toJSON() | ||
} | ||
} | ||
@@ -67,2 +82,12 @@ | ||
* @since 1.0.0 | ||
* @category constructors | ||
*/ | ||
export const from = <K>(ord: Order<K>) => | ||
( | ||
iterable: Iterable<K> | ||
): SortedSet<K> => | ||
new SortedSetImpl(RBT.from<K, boolean>(ord)(Array.from(iterable).map((k) => [k, true]))) | ||
/** | ||
* @since 1.0.0 | ||
* @category getters | ||
@@ -69,0 +94,0 @@ */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2372471
54519