Skip to content

@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 ​

  • decodeBase64 and encodeText now return Uint8Array<ArrayBuffer>. The result passes to Web APIs such as crypto.subtle.digest without 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 ​

  • urlToRelativePath no longer throws and catches a TypeError for a relative url. A call with a relative url now runs about 100 times faster in Node.js. CMCD encoding calls urlToRelativePath for nor values when the baseUrl option 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 ​

  • urlToRelativePath removes every shared leading path segment. A base directory such as /v/1080p/ returned ../1080p/seg-2.m4s for a target in the same directory. The correct result is seg-2.m4s. A path that diverged and matched again deeper resolved to a wrong URL
  • urlToRelativePath adds 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)
  • encodeBase64 encodes inputs of any length. Before this change, it spread every byte into one String.fromCharCode call, which threw RangeError: Maximum call stack size exceeded at 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 of T as readonly, recursively. Readonly<T> stops at the top level, so a nested object stays writable and value.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 ​

  • uuid no longer falls back to Math.random: when crypto.randomUUID is unavailable it derives the UUID from crypto.getRandomValues with 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 ​

  • urlToRelativePath now returns the input unchanged when it is already a relative path, instead of throwing TypeError: Invalid URL (#364)

1.4.0 - 2026-02-11 ​

Added ​

  • Add isArrayBufferLike type guard utility function

Fixed ​

  • Loosen typed array generic parameters in decodeText and stringToUint16

1.3.0 - 2026-02-04 ​

Added ​

  • Add HttpResponse type
  • Add HttpRequest type
  • Add ResponseTypeMap type
  • Add XmlNode type
  • Add stream response type to RequestResponseType

Changed ​

  • Rename RequestType to RequestResponseType
  • Rename Request to HttpRequest
  • Deprecate Request type

1.2.0 - 2026-02-03 ​

Added ​

  • Add ExclusiveRecord type 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)

1.0.0 - 2025-10-24 ​

Changed ​

  • Remove CommonJS exports (#192)
  • Convert to mono-repo (#238)
  • Produce single bundled export for each package (#260)

A Streaming Video Technology Alliance project.