@svta/cml-utils changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
Changed
decodeBase64andencodeTextnow returnUint8Array<ArrayBuffer>. The result passes to Web APIs such ascrypto.subtle.digestwithout a cast under TypeScript 6 and later. The type declarations now need TypeScript 5.7 or later.- The README now has a When to use section. The section names the tasks that the package covers and the entry point of each task.
1.6.2 - 2026-10-18
Changed
urlToRelativePathno longer throws and catches aTypeErrorfor a relativeurl. A call with a relativeurlnow runs about 100 times faster in Node.js. CMCD encoding callsurlToRelativePathfornorvalues when thebaseUrloption is set. The output does not change.
1.6.1 - 2026-09-15
Changed
- TSDoc: the comment prose is rewritten for readers who do not read English as a first language. Signatures, examples, tags, and links are unchanged.
- README: the usage example prints its results instead of calling an undefined
assert. Several of those calls compared typed arrays with===.
Fixed
urlToRelativePathremoves every shared leading path segment. A base directory such as/v/1080p/returned../1080p/seg-2.m4sfor a target in the same directory. The correct result isseg-2.m4s. A path that diverged and matched again deeper resolved to a wrong URLurlToRelativePathadds a./prefix when the result is empty, starts with/, or has:in its first segment. Without the prefix, the reference resolved to a wrong URL (RFC 3986 section 4.2)encodeBase64encodes inputs of any length. Before this change, it spread every byte into oneString.fromCharCodecall, which threwRangeError: Maximum call stack size exceededat about 125 KB. It now converts the bytes in 32 KB chunks, which also runs about four times faster on small inputs. The output does not change.
1.6.0 - 2026-07-28
Added
DeepReadonly<T>— marks every property ofTasreadonly, recursively.Readonly<T>stops at the top level, so a nested object stays writable andvalue.nested.field = …still compiles; this applies at every depth, including through arrays. Functions are left unchanged so callbacks carried on a value stay callable, and primitives are returned as they are
1.5.1 - 2026-07-21
Fixed
uuidno longer falls back toMath.random: whencrypto.randomUUIDis unavailable it derives the UUID fromcrypto.getRandomValueswith RFC 4122 version/variant bits, keeping the blob-URL trick only as a last resort (#388)
1.5.0 - 2026-05-13
Added
- Add
getBaseUrl(fullUrl)to extract the origin and directory path from a full URL
Fixed
urlToRelativePathnow returns the input unchanged when it is already a relative path, instead of throwingTypeError: Invalid URL(#364)
1.4.0 - 2026-02-11
Added
- Add
isArrayBufferLiketype guard utility function
Fixed
- Loosen typed array generic parameters in
decodeTextandstringToUint16
1.3.0 - 2026-02-04
Added
- Add
HttpResponsetype - Add
HttpRequesttype - Add
ResponseTypeMaptype - Add
XmlNodetype - Add
streamresponse type toRequestResponseType
Changed
- Rename
RequestTypetoRequestResponseType - Rename
RequesttoHttpRequest - Deprecate
Requesttype
1.2.0 - 2026-02-03
Added
- Add
ExclusiveRecordtype for creating records with exclusive keys
1.1.0 - 2025-12-26
Added
- Add encodeText function to @svta/cml-utils (#279)
1.0.1 - 2025-12-22
Fixed
- Use fixed version numbers for all CML peer dependencies (#277)