compostjs 0.0.11 → 0.1.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.
Files changed (143) hide show
  1. package/dist/compost.js +34 -28
  2. package/dist/core.js +94 -73
  3. package/dist/fable_modules/fable-library-js.4.28.0/Array.d.ts +123 -0
  4. package/dist/fable_modules/fable-library-js.4.28.0/Array.js +1242 -0
  5. package/dist/fable_modules/fable-library-js.4.28.0/Async.d.ts +26 -0
  6. package/dist/fable_modules/fable-library-js.4.28.0/Async.js +145 -0
  7. package/dist/fable_modules/fable-library-js.4.28.0/AsyncBuilder.d.ts +59 -0
  8. package/dist/fable_modules/fable-library-js.4.28.0/AsyncBuilder.js +183 -0
  9. package/dist/fable_modules/fable-library-js.4.28.0/BigInt.d.ts +115 -0
  10. package/dist/fable_modules/fable-library-js.4.28.0/BigInt.js +283 -0
  11. package/dist/fable_modules/fable-library-js.4.28.0/BitConverter.d.ts +27 -0
  12. package/dist/fable_modules/fable-library-js.4.28.0/BitConverter.js +138 -0
  13. package/dist/fable_modules/fable-library-js.4.28.0/Boolean.d.ts +3 -0
  14. package/dist/fable_modules/fable-library-js.4.28.0/Boolean.js +21 -0
  15. package/dist/fable_modules/fable-library-js.4.28.0/CHANGELOG.md +100 -0
  16. package/dist/fable_modules/fable-library-js.4.28.0/Char.d.ts +65 -0
  17. package/dist/fable_modules/fable-library-js.4.28.0/Char.js +169 -0
  18. package/dist/fable_modules/fable-library-js.4.28.0/Choice.d.ts +121 -0
  19. package/dist/fable_modules/fable-library-js.4.28.0/Choice.js +184 -0
  20. package/dist/fable_modules/fable-library-js.4.28.0/CollectionUtil.d.ts +7 -0
  21. package/dist/fable_modules/fable-library-js.4.28.0/CollectionUtil.js +182 -0
  22. package/dist/fable_modules/fable-library-js.4.28.0/ConditionalWeakTable.d.ts +9 -0
  23. package/dist/fable_modules/fable-library-js.4.28.0/ConditionalWeakTable.js +21 -0
  24. package/dist/fable_modules/fable-library-js.4.28.0/Date.d.ts +70 -0
  25. package/dist/fable_modules/fable-library-js.4.28.0/Date.js +748 -0
  26. package/dist/fable_modules/fable-library-js.4.28.0/DateOffset.d.ts +63 -0
  27. package/dist/fable_modules/fable-library-js.4.28.0/DateOffset.js +268 -0
  28. package/dist/fable_modules/fable-library-js.4.28.0/DateOnly.d.ts +18 -0
  29. package/dist/fable_modules/fable-library-js.4.28.0/DateOnly.js +124 -0
  30. package/dist/fable_modules/fable-library-js.4.28.0/Decimal.d.ts +45 -0
  31. package/dist/fable_modules/fable-library-js.4.28.0/Decimal.js +212 -0
  32. package/dist/fable_modules/fable-library-js.4.28.0/Double.d.ts +11 -0
  33. package/dist/fable_modules/fable-library-js.4.28.0/Double.js +46 -0
  34. package/dist/fable_modules/fable-library-js.4.28.0/Encoding.d.ts +12 -0
  35. package/dist/fable_modules/fable-library-js.4.28.0/Encoding.js +173 -0
  36. package/dist/fable_modules/fable-library-js.4.28.0/Event.d.ts +31 -0
  37. package/dist/fable_modules/fable-library-js.4.28.0/Event.js +93 -0
  38. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Collections.d.ts +7 -0
  39. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Collections.js +27 -0
  40. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Core.CompilerServices.d.ts +12 -0
  41. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Core.CompilerServices.js +27 -0
  42. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Core.d.ts +17 -0
  43. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Core.js +69 -0
  44. package/dist/fable_modules/fable-library-js.4.28.0/Global.d.ts +24 -0
  45. package/dist/fable_modules/fable-library-js.4.28.0/Global.js +8 -0
  46. package/dist/fable_modules/fable-library-js.4.28.0/Guid.d.ts +10 -0
  47. package/dist/fable_modules/fable-library-js.4.28.0/Guid.js +142 -0
  48. package/dist/fable_modules/fable-library-js.4.28.0/Int32.d.ts +28 -0
  49. package/dist/fable_modules/fable-library-js.4.28.0/Int32.js +135 -0
  50. package/dist/fable_modules/fable-library-js.4.28.0/List.d.ts +143 -0
  51. package/dist/fable_modules/fable-library-js.4.28.0/List.js +1273 -0
  52. package/dist/fable_modules/fable-library-js.4.28.0/Long.d.ts +3 -0
  53. package/dist/fable_modules/fable-library-js.4.28.0/Long.js +46 -0
  54. package/dist/fable_modules/fable-library-js.4.28.0/MailboxProcessor.d.ts +25 -0
  55. package/dist/fable_modules/fable-library-js.4.28.0/MailboxProcessor.js +93 -0
  56. package/dist/fable_modules/fable-library-js.4.28.0/Map.d.ts +178 -0
  57. package/dist/fable_modules/fable-library-js.4.28.0/Map.js +1396 -0
  58. package/dist/fable_modules/fable-library-js.4.28.0/MapUtil.d.ts +12 -0
  59. package/dist/fable_modules/fable-library-js.4.28.0/MapUtil.js +127 -0
  60. package/dist/fable_modules/fable-library-js.4.28.0/MutableMap.d.ts +52 -0
  61. package/dist/fable_modules/fable-library-js.4.28.0/MutableMap.js +327 -0
  62. package/dist/fable_modules/fable-library-js.4.28.0/MutableSet.d.ts +39 -0
  63. package/dist/fable_modules/fable-library-js.4.28.0/MutableSet.js +233 -0
  64. package/dist/fable_modules/fable-library-js.4.28.0/Native.d.ts +2 -0
  65. package/dist/fable_modules/fable-library-js.4.28.0/Native.js +8 -0
  66. package/dist/fable_modules/fable-library-js.4.28.0/Numeric.d.ts +19 -0
  67. package/dist/fable_modules/fable-library-js.4.28.0/Numeric.js +71 -0
  68. package/dist/fable_modules/fable-library-js.4.28.0/Observable.d.ts +32 -0
  69. package/dist/fable_modules/fable-library-js.4.28.0/Observable.js +113 -0
  70. package/dist/fable_modules/fable-library-js.4.28.0/Option.d.ts +28 -0
  71. package/dist/fable_modules/fable-library-js.4.28.0/Option.js +96 -0
  72. package/dist/fable_modules/fable-library-js.4.28.0/README.md +3 -0
  73. package/dist/fable_modules/fable-library-js.4.28.0/Random.d.ts +37 -0
  74. package/dist/fable_modules/fable-library-js.4.28.0/Random.js +170 -0
  75. package/dist/fable_modules/fable-library-js.4.28.0/Range.d.ts +12 -0
  76. package/dist/fable_modules/fable-library-js.4.28.0/Range.js +45 -0
  77. package/dist/fable_modules/fable-library-js.4.28.0/Reflection.d.ts +119 -0
  78. package/dist/fable_modules/fable-library-js.4.28.0/Reflection.js +461 -0
  79. package/dist/fable_modules/fable-library-js.4.28.0/RegExp.d.ts +10 -0
  80. package/dist/fable_modules/fable-library-js.4.28.0/RegExp.js +131 -0
  81. package/dist/fable_modules/fable-library-js.4.28.0/Result.d.ts +37 -0
  82. package/dist/fable_modules/fable-library-js.4.28.0/Result.js +165 -0
  83. package/dist/fable_modules/fable-library-js.4.28.0/Seq.d.ts +165 -0
  84. package/dist/fable_modules/fable-library-js.4.28.0/Seq.js +1378 -0
  85. package/dist/fable_modules/fable-library-js.4.28.0/Seq2.d.ts +18 -0
  86. package/dist/fable_modules/fable-library-js.4.28.0/Seq2.js +111 -0
  87. package/dist/fable_modules/fable-library-js.4.28.0/Set.d.ts +190 -0
  88. package/dist/fable_modules/fable-library-js.4.28.0/Set.js +1789 -0
  89. package/dist/fable_modules/fable-library-js.4.28.0/String.d.ts +58 -0
  90. package/dist/fable_modules/fable-library-js.4.28.0/String.js +554 -0
  91. package/dist/fable_modules/fable-library-js.4.28.0/System.Collections.Generic.d.ts +79 -0
  92. package/dist/fable_modules/fable-library-js.4.28.0/System.Collections.Generic.js +317 -0
  93. package/dist/fable_modules/fable-library-js.4.28.0/System.Text.d.ts +38 -0
  94. package/dist/fable_modules/fable-library-js.4.28.0/System.Text.js +162 -0
  95. package/dist/fable_modules/fable-library-js.4.28.0/SystemException.d.ts +5 -0
  96. package/dist/fable_modules/fable-library-js.4.28.0/SystemException.js +5 -0
  97. package/dist/fable_modules/fable-library-js.4.28.0/TimeOnly.d.ts +15 -0
  98. package/dist/fable_modules/fable-library-js.4.28.0/TimeOnly.js +122 -0
  99. package/dist/fable_modules/fable-library-js.4.28.0/TimeSpan.d.ts +34 -0
  100. package/dist/fable_modules/fable-library-js.4.28.0/TimeSpan.js +177 -0
  101. package/dist/fable_modules/fable-library-js.4.28.0/Timer.d.ts +19 -0
  102. package/dist/fable_modules/fable-library-js.4.28.0/Timer.js +67 -0
  103. package/dist/fable_modules/fable-library-js.4.28.0/Types.d.ts +58 -0
  104. package/dist/fable_modules/fable-library-js.4.28.0/Types.js +208 -0
  105. package/dist/fable_modules/fable-library-js.4.28.0/Unicode.13.0.0.d.ts +2 -0
  106. package/dist/fable_modules/fable-library-js.4.28.0/Unicode.13.0.0.js +4 -0
  107. package/dist/fable_modules/fable-library-js.4.28.0/Uri.d.ts +31 -0
  108. package/dist/fable_modules/fable-library-js.4.28.0/Uri.js +159 -0
  109. package/dist/fable_modules/fable-library-js.4.28.0/Util.d.ts +210 -0
  110. package/dist/fable_modules/fable-library-js.4.28.0/Util.js +769 -0
  111. package/dist/fable_modules/fable-library-js.4.28.0/big.d.ts +338 -0
  112. package/dist/fable_modules/fable-library-js.4.28.0/lib/big.d.ts +5 -0
  113. package/dist/fable_modules/fable-library-js.4.28.0/lib/big.js +825 -0
  114. package/dist/fable_modules/fable-library-js.4.28.0/package.json +24 -0
  115. package/dist/fable_modules/project_cracked.json +1 -0
  116. package/package.json +5 -4
  117. package/.claude/settings.local.json +0 -11
  118. package/copy-latest.sh +0 -1
  119. package/dist/fable-library.2.10.1/Array.js +0 -1336
  120. package/dist/fable-library.2.10.1/Async.js +0 -121
  121. package/dist/fable-library.2.10.1/AsyncBuilder.js +0 -200
  122. package/dist/fable-library.2.10.1/Date.js +0 -501
  123. package/dist/fable-library.2.10.1/Decimal.js +0 -208
  124. package/dist/fable-library.2.10.1/Event.js +0 -193
  125. package/dist/fable-library.2.10.1/Int32.js +0 -157
  126. package/dist/fable-library.2.10.1/List.js +0 -1234
  127. package/dist/fable-library.2.10.1/Long.js +0 -155
  128. package/dist/fable-library.2.10.1/Map.js +0 -1292
  129. package/dist/fable-library.2.10.1/MutableMap.js +0 -360
  130. package/dist/fable-library.2.10.1/MutableSet.js +0 -279
  131. package/dist/fable-library.2.10.1/Observable.js +0 -131
  132. package/dist/fable-library.2.10.1/Option.js +0 -118
  133. package/dist/fable-library.2.10.1/Reflection.js +0 -345
  134. package/dist/fable-library.2.10.1/RegExp.js +0 -118
  135. package/dist/fable-library.2.10.1/Seq.js +0 -917
  136. package/dist/fable-library.2.10.1/Set.js +0 -1692
  137. package/dist/fable-library.2.10.1/String.js +0 -679
  138. package/dist/fable-library.2.10.1/Types.js +0 -308
  139. package/dist/fable-library.2.10.1/Util.js +0 -761
  140. package/dist/helpers.js +0 -31
  141. package/dist/lib/big.js +0 -905
  142. package/dist/lib/long.js +0 -1375
  143. package/index.html +0 -49
@@ -0,0 +1,69 @@
1
+ import { disposeSafe, defaultOf, structuralHash, equals } from "./Util.js";
2
+ import { HashIdentity_Structural, ComparisonIdentity_Structural } from "./FSharp.Collections.js";
3
+ import { StringBuilder__Append_Z721C83C5 } from "./System.Text.js";
4
+ export const LanguagePrimitives_GenericEqualityComparer = {
5
+ "System.Collections.IEqualityComparer.Equals541DA560"(x, y) {
6
+ return equals(x, y);
7
+ },
8
+ "System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1) {
9
+ return structuralHash(x_1);
10
+ },
11
+ };
12
+ export const LanguagePrimitives_GenericEqualityERComparer = {
13
+ "System.Collections.IEqualityComparer.Equals541DA560"(x, y) {
14
+ return equals(x, y);
15
+ },
16
+ "System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1) {
17
+ return structuralHash(x_1);
18
+ },
19
+ };
20
+ export function LanguagePrimitives_FastGenericComparer() {
21
+ return ComparisonIdentity_Structural();
22
+ }
23
+ export function LanguagePrimitives_FastGenericComparerFromTable() {
24
+ return ComparisonIdentity_Structural();
25
+ }
26
+ export function LanguagePrimitives_FastGenericEqualityComparer() {
27
+ return HashIdentity_Structural();
28
+ }
29
+ export function LanguagePrimitives_FastGenericEqualityComparerFromTable() {
30
+ return HashIdentity_Structural();
31
+ }
32
+ export function Operators_Failure(message) {
33
+ return new Error(message);
34
+ }
35
+ export function Operators_FailurePattern(exn) {
36
+ return exn.message;
37
+ }
38
+ export function Operators_NullArg(x) {
39
+ throw new Error(x);
40
+ }
41
+ export function Operators_Using(resource, action) {
42
+ try {
43
+ return action(resource);
44
+ }
45
+ finally {
46
+ if (equals(resource, defaultOf())) {
47
+ }
48
+ else {
49
+ let copyOfStruct = resource;
50
+ disposeSafe(copyOfStruct);
51
+ }
52
+ }
53
+ }
54
+ export function Operators_Lock(_lockObj, action) {
55
+ return action();
56
+ }
57
+ export function ExtraTopLevelOperators_LazyPattern(input) {
58
+ return input.Value;
59
+ }
60
+ export function PrintfModule_PrintFormatToStringBuilderThen(continuation, builder, format) {
61
+ return format.cont((s) => {
62
+ StringBuilder__Append_Z721C83C5(builder, s);
63
+ return continuation();
64
+ });
65
+ }
66
+ export function PrintfModule_PrintFormatToStringBuilder(builder, format) {
67
+ return PrintfModule_PrintFormatToStringBuilderThen(() => {
68
+ }, builder, format);
69
+ }
@@ -0,0 +1,24 @@
1
+ import { int32 } from "./Int32.js";
2
+ export interface Fable_Core_IGenericAdder$1<T> {
3
+ Add(arg0: T, arg1: T): T;
4
+ GetZero(): T;
5
+ }
6
+ export interface Fable_Core_IGenericAverager$1<T> {
7
+ Add(arg0: T, arg1: T): T;
8
+ DivideByInt(arg0: T, arg1: int32): T;
9
+ GetZero(): T;
10
+ }
11
+ export interface Fable_Core_Symbol_wellknown {
12
+ [Symbol.toStringTag]: string;
13
+ }
14
+ export interface Fable_Core_IJsonSerializable {
15
+ toJSON(): any;
16
+ }
17
+ export declare const SR_indexOutOfBounds = "The index was outside the range of elements in the collection.";
18
+ export declare const SR_inputWasEmpty = "Collection was empty.";
19
+ export declare const SR_inputMustBeNonNegative = "The input must be non-negative.";
20
+ export declare const SR_inputSequenceEmpty = "The input sequence was empty.";
21
+ export declare const SR_inputSequenceTooLong = "The input sequence contains more than one element.";
22
+ export declare const SR_keyNotFoundAlt = "An index satisfying the predicate was not found in the collection.";
23
+ export declare const SR_differentLengths = "The collections had different lengths.";
24
+ export declare const SR_notEnoughElements = "The input sequence has an insufficient number of elements.";
@@ -0,0 +1,8 @@
1
+ export const SR_indexOutOfBounds = "The index was outside the range of elements in the collection.";
2
+ export const SR_inputWasEmpty = "Collection was empty.";
3
+ export const SR_inputMustBeNonNegative = "The input must be non-negative.";
4
+ export const SR_inputSequenceEmpty = "The input sequence was empty.";
5
+ export const SR_inputSequenceTooLong = "The input sequence contains more than one element.";
6
+ export const SR_keyNotFoundAlt = "An index satisfying the predicate was not found in the collection.";
7
+ export const SR_differentLengths = "The collections had different lengths.";
8
+ export const SR_notEnoughElements = "The input sequence has an insufficient number of elements.";
@@ -0,0 +1,10 @@
1
+ import { FSharpRef } from "./Types.js";
2
+ export declare function toString(str: string, format?: string, _provider?: any): string;
3
+ /** Validates UUID as specified in RFC4122 (versions 1-5). */
4
+ export declare function parse(str: string): string;
5
+ export declare function tryParse(str: string, defValue: FSharpRef<string>): boolean;
6
+ export declare function newGuid(): string;
7
+ /** Parse a UUID into it's component bytes */
8
+ export declare function guidToArray(s: string): number[];
9
+ /** Convert UUID byte array into a string */
10
+ export declare function arrayToGuid(buf: ArrayLike<number>): string;
@@ -0,0 +1,142 @@
1
+ import { trim } from "./String.js";
2
+ // RFC 4122 compliant. From https://stackoverflow.com/a/13653180/3922220
3
+ // const guidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
4
+ // Relax GUID parsing, see #1637
5
+ const guidRegex = /^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/;
6
+ const guidRegexNoHyphen = /^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/;
7
+ const guidRegexHex = /^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;
8
+ const guidHexCaptures = /^([0-9a-f]{8})-(([0-9a-f]{4})-)(([0-9a-f]{4})-)([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/;
9
+ export function toString(str, format, _provider) {
10
+ if (format && format?.length > 0) {
11
+ switch (format) {
12
+ case "N":
13
+ return str.replace(/-/g, '');
14
+ case "D":
15
+ return str;
16
+ case "B":
17
+ return "{" + str + "}";
18
+ case "P":
19
+ return "(" + str + ")";
20
+ case "X":
21
+ return str.replace(guidHexCaptures, "{0x$1,0x$3,0x$5,{0x$6,0x$7,0x$8,0x$9,0x$10,0x$11,0x$12,0x$13}}");
22
+ default:
23
+ throw new Error("Unrecognized Guid print format");
24
+ }
25
+ }
26
+ else {
27
+ return str;
28
+ }
29
+ }
30
+ /** Validates UUID as specified in RFC4122 (versions 1-5). */
31
+ export function parse(str) {
32
+ function hyphenateGuid(str) {
33
+ return str.replace(guidRegexNoHyphen, "$1-$2-$3-$4-$5");
34
+ }
35
+ const wsTrimAndLowered = str.trim().toLowerCase();
36
+ if (guidRegex.test(wsTrimAndLowered)) {
37
+ return trim(wsTrimAndLowered, "{", "}", "(", ")");
38
+ }
39
+ else if (guidRegexNoHyphen.test(wsTrimAndLowered)) {
40
+ return hyphenateGuid(wsTrimAndLowered);
41
+ }
42
+ else if (guidRegexHex.test(wsTrimAndLowered)) {
43
+ return hyphenateGuid(wsTrimAndLowered.replace(/[\{\},]|0x/g, ''));
44
+ }
45
+ else {
46
+ throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
47
+ }
48
+ }
49
+ export function tryParse(str, defValue) {
50
+ try {
51
+ defValue.contents = parse(str);
52
+ return true;
53
+ }
54
+ catch {
55
+ return false;
56
+ }
57
+ }
58
+ // From https://gist.github.com/LeverOne/1308368
59
+ export function newGuid() {
60
+ let b = "";
61
+ for (let a = 0; a++ < 36;) {
62
+ b += a * 51 & 52
63
+ ? (a ^ 15 ? 8 ^ Math.random() * (a ^ 20 ? 16 : 4) : 4).toString(16)
64
+ : "-";
65
+ }
66
+ return b;
67
+ }
68
+ // Maps for number <-> hex string conversion
69
+ let _convertMapsInitialized = false;
70
+ let _byteToHex;
71
+ let _hexToByte;
72
+ function initConvertMaps() {
73
+ _byteToHex = new Array(256);
74
+ _hexToByte = {};
75
+ for (let i = 0; i < 256; i++) {
76
+ _byteToHex[i] = (i + 0x100).toString(16).substr(1);
77
+ _hexToByte[_byteToHex[i]] = i;
78
+ }
79
+ _convertMapsInitialized = true;
80
+ }
81
+ /** Parse a UUID into it's component bytes */
82
+ // Adapted from https://github.com/zefferus/uuid-parse
83
+ export function guidToArray(s) {
84
+ if (!_convertMapsInitialized) {
85
+ initConvertMaps();
86
+ }
87
+ let i = 0;
88
+ const buf = new Uint8Array(16);
89
+ s.toLowerCase().replace(/[0-9a-f]{2}/g, ((oct) => {
90
+ switch (i) {
91
+ // .NET saves first three byte groups with different endianness
92
+ // See https://stackoverflow.com/a/16722909/3922220
93
+ case 0:
94
+ case 1:
95
+ case 2:
96
+ case 3:
97
+ buf[3 - i++] = _hexToByte[oct];
98
+ break;
99
+ case 4:
100
+ case 5:
101
+ buf[9 - i++] = _hexToByte[oct];
102
+ break;
103
+ case 6:
104
+ case 7:
105
+ buf[13 - i++] = _hexToByte[oct];
106
+ break;
107
+ case 8:
108
+ case 9:
109
+ case 10:
110
+ case 11:
111
+ case 12:
112
+ case 13:
113
+ case 14:
114
+ case 15:
115
+ buf[i++] = _hexToByte[oct];
116
+ break;
117
+ }
118
+ }));
119
+ // Zero out remaining bytes if string was short
120
+ while (i < 16) {
121
+ buf[i++] = 0;
122
+ }
123
+ return buf;
124
+ }
125
+ /** Convert UUID byte array into a string */
126
+ export function arrayToGuid(buf) {
127
+ if (buf.length !== 16) {
128
+ throw new Error("Byte array for GUID must be exactly 16 bytes long");
129
+ }
130
+ if (!_convertMapsInitialized) {
131
+ initConvertMaps();
132
+ }
133
+ const guid = _byteToHex[buf[3]] + _byteToHex[buf[2]] +
134
+ _byteToHex[buf[1]] + _byteToHex[buf[0]] + "-" +
135
+ _byteToHex[buf[5]] + _byteToHex[buf[4]] + "-" +
136
+ _byteToHex[buf[7]] + _byteToHex[buf[6]] + "-" +
137
+ _byteToHex[buf[8]] + _byteToHex[buf[9]] + "-" +
138
+ _byteToHex[buf[10]] + _byteToHex[buf[11]] +
139
+ _byteToHex[buf[12]] + _byteToHex[buf[13]] +
140
+ _byteToHex[buf[14]] + _byteToHex[buf[15]];
141
+ return guid;
142
+ }
@@ -0,0 +1,28 @@
1
+ import { FSharpRef } from "./Types.js";
2
+ export type int8 = number;
3
+ export type uint8 = number;
4
+ export type int16 = number;
5
+ export type uint16 = number;
6
+ export type int32 = number;
7
+ export type uint32 = number;
8
+ export type float16 = number;
9
+ export type float32 = number;
10
+ export type float64 = number;
11
+ export declare enum NumberStyles {
12
+ AllowHexSpecifier = 512
13
+ }
14
+ export declare function getPrefix(radix: number): string;
15
+ export declare function getRadix(prefix: string, style: number): 2 | 8 | 16 | 10;
16
+ export declare function isValid(str: string, style: number, radix?: number): {
17
+ sign: string;
18
+ prefix: string;
19
+ digits: string;
20
+ radix: number;
21
+ } | null;
22
+ export declare function parse(str: string, style: number, unsigned: boolean, bitsize: number, radix?: number): number;
23
+ export declare function tryParse(str: string, style: number, unsigned: boolean, bitsize: number, defValue: FSharpRef<number>): boolean;
24
+ export declare function op_UnaryNegation_Int8(x: number): number;
25
+ export declare function op_UnaryNegation_Int16(x: number): number;
26
+ export declare function op_UnaryNegation_Int32(x: number): number;
27
+ export declare function divRem(x: number, y: number): [number, number];
28
+ export declare function divRem(x: number, y: number, out: FSharpRef<number>): number;
@@ -0,0 +1,135 @@
1
+ export var NumberStyles;
2
+ (function (NumberStyles) {
3
+ // None = 0x00000000,
4
+ // AllowLeadingWhite = 0x00000001,
5
+ // AllowTrailingWhite = 0x00000002,
6
+ // AllowLeadingSign = 0x00000004,
7
+ // AllowTrailingSign = 0x00000008,
8
+ // AllowParentheses = 0x00000010,
9
+ // AllowDecimalPoint = 0x00000020,
10
+ // AllowThousands = 0x00000040,
11
+ // AllowExponent = 0x00000080,
12
+ // AllowCurrencySymbol = 0x00000100,
13
+ NumberStyles[NumberStyles["AllowHexSpecifier"] = 512] = "AllowHexSpecifier";
14
+ // Integer = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign,
15
+ // HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier,
16
+ // Number = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
17
+ // AllowTrailingSign | AllowDecimalPoint | AllowThousands,
18
+ // Float = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |
19
+ // AllowDecimalPoint | AllowExponent,
20
+ // Currency = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign |
21
+ // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol,
22
+ // Any = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign |
23
+ // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol | AllowExponent,
24
+ })(NumberStyles || (NumberStyles = {}));
25
+ function validResponse(regexMatch, radix) {
26
+ const [/*all*/ , sign, prefix, digits] = regexMatch;
27
+ return {
28
+ sign: sign || "",
29
+ prefix: prefix || "",
30
+ digits,
31
+ radix,
32
+ };
33
+ }
34
+ function getRange(unsigned, bitsize) {
35
+ switch (bitsize) {
36
+ case 8: return unsigned ? [0, 255] : [-128, 127];
37
+ case 16: return unsigned ? [0, 65535] : [-32768, 32767];
38
+ case 32: return unsigned ? [0, 4294967295] : [-2147483648, 2147483647];
39
+ default: throw new Error("Invalid bit size.");
40
+ }
41
+ }
42
+ function getInvalidDigits(radix) {
43
+ switch (radix) {
44
+ case 2: return /[^0-1]/;
45
+ case 8: return /[^0-7]/;
46
+ case 10: return /[^0-9]/;
47
+ case 16: return /[^0-9a-fA-F]/;
48
+ default:
49
+ throw new Error("Invalid Base.");
50
+ }
51
+ }
52
+ export function getPrefix(radix) {
53
+ switch (radix) {
54
+ case 2: return "0b";
55
+ case 8: return "0o";
56
+ case 10: return "";
57
+ case 16: return "0x";
58
+ default: return "";
59
+ }
60
+ }
61
+ export function getRadix(prefix, style) {
62
+ if (style & NumberStyles.AllowHexSpecifier) {
63
+ return 16;
64
+ }
65
+ else {
66
+ switch (prefix) {
67
+ case "0b":
68
+ case "0B": return 2;
69
+ case "0o":
70
+ case "0O": return 8;
71
+ case "0x":
72
+ case "0X": return 16;
73
+ default: return 10;
74
+ }
75
+ }
76
+ }
77
+ export function isValid(str, style, radix) {
78
+ const integerRegex = /^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/;
79
+ const res = integerRegex.exec(str.replace(/_/g, ""));
80
+ if (res != null) {
81
+ const [/*all*/ , /*sign*/ , prefix, digits] = res;
82
+ radix = radix || getRadix(prefix, style);
83
+ const invalidDigits = getInvalidDigits(radix);
84
+ if (!invalidDigits.test(digits)) {
85
+ return validResponse(res, radix);
86
+ }
87
+ }
88
+ return null;
89
+ }
90
+ export function parse(str, style, unsigned, bitsize, radix) {
91
+ const res = isValid(str, style, radix);
92
+ if (res != null) {
93
+ let v = Number.parseInt(res.sign + res.digits, res.radix);
94
+ if (!Number.isNaN(v)) {
95
+ const [umin, umax] = getRange(true, bitsize);
96
+ if (!unsigned && res.radix !== 10 && v >= umin && v <= umax) {
97
+ v = v << (32 - bitsize) >> (32 - bitsize);
98
+ }
99
+ const [min, max] = getRange(unsigned, bitsize);
100
+ if (v >= min && v <= max) {
101
+ return v;
102
+ }
103
+ }
104
+ }
105
+ throw new Error(`The input string ${str} was not in a correct format.`);
106
+ }
107
+ export function tryParse(str, style, unsigned, bitsize, defValue) {
108
+ try {
109
+ defValue.contents = parse(str, style, unsigned, bitsize);
110
+ return true;
111
+ }
112
+ catch {
113
+ return false;
114
+ }
115
+ }
116
+ export function op_UnaryNegation_Int8(x) {
117
+ return x === -128 ? x : -x;
118
+ }
119
+ export function op_UnaryNegation_Int16(x) {
120
+ return x === -32768 ? x : -x;
121
+ }
122
+ export function op_UnaryNegation_Int32(x) {
123
+ return x === -2147483648 ? x : -x;
124
+ }
125
+ export function divRem(x, y, out) {
126
+ const div = ~~(x / y);
127
+ const rem = x % y;
128
+ if (out === void 0) {
129
+ return [div, rem];
130
+ }
131
+ else {
132
+ out.contents = rem;
133
+ return div;
134
+ }
135
+ }
@@ -0,0 +1,143 @@
1
+ import { Option } from "./Option.js";
2
+ import { IComparer, IEqualityComparer, IDisposable, IEnumerator } from "./Util.js";
3
+ import { int32 } from "./Int32.js";
4
+ import { Record } from "./Types.js";
5
+ import { TypeInfo } from "./Reflection.js";
6
+ export declare class FSharpList<T> extends Record implements Iterable<T> {
7
+ readonly head: T;
8
+ tail: Option<FSharpList<T>>;
9
+ constructor(head: T, tail: Option<FSharpList<T>>);
10
+ toString(): string;
11
+ Equals(other: any): boolean;
12
+ GetHashCode(): int32;
13
+ toJSON(): any;
14
+ CompareTo(other: any): int32;
15
+ GetEnumerator(): IEnumerator<T>;
16
+ [Symbol.iterator](): Iterator<T>;
17
+ "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator<any>;
18
+ }
19
+ export declare function FSharpList_$reflection(gen0: TypeInfo): TypeInfo;
20
+ export declare class ListEnumerator$1<T> implements IEnumerator<T>, IDisposable {
21
+ readonly xs: FSharpList<T>;
22
+ it: FSharpList<T>;
23
+ current: T;
24
+ constructor(xs: FSharpList<T>);
25
+ "System.Collections.Generic.IEnumerator`1.get_Current"(): T;
26
+ "System.Collections.IEnumerator.get_Current"(): any;
27
+ "System.Collections.IEnumerator.MoveNext"(): boolean;
28
+ "System.Collections.IEnumerator.Reset"(): void;
29
+ Dispose(): void;
30
+ }
31
+ export declare function ListEnumerator$1_$reflection(gen0: TypeInfo): TypeInfo;
32
+ export declare function ListEnumerator$1_$ctor_3002E699<T>(xs: FSharpList<T>): ListEnumerator$1<T>;
33
+ export declare function FSharpList_get_Empty<T>(): FSharpList<T>;
34
+ export declare function FSharpList_Cons_305B8EAC<T>(x: T, xs: FSharpList<T>): FSharpList<T>;
35
+ export declare function FSharpList__get_IsEmpty<T>(xs: FSharpList<T>): boolean;
36
+ export declare function FSharpList__get_Length<T>(xs: FSharpList<T>): int32;
37
+ export declare function FSharpList__get_Head<T>(xs: FSharpList<T>): T;
38
+ export declare function FSharpList__get_Tail<T>(xs: FSharpList<T>): FSharpList<T>;
39
+ export declare function FSharpList__get_Item_Z524259A4<T>(xs: FSharpList<T>, index: int32): T;
40
+ export declare function indexNotFound<$a>(): $a;
41
+ export declare function empty<$a>(): FSharpList<$a>;
42
+ export declare function cons<T>(x: T, xs: FSharpList<T>): FSharpList<T>;
43
+ export declare function singleton<$a>(x: $a): FSharpList<$a>;
44
+ export declare function isEmpty<T>(xs: FSharpList<T>): boolean;
45
+ export declare function length<T>(xs: FSharpList<T>): int32;
46
+ export declare function head<T>(xs: FSharpList<T>): T;
47
+ export declare function tryHead<T>(xs: FSharpList<T>): Option<T>;
48
+ export declare function tail<T>(xs: FSharpList<T>): FSharpList<T>;
49
+ export declare function tryLast<T>(xs_mut: FSharpList<T>): Option<T>;
50
+ export declare function last<T>(xs: FSharpList<T>): T;
51
+ export declare function compareWith<T>(comparer: ((arg0: T, arg1: T) => int32), xs: FSharpList<T>, ys: FSharpList<T>): int32;
52
+ export declare function toArray<T>(xs: FSharpList<T>): T[];
53
+ export declare function fold<T, State>(folder: ((arg0: State, arg1: T) => State), state: State, xs: FSharpList<T>): State;
54
+ export declare function reverse<T>(xs: FSharpList<T>): FSharpList<T>;
55
+ export declare function foldBack<T, State>(folder: ((arg0: T, arg1: State) => State), xs: FSharpList<T>, state: State): State;
56
+ export declare function foldIndexed<State, T>(folder: ((arg0: int32, arg1: State, arg2: T) => State), state: State, xs: FSharpList<T>): State;
57
+ export declare function fold2<T1, T2, State>(folder: ((arg0: State, arg1: T1, arg2: T2) => State), state: State, xs: FSharpList<T1>, ys: FSharpList<T2>): State;
58
+ export declare function foldBack2<T1, T2, State>(folder: ((arg0: T1, arg1: T2, arg2: State) => State), xs: FSharpList<T1>, ys: FSharpList<T2>, state: State): State;
59
+ export declare function unfold<State, T>(gen: ((arg0: State) => Option<[T, State]>), state: State): FSharpList<T>;
60
+ export declare function iterate<$a>(action: ((arg0: $a) => void), xs: FSharpList<$a>): void;
61
+ export declare function iterate2<$a, $b>(action: ((arg0: $a, arg1: $b) => void), xs: FSharpList<$a>, ys: FSharpList<$b>): void;
62
+ export declare function iterateIndexed<$a>(action: ((arg0: int32, arg1: $a) => void), xs: FSharpList<$a>): void;
63
+ export declare function iterateIndexed2<$a, $b>(action: ((arg0: int32, arg1: $a, arg2: $b) => void), xs: FSharpList<$a>, ys: FSharpList<$b>): void;
64
+ export declare function toSeq<T>(xs: FSharpList<T>): Iterable<T>;
65
+ export declare function ofArrayWithTail<T>(xs: T[], tail_1: FSharpList<T>): FSharpList<T>;
66
+ export declare function ofArray<T>(xs: T[]): FSharpList<T>;
67
+ export declare function ofSeq<T>(xs: Iterable<T>): FSharpList<T>;
68
+ export declare function concat<T>(lists: Iterable<FSharpList<T>>): FSharpList<T>;
69
+ export declare function scan<State, T>(folder: ((arg0: State, arg1: T) => State), state: State, xs: FSharpList<T>): FSharpList<State>;
70
+ export declare function scanBack<T, State>(folder: ((arg0: T, arg1: State) => State), xs: FSharpList<T>, state: State): FSharpList<State>;
71
+ export declare function append<T>(xs: FSharpList<T>, ys: FSharpList<T>): FSharpList<T>;
72
+ export declare function collect<T, U>(mapping: ((arg0: T) => FSharpList<U>), xs: FSharpList<T>): FSharpList<U>;
73
+ export declare function mapIndexed<T, U>(mapping: ((arg0: int32, arg1: T) => U), xs: FSharpList<T>): FSharpList<U>;
74
+ export declare function map<T, U>(mapping: ((arg0: T) => U), xs: FSharpList<T>): FSharpList<U>;
75
+ export declare function indexed<$a>(xs: FSharpList<$a>): FSharpList<[int32, $a]>;
76
+ export declare function map2<T1, T2, U>(mapping: ((arg0: T1, arg1: T2) => U), xs: FSharpList<T1>, ys: FSharpList<T2>): FSharpList<U>;
77
+ export declare function mapIndexed2<T1, T2, U>(mapping: ((arg0: int32, arg1: T1, arg2: T2) => U), xs: FSharpList<T1>, ys: FSharpList<T2>): FSharpList<U>;
78
+ export declare function map3<T1, T2, T3, U>(mapping: ((arg0: T1, arg1: T2, arg2: T3) => U), xs: FSharpList<T1>, ys: FSharpList<T2>, zs: FSharpList<T3>): FSharpList<U>;
79
+ export declare function mapFold<State, T, Result>(mapping: ((arg0: State, arg1: T) => [Result, State]), state: State, xs: FSharpList<T>): [FSharpList<Result>, State];
80
+ export declare function mapFoldBack<T, State, Result>(mapping: ((arg0: T, arg1: State) => [Result, State]), xs: FSharpList<T>, state: State): [FSharpList<Result>, State];
81
+ export declare function tryPick<T, $a>(f: ((arg0: T) => Option<$a>), xs: FSharpList<T>): Option<$a>;
82
+ export declare function pick<$a, $b>(f: ((arg0: $a) => Option<$b>), xs: FSharpList<$a>): $b;
83
+ export declare function tryFind<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): Option<$a>;
84
+ export declare function find<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): $a;
85
+ export declare function tryFindBack<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): Option<$a>;
86
+ export declare function findBack<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): $a;
87
+ export declare function tryFindIndex<T>(f: ((arg0: T) => boolean), xs: FSharpList<T>): Option<int32>;
88
+ export declare function findIndex<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): int32;
89
+ export declare function tryFindIndexBack<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): Option<int32>;
90
+ export declare function findIndexBack<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): int32;
91
+ export declare function tryItem<T>(n: int32, xs: FSharpList<T>): Option<T>;
92
+ export declare function item<T>(n: int32, xs: FSharpList<T>): T;
93
+ export declare function filter<T>(f: ((arg0: T) => boolean), xs: FSharpList<T>): FSharpList<T>;
94
+ export declare function partition<T>(f: ((arg0: T) => boolean), xs: FSharpList<T>): [FSharpList<T>, FSharpList<T>];
95
+ export declare function choose<T, U>(f: ((arg0: T) => Option<U>), xs: FSharpList<T>): FSharpList<U>;
96
+ export declare function contains<T>(value: T, xs: FSharpList<T>, eq: IEqualityComparer<T>): boolean;
97
+ export declare function initialize<T>(n: int32, f: ((arg0: int32) => T)): FSharpList<T>;
98
+ export declare function replicate<$a>(n: int32, x: $a): FSharpList<$a>;
99
+ export declare function reduce<T>(f: ((arg0: T, arg1: T) => T), xs: FSharpList<T>): T;
100
+ export declare function reduceBack<T>(f: ((arg0: T, arg1: T) => T), xs: FSharpList<T>): T;
101
+ export declare function forAll<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): boolean;
102
+ export declare function forAll2<$a, $b>(f: ((arg0: $a, arg1: $b) => boolean), xs: FSharpList<$a>, ys: FSharpList<$b>): boolean;
103
+ export declare function exists<$a>(f: ((arg0: $a) => boolean), xs: FSharpList<$a>): boolean;
104
+ export declare function exists2<T1, T2>(f_mut: ((arg0: T1, arg1: T2) => boolean), xs_mut: FSharpList<T1>, ys_mut: FSharpList<T2>): boolean;
105
+ export declare function unzip<$a, $b>(xs: FSharpList<[$a, $b]>): [FSharpList<$a>, FSharpList<$b>];
106
+ export declare function unzip3<$a, $b, $c>(xs: FSharpList<[$a, $b, $c]>): [FSharpList<$a>, FSharpList<$b>, FSharpList<$c>];
107
+ export declare function zip<$a, $b>(xs: FSharpList<$a>, ys: FSharpList<$b>): FSharpList<[$a, $b]>;
108
+ export declare function zip3<$a, $b, $c>(xs: FSharpList<$a>, ys: FSharpList<$b>, zs: FSharpList<$c>): FSharpList<[$a, $b, $c]>;
109
+ export declare function sortWith<T>(comparer: ((arg0: T, arg1: T) => int32), xs: FSharpList<T>): FSharpList<T>;
110
+ export declare function sort<T>(xs: FSharpList<T>, comparer: IComparer<T>): FSharpList<T>;
111
+ export declare function sortBy<T, U>(projection: ((arg0: T) => U), xs: FSharpList<T>, comparer: IComparer<U>): FSharpList<T>;
112
+ export declare function sortDescending<T>(xs: FSharpList<T>, comparer: IComparer<T>): FSharpList<T>;
113
+ export declare function sortByDescending<T, U>(projection: ((arg0: T) => U), xs: FSharpList<T>, comparer: IComparer<U>): FSharpList<T>;
114
+ export declare function sum<T>(xs: FSharpList<T>, adder: any): T;
115
+ export declare function sumBy<T, U>(f: ((arg0: T) => U), xs: FSharpList<T>, adder: any): U;
116
+ export declare function maxBy<T, U>(projection: ((arg0: T) => U), xs: FSharpList<T>, comparer: IComparer<U>): T;
117
+ export declare function max<T>(xs: FSharpList<T>, comparer: IComparer<T>): T;
118
+ export declare function minBy<T, U>(projection: ((arg0: T) => U), xs: FSharpList<T>, comparer: IComparer<U>): T;
119
+ export declare function min<T>(xs: FSharpList<T>, comparer: IComparer<T>): T;
120
+ export declare function average<T>(xs: FSharpList<T>, averager: any): T;
121
+ export declare function averageBy<T, U>(f: ((arg0: T) => U), xs: FSharpList<T>, averager: any): U;
122
+ export declare function permute<T>(f: ((arg0: int32) => int32), xs: FSharpList<T>): FSharpList<T>;
123
+ export declare function chunkBySize<T>(chunkSize: int32, xs: FSharpList<T>): FSharpList<FSharpList<T>>;
124
+ export declare function allPairs<T1, T2>(xs: FSharpList<T1>, ys: FSharpList<T2>): FSharpList<[T1, T2]>;
125
+ export declare function skip<T>(count_mut: int32, xs_mut: FSharpList<T>): FSharpList<T>;
126
+ export declare function skipWhile<T>(predicate_mut: ((arg0: T) => boolean), xs_mut: FSharpList<T>): FSharpList<T>;
127
+ export declare function take<T>(count: int32, xs: FSharpList<T>): FSharpList<T>;
128
+ export declare function takeWhile<T>(predicate: ((arg0: T) => boolean), xs: FSharpList<T>): FSharpList<T>;
129
+ export declare function truncate<T>(count: int32, xs: FSharpList<T>): FSharpList<T>;
130
+ export declare function getSlice<T>(startIndex: Option<int32>, endIndex: Option<int32>, xs: FSharpList<T>): FSharpList<T>;
131
+ export declare function splitAt<T>(index: int32, xs: FSharpList<T>): [FSharpList<T>, FSharpList<T>];
132
+ export declare function exactlyOne<T>(xs: FSharpList<T>): T;
133
+ export declare function tryExactlyOne<T>(xs: FSharpList<T>): Option<T>;
134
+ export declare function where<T>(predicate: ((arg0: T) => boolean), xs: FSharpList<T>): FSharpList<T>;
135
+ export declare function pairwise<T>(xs: FSharpList<T>): FSharpList<[T, T]>;
136
+ export declare function windowed<T>(windowSize: int32, xs: FSharpList<T>): FSharpList<FSharpList<T>>;
137
+ export declare function splitInto<T>(chunks: int32, xs: FSharpList<T>): FSharpList<FSharpList<T>>;
138
+ export declare function transpose<T>(lists: Iterable<FSharpList<T>>): FSharpList<FSharpList<T>>;
139
+ export declare function insertAt<T>(index: int32, y: T, xs: FSharpList<T>): FSharpList<T>;
140
+ export declare function insertManyAt<T>(index: int32, ys: Iterable<T>, xs: FSharpList<T>): FSharpList<T>;
141
+ export declare function removeAt<T>(index: int32, xs: FSharpList<T>): FSharpList<T>;
142
+ export declare function removeManyAt<T>(index: int32, count: int32, xs: FSharpList<T>): FSharpList<T>;
143
+ export declare function updateAt<T>(index: int32, y: T, xs: FSharpList<T>): FSharpList<T>;