@fable-org/fable-library-ts 2.0.0-beta.3 → 2.0.0-beta.5

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.
Files changed (55) hide show
  1. package/Array.ts +1385 -1378
  2. package/Async.ts +13 -12
  3. package/AsyncBuilder.ts +10 -11
  4. package/BigInt.ts +6 -6
  5. package/BitConverter.ts +3 -3
  6. package/Boolean.ts +3 -2
  7. package/CHANGELOG.md +12 -0
  8. package/Char.ts +38 -35
  9. package/Choice.ts +326 -301
  10. package/CollectionUtil.ts +4 -4
  11. package/Date.ts +67 -62
  12. package/DateOffset.ts +48 -57
  13. package/DateOnly.ts +8 -8
  14. package/Decimal.ts +9 -9
  15. package/Double.ts +3 -2
  16. package/Encoding.ts +1 -1
  17. package/Event.ts +3 -3
  18. package/FSharp.Collections.ts +53 -34
  19. package/FSharp.Core.CompilerServices.ts +38 -37
  20. package/FSharp.Core.ts +186 -185
  21. package/Global.ts +80 -37
  22. package/Guid.ts +7 -6
  23. package/Int32.ts +20 -17
  24. package/List.ts +1429 -1417
  25. package/Long.ts +6 -5
  26. package/MailboxProcessor.ts +8 -7
  27. package/Map.ts +1550 -1552
  28. package/MapUtil.ts +5 -5
  29. package/MutableMap.ts +358 -345
  30. package/MutableSet.ts +250 -249
  31. package/Native.ts +19 -11
  32. package/Numeric.ts +1 -1
  33. package/Observable.ts +3 -3
  34. package/Option.ts +10 -4
  35. package/Random.ts +196 -194
  36. package/Range.ts +57 -56
  37. package/Reflection.ts +73 -40
  38. package/RegExp.ts +5 -3
  39. package/Result.ts +201 -196
  40. package/Seq.ts +1517 -1525
  41. package/Seq2.ts +130 -129
  42. package/Set.ts +1955 -1955
  43. package/String.ts +41 -38
  44. package/System.Collections.Generic.ts +401 -380
  45. package/System.Text.ts +204 -203
  46. package/System.ts +366 -0
  47. package/TimeOnly.ts +10 -10
  48. package/TimeSpan.ts +11 -11
  49. package/Timer.ts +2 -2
  50. package/Types.ts +1 -19
  51. package/Uri.ts +13 -10
  52. package/Util.ts +77 -21
  53. package/package.json +22 -22
  54. package/tsconfig.json +18 -5
  55. package/SystemException.ts +0 -7
package/MapUtil.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { equals, IMap, IMapOrWeakMap, ISet } from "./Util.js";
2
- import { FSharpRef, Union } from "./Types.js";
1
+ import { Exception, equals, IMap, IMapOrWeakMap, ISet } from "./Util.ts";
2
+ import { FSharpRef, Union } from "./Types.ts";
3
3
 
4
4
  const CaseRules = {
5
5
  None: 0,
@@ -39,7 +39,7 @@ export function keyValueList(fields: Iterable<any>, caseRule = CaseRules.None) {
39
39
  const definedCaseRule = caseRule;
40
40
 
41
41
  function fail(kvPair: any) {
42
- throw new Error("Cannot infer key and value of " + String(kvPair));
42
+ throw new Exception("Cannot infer key and value of " + String(kvPair));
43
43
  }
44
44
  function assign(key: string, caseRule: number, value: any) {
45
45
  key = changeCase(key, caseRule);
@@ -117,7 +117,7 @@ export function tryAddToDict<K, V>(dict: IMapOrWeakMap<K, V>, k: K, v: V) {
117
117
 
118
118
  export function addToDict<K, V>(dict: IMapOrWeakMap<K, V>, k: K, v: V) {
119
119
  if (dict.has(k)) {
120
- throw new Error("An item with the same key has already been added. Key: " + k);
120
+ throw new Exception("An item with the same key has already been added. Key: " + k);
121
121
  }
122
122
  dict.set(k, v);
123
123
  }
@@ -126,7 +126,7 @@ export function getItemFromDict<K, V>(map: IMap<K, V>, key: K) {
126
126
  if (map.has(key)) {
127
127
  return map.get(key) as V;
128
128
  } else {
129
- throw new Error(`The given key '${key}' was not present in the dictionary.`);
129
+ throw new Exception(`The given key '${key}' was not present in the dictionary.`);
130
130
  }
131
131
  }
132
132