@fastly/js-compute
Advanced tools
Changelog
3.13.0 (2024-04-11)
arguments.length
to avoid allocating the arguments
object.
- An optimization for Object.HasOwn
which for small numbers of atoms just unrolls the loop.checkCertificate
field (62fd0ea)Changelog
3.12.0 (2024-03-28)
JSON.stringify()
Object.keys()
to take advantage of cached for-in iterators if available.Object.assign()
v
flag supportString.prototype.isWellFormed()
and String.prototype.toWellFormed()
methods respectively can be used to check if a string contains well-formed Unicode text (i.e. contains no lone surrogates) and sanitise an ill-formed string to well-formed Unicode text.Object.groupBy()
and Map.groupBy()
static methods for grouping the elements of an iterable are now supportedDate.parse()
now accepts several additional date formats:
YYYY-MMM-DD
format (e.g. 19999-Jan-01
)MMM-DD-YYYY
(e.g. Jan-01-1970
)Jan 1 1970 10:00:00.050
)Wed, 1970-01-01
Wed, 1970-Jan-01
foo 1970-01-01
works."01-12-1999"
(month first)"1999-1-5"
(single-digit month or day)"10000-01-12"
(year > 9999)"99-01-05"
or "01-05-99"
(2-digit year, year must be >31 if it comes first)"1999-01-05 10:00:00"
(space between date and time).
These dates will be parsed with behavior typical of other non-ISO dates, such as local time zone and month rollover (April 31 rolls over to May 1 since April 31 doesn’t exist)."DDMonYYYY"
"Mon.DD.YYYY"
"DD.Mon.YYYY"
"YYYY.MM.DD"
"Mon DD YYYY hh:mmXm"
(am
/pm
directly following time)'Z'
is now accepted for non-ISO formats (e.g. Jan 1 1970 10:00Z
)Date.parse()
fixes:
YYYY-M-DD
and YYYY-MM-D
are no longer assumed GMT as an ISO date YYYY-MM-DD
would be.Promise.withResolvers()
static method is now supported. This exposes the resolve
and reject
callback functions in the same scope as the returned Promise
, allowing code that resolves or rejects the promise to be defined after its construction.ArrayBuffer.prototype.transfer()
and ArrayBuffer.prototype.transferToFixedLength()
methods can now be used to transfer ownership of memory from one ArrayBuffer to another. After transfer, the original buffer is detached from its original memory and hence unusable; the state can be checked using ArrayBuffer.prototype.detached
.