Skip to content

Releases: CGJennings/fast-ternary-string-set

Version 2.4.0

08 Feb 05:23
Compare
Choose a tag to compare

Features

The library can now be used seamlessly as either an ES6 (import) or CommonJS (require) module. In addition to standard tool chains, you can also load the ES6 module directly into a Web page via CDN by importing from https://unpkg.com/fast-ternary-string-set.

These changes should be transparent to users of the library.

Version 2.3.0

02 Dec 07:24
Compare
Choose a tag to compare

Features

Adds several methods based on proposed changes to ECMAScript Sets: filter, map, find, some, every, reduce, join, addAll, and deleteAll.

Note that addAll is not a new method, but this version accepts the new signature addAll(...strings: string[]) in addition to the existing signtature addAll(strings: string[], start?: number, end?: number). To maximize interoperabilty with Sets , it is recommeded to use the new signature unless you are explicitly adding a subarray.

Version 2.2.0

16 Nov 20:22
Compare
Choose a tag to compare

Features

  • Added getRegexMatchesOf() to list strings matching a regular expression (optimized to only search the relevant subtree where possible).
  • Added getMatchesOf() to list strings matching an arbitrary predicate function. It is equivalent to (but more performant than) [...set].filter(predicate).

Changes

  • To align with proposed new methods for ECMAScript Sets, the subtract() operation has been renamed to difference(). For compatibility, subtract() will be retained until version 3. The behaviour of both methods is currently identical, but in future difference() will be broadened to accept any iterable and not just another TernaryStringSet.

Version 2.1.1

05 Nov 16:44
Compare
Choose a tag to compare

Fix

The methods equals(), isSubsetOf(), and isSupersetOf() did not terminate as quickly as they should have in some cases.

Version 2.1.0

24 Oct 22:51
Compare
Choose a tag to compare

Features

  • Added getWithinEditDistance() approximate matching (Levenshtein distance).
  • Added getCompletedBy() approximate matching (matches a suffix, to complement getCompletionsOf()).
  • When addAll() fails due to a bad element, the error message reports the bad index.
  • The addAll() and clear() methods return the set to match behaviour of add().
  • Updated serialization format to produce smaller files; see README for format details. Backwards compatible with previous versions.

Version 2.0.0

17 Oct 09:01
Compare
Choose a tag to compare

Features

  • Added getCompletionsOf() to find all members that start with a given string.
  • Added compact() which significantly reduces typical set sizes by sharing suffix nodes.
  • Constructor now takes an optional Iterable<string> to populate the set.
  • Added common set relations (equals(), isSubset(), isSuperset()).
  • Added common set operations (union(), intersect(), subtract(), symmetricDifference()).
  • Added toArray(), which is equivalent to [...set] or Array.from(set), but more efficient.
  • Serialized buffers support compacted sets and will use 16-bit branch pointers (instead of 32-bit) when possible. Backwards compatible with version 1 buffers.

Fixes

  • Empty string was not passed to forEach callback when present in set.

Other changes

  • Default tsconfig.json now targets ES2020.
  • Temporarily replaced #private class properties until language support catches up.

Compatibilty

Switching from version 1 to version 2 should not require changes to existing code. However, since the default configuration now targets ES2020, you may need to update your tools or build steps accordingly.

Version 1.1.0

13 Oct 10:35
Compare
Choose a tag to compare

The size() method now runs in constant time.

Version 1.0.3

13 Oct 10:34
Compare
Choose a tag to compare

Adds additional test cases.

Fixes a bug occuring when Hamming-distance approximate matches involve an empty string.

Version 1.0.2

13 Oct 10:33
Compare
Choose a tag to compare
v1.0.2

1.0.2