@fable-org/fable-library-ts 1.2.0 → 1.3.0

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/Boolean.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { FSharpRef } from "./Types.js"
2
2
 
3
3
  export function tryParse(str: string, defValue: FSharpRef<boolean>): boolean {
4
- if (str.match(/^\s*true\s*$/i)) {
4
+ if (str != null && str.match(/^\s*true\s*$/i)) {
5
5
  defValue.contents = true;
6
6
  return true;
7
- } else if (str.match(/^\s*false\s*$/i)) {
7
+ } else if (str != null && str.match(/^\s*false\s*$/i)) {
8
8
  defValue.contents = false;
9
9
  return true;
10
10
  }
package/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 1.3.0 - 2024-03-18
11
+
12
+ * [JS/TS] `Boolean.tryParse` should not crash on `null` string (@goswinr)
13
+
10
14
  ## 1.2.0 - 2024-03-01
11
15
 
12
16
  ### Fixed
package/Date.ts CHANGED
@@ -710,7 +710,7 @@ export function dayOfYear(d: IDateTime) {
710
710
 
711
711
  export function add(d: IDateTime, ts: number) {
712
712
  const newDate = DateTime(d.getTime() + ts, d.kind);
713
- if (d.kind === DateKind.Local) {
713
+ if (d.kind !== DateKind.UTC) {
714
714
  const oldTzOffset = d.getTimezoneOffset();
715
715
  const newTzOffset = newDate.getTimezoneOffset();
716
716
  return oldTzOffset !== newTzOffset
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "name": "@fable-org/fable-library-ts",
6
- "version": "1.2.0",
6
+ "version": "1.3.0",
7
7
  "description": "Core library used by F# projects compiled with fable.io",
8
8
  "author": "Fable Contributors",
9
9
  "license": "MIT",