Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tempo-monorepo",
"version": "3.6.0",
"version": "3.6.1",
"private": true,
"engines": {
"node": ">=20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magmacomputing/library",
"version": "3.6.0",
"version": "3.6.1",
"description": "Shared utility library for Tempo",
"author": "Magma Computing Solutions",
"license": "MIT",
Expand Down
5 changes: 5 additions & 0 deletions packages/tempo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.6.1] - 2026-07-06

### Fixed
- **Constructor Shorthand Resolution**: Fixed a critical `TypeError: invalid duration-like` regression introduced in 3.6.0. The `Tempo` constructor now correctly maps shorthand duration objects (e.g., `{ mi: 5 }`) to their fully-qualified `Temporal` plural equivalents (`{ minutes: 5 }`) before evaluating them against the underlying engine.

## [3.6.0] - 2026-07-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/tempo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magmacomputing/tempo",
"version": "3.6.0",
"version": "3.6.1",
"engines": {
"node": ">=20.0.0"
},
Expand Down
21 changes: 18 additions & 3 deletions packages/tempo/src/tempo.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1661,9 +1661,24 @@ export class Tempo {
// preserve parse result history when creating new instance from an existing one
return [tempo, Object.assign({ result: [...tempo.parse.result] }, options)];

return this.#isOptions(tempo)
? [tempo.value, Object.assign({}, tempo)]
: [tempo, options];
let mappedTempo = tempo as t.DateTime;
if (isObject(tempo) && isDurationLike(tempo)) {
const record = { ...(tempo as unknown as Record<string, unknown>) };
let hasMapped = false;
for (const [k, v] of Object.entries(record)) {
const resolved = enums.ELEMENT.has(k) ? `${enums.ELEMENT[k as t.Element]}s` : undefined;
if (resolved) {
record[resolved] = v;
delete record[k];
hasMapped = true;
}
}
if (hasMapped) mappedTempo = record as t.DateTime;
}

return this.#isOptions(mappedTempo)
? [mappedTempo.value, Object.assign({}, mappedTempo)]
: [mappedTempo, options];
}

/** check if we've been given a Tempo Options object */
Expand Down
2 changes: 1 addition & 1 deletion packages/tempo/src/tempo.version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* ⚠️ This file is auto-updated by `npm run build:version` (see `bin/update-version.mjs`).
* Do NOT edit manually — your changes will be overwritten on the next build.
*/
export const TEMPO_VERSION = '3.6.0';
export const TEMPO_VERSION = '3.6.1';
Loading