Comparing version 2.1.0 to 2.1.1
@@ -14,5 +14,5 @@ import { DateSpan } from "./DateSpan"; | ||
function toMilliseconds(value: TimeSpan, round?: Round): number; | ||
function add(value: TimeSpan, addend: TimeSpan): TimeSpan; | ||
function add(...addends: TimeSpan[]): TimeSpan; | ||
} | ||
type Round = "round" | "floor" | "ceiling"; | ||
export {}; |
@@ -61,4 +61,4 @@ "use strict"; | ||
TimeSpan.toMilliseconds = toMilliseconds; | ||
function add(value, addend) { | ||
return Object.entries(addend).reduce((result, [key, value]) => { var _a; return Object.assign(result, { [key]: ((_a = result[key]) !== null && _a !== void 0 ? _a : 0) + value }); }, Object.assign({}, value)); | ||
function add(...addends) { | ||
return addends.reduce((result, addend) => Object.entries(addend).reduce((result, [key, addend]) => { var _a; return Object.assign(result, { [key]: ((_a = result[key]) !== null && _a !== void 0 ? _a : 0) + addend }); }, result), {}); | ||
} | ||
@@ -65,0 +65,0 @@ TimeSpan.add = add; |
@@ -14,5 +14,5 @@ import { DateSpan } from "./DateSpan"; | ||
function toMilliseconds(value: TimeSpan, round?: Round): number; | ||
function add(value: TimeSpan, addend: TimeSpan): TimeSpan; | ||
function add(...addends: TimeSpan[]): TimeSpan; | ||
} | ||
type Round = "round" | "floor" | "ceiling"; | ||
export {}; |
@@ -54,4 +54,4 @@ export var TimeSpan; | ||
TimeSpan.toMilliseconds = toMilliseconds; | ||
function add(value, addend) { | ||
return Object.entries(addend).reduce((result, [key, value]) => Object.assign(result, { [key]: (result[key] ?? 0) + value }), { ...value }); | ||
function add(...addends) { | ||
return addends.reduce((result, addend) => Object.entries(addend).reduce((result, [key, addend]) => Object.assign(result, { [key]: (result[key] ?? 0) + addend }), result), {}); | ||
} | ||
@@ -58,0 +58,0 @@ TimeSpan.add = add; |
{ | ||
"name": "isoly", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -5,0 +5,0 @@ "author": "Utily Contributors", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1854165