@fable-org/fable-library-ts 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/Date.ts +0 -1
- package/Decimal.ts +6 -6
- package/RegExp.ts +0 -1
- package/TimeSpan.ts +0 -1
- package/Types.ts +1 -1
- package/Uri.ts +0 -1
- package/Util.ts +0 -2
- package/lib/big.js +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/Date.ts
CHANGED
|
@@ -524,7 +524,6 @@ export function parseRaw(input: string): [Date, Offset] {
|
|
|
524
524
|
|
|
525
525
|
if (isNaN(date.getTime())) {
|
|
526
526
|
// Try to check strings JS Date cannot parse (see #1045, #1422)
|
|
527
|
-
// tslint:disable-next-line:max-line-length
|
|
528
527
|
const m = /^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(input);
|
|
529
528
|
if (m != null) {
|
|
530
529
|
let baseDate: Date;
|
package/Decimal.ts
CHANGED
|
@@ -44,16 +44,16 @@ export function equals(x: Decimal, y: Decimal) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export function abs(x: Decimal) { return x.abs(); }
|
|
47
|
-
export function sign(x: Decimal): number { return x
|
|
47
|
+
export function sign(x: Decimal): number { return x.lt(get_Zero) ? -1 : x.gt(get_Zero) ? 1 : 0; }
|
|
48
48
|
|
|
49
|
-
export function max(x: Decimal, y: Decimal): Decimal { return x
|
|
50
|
-
export function min(x: Decimal, y: Decimal): Decimal { return x
|
|
49
|
+
export function max(x: Decimal, y: Decimal): Decimal { return x.gt(y) ? x : y; }
|
|
50
|
+
export function min(x: Decimal, y: Decimal): Decimal { return x.lt(y) ? x : y; }
|
|
51
51
|
|
|
52
|
-
export function maxMagnitude(x: Decimal, y: Decimal): Decimal { return abs(x)
|
|
53
|
-
export function minMagnitude(x: Decimal, y: Decimal): Decimal { return abs(x)
|
|
52
|
+
export function maxMagnitude(x: Decimal, y: Decimal): Decimal { return abs(x).gt(abs(y)) ? x : y; }
|
|
53
|
+
export function minMagnitude(x: Decimal, y: Decimal): Decimal { return abs(x).lt(abs(y)) ? x : y; }
|
|
54
54
|
|
|
55
55
|
export function clamp(x: Decimal, min: Decimal, max: Decimal): Decimal {
|
|
56
|
-
return x
|
|
56
|
+
return x.lt(min) ? min : x.gt(max) ? max : x;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export function round(x: Decimal, digits: number = 0) {
|
package/RegExp.ts
CHANGED
|
@@ -48,7 +48,6 @@ export function matches(reg: RegExp, input: string, startAt = 0) {
|
|
|
48
48
|
const matches: RegExpExecArray[] = [];
|
|
49
49
|
let m: RegExpExecArray | null;
|
|
50
50
|
let lastMatchIndex = -1;
|
|
51
|
-
// tslint:disable-next-line:no-conditional-assignment
|
|
52
51
|
while ((m = reg.exec(input)) != null) {
|
|
53
52
|
// It can happen even global regex get stuck, see #2845
|
|
54
53
|
if (m.index === lastMatchIndex) {
|
package/TimeSpan.ts
CHANGED
package/Types.ts
CHANGED
|
@@ -199,7 +199,7 @@ export function isPromise(x: any) {
|
|
|
199
199
|
return x instanceof Promise;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
export function ensureErrorOrException(e: any) {
|
|
202
|
+
export function ensureErrorOrException(e: any): any {
|
|
203
203
|
// Exceptionally admitting promises as errors for compatibility with React.suspense (see #3298)
|
|
204
204
|
return (isException(e) || isPromise(e)) ? e : new Error(String(e));
|
|
205
205
|
}
|
package/Uri.ts
CHANGED
package/Util.ts
CHANGED
package/lib/big.js
CHANGED
package/package.json
CHANGED