starlight-fsharp-oracle 0.1.0 → 0.1.2
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/dist/Extensions/StringBuilder.js +2 -5
- package/dist/Extensions/TextNode.js +29 -54
- package/dist/FSharp.Oracle.Schema/Schema.js +113 -218
- package/dist/Generate.js +33 -63
- package/dist/Helpers.js +1 -2
- package/dist/Plugin.js +17 -31
- package/dist/Render/Documentation.js +1 -2
- package/dist/Render/Entries.js +29 -34
- package/dist/Render/Pages.js +10 -19
- package/dist/Render/Primitives.js +19 -32
- package/dist/Themes.js +3 -5
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +57 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +105 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +20 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs +766 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +232 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +31 -0
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +20 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/Decode.fs +1592 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/Decode.fs.js +1417 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/DecoderCE.fs +106 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/DecoderCE.fs.js +63 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/Encode.fs +380 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/Encode.fs.js +289 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/Thoth.Json.Core.fableproj +37 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/Types.fs +76 -0
- package/dist/fable_modules/Thoth.Json.Core.0.9.0/Types.fs.js +37 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Casing.fs +113 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Casing.fs.js +173 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Decode.fs +1153 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Decode.fs.js +622 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Domain.fs +91 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Domain.fs.js +103 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Encode.fs +893 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Encode.fs.js +836 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Prelude.fs +435 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Prelude.fs.js +389 -0
- package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Thoth.Json.Core.Auto.fableproj +43 -0
- package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Decode.fs +88 -0
- package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Decode.fs.js +102 -0
- package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Encode.fs +40 -0
- package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Encode.fs.js +59 -0
- package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Thoth.Json.JavaScript.fableproj +31 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Array.js +1347 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Async.js +134 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/AsyncBuilder.js +183 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/BigInt.js +306 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/BitConverter.js +138 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Boolean.js +22 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/CHANGELOG.md +191 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Char.js +202 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Choice.js +184 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/CollectionUtil.js +182 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/ConditionalWeakTable.js +21 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Date.js +755 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/DateOffset.js +261 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/DateOnly.js +124 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Decimal.js +236 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Double.js +47 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Encoding.js +185 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Event.js +93 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/FSharp.Collections.js +45 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/FSharp.Core.CompilerServices.js +27 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/FSharp.Core.js +156 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Global.js +29 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Guid.js +161 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Int32.js +135 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/List.js +1323 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Long.js +47 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/MailboxProcessor.js +94 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Map.js +1396 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/MapUtil.js +130 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/MutableMap.js +339 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/MutableSet.js +233 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Native.js +14 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Numeric.js +75 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Observable.js +113 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Option.js +104 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/README.md +3 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Random.js +172 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Range.js +45 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Reflection.js +460 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/RegExp.js +141 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Result.js +165 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Seq.js +1409 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Seq2.js +111 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Set.js +1788 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/String.js +649 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/System.Collections.Generic.js +333 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/System.Text.js +168 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/System.js +283 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/TimeOnly.js +122 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/TimeSpan.js +180 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Timer.js +67 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Types.js +198 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Unicode.13.0.0.js +4 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Uri.js +165 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Util.js +792 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/big.d.ts +338 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/lib/big.js +825 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/package.json +24 -0
- package/dist/fable_modules/fable-library-js.5.0.0-rc.7/quotation.js +618 -0
- package/package.json +4 -5
- package/packages/FSharp.Oracle/XmlDoc.fs +12 -1
- package/packages/FSharp.Oracle/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +3 -0
- package/packages/FSharp.Oracle/obj/Debug/net10.0/FSharp.Oracle.AssemblyInfo.fs +17 -0
- package/packages/FSharp.Oracle/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +3 -0
- package/packages/FSharp.Oracle/obj/Release/net10.0/FSharp.Oracle.AssemblyInfo.fs +17 -0
- package/packages/FSharp.Oracle.Schema/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +3 -0
- package/packages/FSharp.Oracle.Schema/obj/Debug/net10.0/FSharp.Oracle.Schema.AssemblyInfo.fs +17 -0
- package/packages/FSharp.Oracle.Schema/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +3 -0
- package/packages/FSharp.Oracle.Schema/obj/Release/net10.0/FSharp.Oracle.Schema.AssemblyInfo.fs +17 -0
- package/oracle-bin/FSharp.Compiler.Service.dll +0 -0
- package/oracle-bin/FSharp.Core.dll +0 -0
- package/oracle-bin/FSharp.DependencyManager.Nuget.dll +0 -0
- package/oracle-bin/FSharp.Oracle.Schema.dll +0 -0
- package/oracle-bin/FSharp.Oracle.Schema.pdb +0 -0
- package/oracle-bin/FSharp.Oracle.Schema.xml +0 -219
- package/oracle-bin/Fable.Core.dll +0 -0
- package/oracle-bin/Oracle +0 -0
- package/oracle-bin/Oracle.deps.json +0 -280
- package/oracle-bin/Oracle.dll +0 -0
- package/oracle-bin/Oracle.pdb +0 -0
- package/oracle-bin/Oracle.runtimeconfig.json +0 -13
- package/oracle-bin/Oracle.xml +0 -111
- package/oracle-bin/Thoth.Json.Core.Auto.dll +0 -0
- package/oracle-bin/Thoth.Json.Core.dll +0 -0
- package/oracle-bin/Thoth.Json.System.Text.Json.dll +0 -0
- package/oracle-bin/cs/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/cs/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/cs/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/de/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/de/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/de/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/es/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/es/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/es/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/fr/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/fr/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/fr/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/it/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/it/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/it/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/ja/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/ja/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/ja/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/ko/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/ko/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/ko/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/pl/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/pl/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/pl/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/pt-BR/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/pt-BR/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/pt-BR/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/ru/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/ru/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/ru/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/tr/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/tr/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/tr/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/zh-Hans/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/zh-Hans/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/zh-Hans/FSharp.DependencyManager.Nuget.resources.dll +0 -0
- package/oracle-bin/zh-Hant/FSharp.Compiler.Service.resources.dll +0 -0
- package/oracle-bin/zh-Hant/FSharp.Core.resources.dll +0 -0
- package/oracle-bin/zh-Hant/FSharp.DependencyManager.Nuget.resources.dll +0 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { Exception, combineHashCodes, compare, compareArrays, equalArrays, equals, sameConstructor, numberHash, structuralHash } from "./Util.js";
|
|
2
|
+
export function seqToString(self) {
|
|
3
|
+
let count = 0;
|
|
4
|
+
let str = "[";
|
|
5
|
+
for (const x of self) {
|
|
6
|
+
if (count === 0) {
|
|
7
|
+
str += toString(x);
|
|
8
|
+
}
|
|
9
|
+
else if (count === 100) {
|
|
10
|
+
str += "; ...";
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
str += "; " + toString(x);
|
|
15
|
+
}
|
|
16
|
+
count++;
|
|
17
|
+
}
|
|
18
|
+
return str + "]";
|
|
19
|
+
}
|
|
20
|
+
export function toString(x, callStack = 0) {
|
|
21
|
+
if (x != null && typeof x === "object") {
|
|
22
|
+
if (typeof x.toString === "function" && x.toString !== Object.prototype.toString) {
|
|
23
|
+
return x.toString();
|
|
24
|
+
}
|
|
25
|
+
else if (Symbol.iterator in x) {
|
|
26
|
+
return seqToString(x);
|
|
27
|
+
}
|
|
28
|
+
else { // TODO: Date?
|
|
29
|
+
const cons = Object.getPrototypeOf(x)?.constructor;
|
|
30
|
+
return cons === Object && callStack < 10
|
|
31
|
+
// Same format as recordToString
|
|
32
|
+
? "{ " + Object.entries(x).map(([k, v]) => k + " = " + toString(v, callStack + 1)).join("\n ") + " }"
|
|
33
|
+
: cons?.name ?? "";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return String(x);
|
|
37
|
+
}
|
|
38
|
+
export function unionToString(name, fields) {
|
|
39
|
+
function unionFieldToString(x) {
|
|
40
|
+
if (typeof x === "string") {
|
|
41
|
+
return '"' + x + '"';
|
|
42
|
+
}
|
|
43
|
+
return toString(x);
|
|
44
|
+
}
|
|
45
|
+
if (fields.length === 0) {
|
|
46
|
+
return name;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
let fieldStr;
|
|
50
|
+
let withParens = true;
|
|
51
|
+
if (fields.length === 1) {
|
|
52
|
+
fieldStr = unionFieldToString(fields[0]);
|
|
53
|
+
withParens = fieldStr.indexOf(" ") >= 0;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
fieldStr = fields.map((x) => unionFieldToString(x)).join(", ");
|
|
57
|
+
}
|
|
58
|
+
return name + (withParens ? " (" : " ") + fieldStr + (withParens ? ")" : "");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export class Union {
|
|
62
|
+
get name() {
|
|
63
|
+
return this.cases()[this.tag];
|
|
64
|
+
}
|
|
65
|
+
toJSON() {
|
|
66
|
+
return this.fields.length === 0 ? this.name : [this.name].concat(this.fields);
|
|
67
|
+
}
|
|
68
|
+
toString() {
|
|
69
|
+
return unionToString(this.name, this.fields);
|
|
70
|
+
}
|
|
71
|
+
GetHashCode() {
|
|
72
|
+
const hashes = this.fields.map((x) => structuralHash(x));
|
|
73
|
+
hashes.splice(0, 0, numberHash(this.tag));
|
|
74
|
+
return combineHashCodes(hashes);
|
|
75
|
+
}
|
|
76
|
+
Equals(other) {
|
|
77
|
+
if (this === other) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
else if (!sameConstructor(this, other)) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
else if (this.tag === other.tag) {
|
|
84
|
+
return equalArrays(this.fields, other.fields);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
CompareTo(other) {
|
|
91
|
+
if (this === other) {
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
else if (!sameConstructor(this, other)) {
|
|
95
|
+
return -1;
|
|
96
|
+
}
|
|
97
|
+
else if (this.tag === other.tag) {
|
|
98
|
+
return compareArrays(this.fields, other.fields);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return this.tag < other.tag ? -1 : 1;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function recordToJSON(self) {
|
|
106
|
+
const o = {};
|
|
107
|
+
const keys = Object.keys(self);
|
|
108
|
+
for (let i = 0; i < keys.length; i++) {
|
|
109
|
+
o[keys[i]] = self[keys[i]];
|
|
110
|
+
}
|
|
111
|
+
return o;
|
|
112
|
+
}
|
|
113
|
+
function recordToString(self) {
|
|
114
|
+
return "{ " + Object.entries(self).map(([k, v]) => k + " = " + toString(v)).join("\n ") + " }";
|
|
115
|
+
}
|
|
116
|
+
function recordGetHashCode(self) {
|
|
117
|
+
const hashes = Object.values(self).map((v) => structuralHash(v));
|
|
118
|
+
return combineHashCodes(hashes);
|
|
119
|
+
}
|
|
120
|
+
function recordEquals(self, other) {
|
|
121
|
+
if (self === other) {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
else if (!sameConstructor(self, other)) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const thisNames = Object.keys(self);
|
|
129
|
+
for (let i = 0; i < thisNames.length; i++) {
|
|
130
|
+
if (!equals(self[thisNames[i]], other[thisNames[i]])) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function recordCompareTo(self, other) {
|
|
138
|
+
if (self === other) {
|
|
139
|
+
return 0;
|
|
140
|
+
}
|
|
141
|
+
else if (!sameConstructor(self, other)) {
|
|
142
|
+
return -1;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
const thisNames = Object.keys(self);
|
|
146
|
+
for (let i = 0; i < thisNames.length; i++) {
|
|
147
|
+
const result = compare(self[thisNames[i]], other[thisNames[i]]);
|
|
148
|
+
if (result !== 0) {
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return 0;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
export class Record {
|
|
156
|
+
toJSON() { return recordToJSON(this); }
|
|
157
|
+
toString() { return recordToString(this); }
|
|
158
|
+
GetHashCode() { return recordGetHashCode(this); }
|
|
159
|
+
Equals(other) { return recordEquals(this, other); }
|
|
160
|
+
CompareTo(other) { return recordCompareTo(this, other); }
|
|
161
|
+
}
|
|
162
|
+
export class FSharpRef {
|
|
163
|
+
get contents() {
|
|
164
|
+
return this.getter();
|
|
165
|
+
}
|
|
166
|
+
set contents(v) {
|
|
167
|
+
this.setter(v);
|
|
168
|
+
}
|
|
169
|
+
constructor(contentsOrGetter, setter) {
|
|
170
|
+
if (typeof setter === "function") {
|
|
171
|
+
this.getter = contentsOrGetter;
|
|
172
|
+
this.setter = setter;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
this.getter = () => contentsOrGetter;
|
|
176
|
+
this.setter = (v) => { contentsOrGetter = v; };
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// EXCEPTIONS
|
|
181
|
+
export class FSharpException extends Exception {
|
|
182
|
+
toJSON() { return recordToJSON(this); }
|
|
183
|
+
toString() { return recordToString(this); }
|
|
184
|
+
GetHashCode() { return recordGetHashCode(this); }
|
|
185
|
+
Equals(other) { return recordEquals(this, other); }
|
|
186
|
+
CompareTo(other) { return recordCompareTo(this, other); }
|
|
187
|
+
}
|
|
188
|
+
export class MatchFailureException extends FSharpException {
|
|
189
|
+
constructor(arg1, arg2, arg3) {
|
|
190
|
+
super();
|
|
191
|
+
this.arg1 = arg1;
|
|
192
|
+
this.arg2 = arg2 | 0;
|
|
193
|
+
this.arg3 = arg3 | 0;
|
|
194
|
+
this.message = "The match cases were incomplete";
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
export class Attribute {
|
|
198
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Unicode 13.0.0 codepoint ranges (delta encoded) and general categories.
|
|
2
|
+
// Integer delta values are offset by 35 and stored as Unicode characters.
|
|
3
|
+
export const rangeDeltas = "#C$&$&$$$$$$%-%&%=$$$$$$=$$$$D$$'$$$$$$$$$$$$%$$%$$$$&$:$*;$+$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%$$$$&%$$$%$&%'$%$&&%$%$$$$$%$$%$$%$&$$$%%$$&'$$$$$$$$$$$$$$$$$$$$$$$$%$$$$$$$$$$$$$$$$$%$$$$$&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*%$%%$$'$$$$$$$$h$>5'/1(*$$$4$$$$$$$$%$&$$'%$$&$$$%$4$,F$%&&$$$$$$$$$$$$$$$$$$$$$$$($$$$$%%VS$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(%$$$$$$$$$$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&'(+;'(';'(2?(&(?('+'?';@2'('(@'('@+'(&?;&@(='(&(&(&(@;@'(@;@'@'@'@(2()'()(')()()'('(;+;&'()@'@'@'@'@'@'@(')(@)@)('@)@'@'(@+'=-?=';(@()@'@'@'@'@'@'@'@(@)(@(@(@(@'@'@+('(;@()@'@'@'@'@'@'@(')(@()@)(@'@'(@+;=@'(@()@'@'@'@'@'@'@(')()(@)@)(@()@'@'(@+?'-@('@'@'@'@'@'@'@'@'@'@)()@)@)(@'@)@+-?=?@()('@'@'@'@'()@(@(@(@'@'(@+@;-?'();'@'@'@'@'@(')()@()@)(@)@'@'(@+@'@()'@'@'(')(@)@)('?@')-'(@+-?'@()@'@'@'@'@'@(@)(@(@)@+@);@'('(@='&(;+;@'@'@'@'@'@'('('@'@&@(@+@'@'?;?;?(?+-?(?(?(7878)'@'@()(;('(@(@?(?@?;?;@')()()()('+;')('(')')'('()()(')+)(?#@#@#@$;&$'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@(;-@'?@#@$@6'?;'.'78@';,'@'@'(@'(;@'(@'@'@(@'()()()(;&;='(@+@-@;6;(2@+@'&'@'('('@'@'@()()@)()(@?@;+'@'@'@'@+-@?'()(@;')()(@()()()(@(+@+@;&;@(*(@()'()()()()'@+;?(?@()')()()('+'()()()()@;')()(@;+@'+'&;$@#@#;@(;()('('(')('@$&$&$&(@(#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$@#@$#$#$@#@$@#@#@#@#$#$@$%$%$%$@$#%>$>$@$#%>$@$#@>$#>@$@$#%>@.26;9:79:79;/02.;9:;5;<78;<;5;.2@2-&@-<78&-<78@&@=@(*(*(@?#?#?$#$#$?#?<#?#?#?#?#?$#$'$?$#<#$?<?$?-,#$,-?@<?<?<?<?<?<?<?<?<?<?7878?<?78?<?<?<?@?@-?-?<?<?<?<?78787878787878-?<78<7878787878<?<7878787878787878787878<7878<78<?<?<?@?@?#@$@#$#$#$#$#$#$#$#$&#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$?#$#$(#$@;-;$@$@$@'@&;@('@'@'@'@'@'@'@'@'@(;9:9:;9:;9:;6;6;9:;9:78787878;&;6;6;7;?;@?@?@?@?@.;?&',7878787878?78787878678?,()6&?,&';?@'@(>&'6';&'@'@'@?-?'?@'?@-?-?-?-?-?'?'@'&'@?@'&;'&;'+'@#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$'(*;(;&#$#$#$#$#$#$#$#$#$#$#$#$#$#$&(',(;@>&>#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$&$#$#$#$#$#$#$#$&>#$#$'#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$@#$#$#$@#$'&$'('('(')()?(@-?=?@';@)')(@;+@(';';'(+'(;'()@;'@()'()()();@&+@;'(&'+'@'()()(@'('()@+@;'&'?')()'('('('('('@'&;')();'&)(@'@'@'@'@'@$>&$&>@$')()();)(@+@'@'@'@34'@'@$@$@'('<'@'@'@'@'@'>@'87@'@'@'=?@(;78;@(;657878787878787878;78;5;@;6787878;<6<@;=;@'@'@2@;=;78;<;6;+;<;#7;8>5>$7<8<78;78;'&'&'@'@'@'@'@=<>?=@?<?@2?@'@'@'@'@'@'@'@;@-@?,-?-?@?@?@?(@'@'@(-@'-@',',@'(@'@;'@';,@#$'@+@#@$@'@'@;@'@'@'@'@'@'@'@'@'@;-'?-'@-@'@'@-'-@;'@;@'@-'-@-'(@(@('@'@'@(@(-@;@'-;'-@'?'(@-;@'@;'@-'@-'@;@-@'@#@$@-'(@+@-@'@(6@'@'-'@'(-;@'-@'@)()'(;@-+@()')()(;2;@2@'@+@('()(@+;')'@'(;'@()')()';(;)(+';';@-@'@')()()(;(@'@'@'@'@';@'()(@+@()@'@'@'@'@'@'@(')()@)@)@'@)@')@(@(@')()()(';+;@;('@')()()()(';'@+@')(@)()(;'(@')()()(;'@+@;@'()()()('@+@'@()()(@+-;?@')()(;@#$+-@'@'@'@'@')@)@()(')')(;@+@'@')(@()(';')@'('()'(;(@'()('()(;';@'@'@')(@()(';@+-@;'@(@)()()(@'@'@'(@(@(@('(@+@'@'@')@(@)()('@+@'();@'@-?=?@;'@,@;@'@'@2@'@'@'@+@;@'@(;@'(;?&;?@+@-@'@'@#$-;@'@(')@(&@&;&(@)@'@'@'@'@'@'@'@'@'@'@'@?(;2@?@?@?)(?)2(?(?(?@?(?@-@?@-@#$#$@$#$#@#@#@#@#@#$@$@$@$#$#@#@#@#@$#@#@#@#@#@$#$#$#$#$#$#$@#<$<$#<$<$#<$<$#<$<$#<$<$#$@+?(?(?(?(?;@(@(@(@(@(@(@(@'@(&@+@'?@'(+@=@'@-(@#$(&@+@;@-?-=-@-?-@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@'@<@?@?@?@?@?@?@-?@?@?@?@?@?@?>?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@?@+@'@'@'@'@'@'@'@2@2@(@4@4@";
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Exception } from "./Util.js";
|
|
2
|
+
export const UriKind = {
|
|
3
|
+
RelativeOrAbsolute: 0,
|
|
4
|
+
Absolute: 1,
|
|
5
|
+
Relative: 2,
|
|
6
|
+
};
|
|
7
|
+
const ok = (value) => ({
|
|
8
|
+
tag: "ok",
|
|
9
|
+
value,
|
|
10
|
+
});
|
|
11
|
+
const error = (error) => ({ tag: "error", error });
|
|
12
|
+
export class Uri {
|
|
13
|
+
constructor(state) {
|
|
14
|
+
this.uri = state;
|
|
15
|
+
}
|
|
16
|
+
static isAbsoluteUri(uri) {
|
|
17
|
+
try {
|
|
18
|
+
new URL(uri);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
static tryCreateWithKind(uri, kind) {
|
|
26
|
+
switch (kind) {
|
|
27
|
+
case UriKind.Absolute:
|
|
28
|
+
return Uri.isAbsoluteUri(uri)
|
|
29
|
+
? ok(new Uri({ original: uri, value: new URL(uri), kind }))
|
|
30
|
+
: error("Invalid URI: The format of the URI could not be determined.");
|
|
31
|
+
case UriKind.Relative:
|
|
32
|
+
return Uri.isAbsoluteUri(uri)
|
|
33
|
+
? error("URI is not a relative path.")
|
|
34
|
+
: ok(new Uri({ original: uri, value: uri, kind }));
|
|
35
|
+
case UriKind.RelativeOrAbsolute:
|
|
36
|
+
return Uri.isAbsoluteUri(uri)
|
|
37
|
+
? ok(new Uri({ original: uri, value: new URL(uri), kind: UriKind.Absolute }))
|
|
38
|
+
: ok(new Uri({ original: uri, value: uri, kind: UriKind.Relative }));
|
|
39
|
+
default:
|
|
40
|
+
const never = kind;
|
|
41
|
+
return never;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
static tryCreateWithBase(baseUri, relativeUri) {
|
|
45
|
+
return baseUri.uri.kind !== UriKind.Absolute
|
|
46
|
+
? error("Base URI should have Absolute kind")
|
|
47
|
+
: typeof relativeUri === "string"
|
|
48
|
+
? ok(new Uri({
|
|
49
|
+
original: new URL(relativeUri, baseUri.uri.value).toString(),
|
|
50
|
+
value: new URL(relativeUri, baseUri.uri.value),
|
|
51
|
+
kind: UriKind.Absolute,
|
|
52
|
+
}))
|
|
53
|
+
: relativeUri.uri.kind === UriKind.Relative
|
|
54
|
+
? ok(new Uri({
|
|
55
|
+
original: new URL(relativeUri.uri.value, baseUri.uri.value).toString(),
|
|
56
|
+
value: new URL(relativeUri.uri.value, baseUri.uri.value),
|
|
57
|
+
kind: UriKind.Absolute,
|
|
58
|
+
}))
|
|
59
|
+
: ok(baseUri);
|
|
60
|
+
}
|
|
61
|
+
static tryCreateImpl(value, kindOrUri = UriKind.Absolute) {
|
|
62
|
+
return typeof value === "string"
|
|
63
|
+
? typeof kindOrUri !== "number"
|
|
64
|
+
? error("Kind must be specified when the baseUri is a string.")
|
|
65
|
+
: Uri.tryCreateWithKind(value, kindOrUri)
|
|
66
|
+
: typeof kindOrUri === "number"
|
|
67
|
+
? error("Kind should not be specified when the baseUri is an absolute Uri.")
|
|
68
|
+
: Uri.tryCreateWithBase(value, kindOrUri);
|
|
69
|
+
}
|
|
70
|
+
static create(value, kindOrUri = UriKind.Absolute) {
|
|
71
|
+
const result = Uri.tryCreateImpl(value, kindOrUri);
|
|
72
|
+
switch (result.tag) {
|
|
73
|
+
case "ok":
|
|
74
|
+
return result.value;
|
|
75
|
+
case "error":
|
|
76
|
+
throw new Exception(result.error);
|
|
77
|
+
default:
|
|
78
|
+
const never = result;
|
|
79
|
+
return never;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
static tryCreate(value, kindOrUri = UriKind.Absolute, out) {
|
|
83
|
+
const result = Uri.tryCreateImpl(value, kindOrUri);
|
|
84
|
+
switch (result.tag) {
|
|
85
|
+
case "ok":
|
|
86
|
+
out.contents = result.value;
|
|
87
|
+
return true;
|
|
88
|
+
case "error":
|
|
89
|
+
return false;
|
|
90
|
+
default:
|
|
91
|
+
const never = result;
|
|
92
|
+
return never;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
toString() {
|
|
96
|
+
switch (this.uri.kind) {
|
|
97
|
+
case UriKind.Absolute:
|
|
98
|
+
return decodeURIComponent(this.asUrl().toString());
|
|
99
|
+
case UriKind.Relative:
|
|
100
|
+
return this.uri.value;
|
|
101
|
+
default:
|
|
102
|
+
const never = this.uri;
|
|
103
|
+
return never;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
asUrl() {
|
|
107
|
+
switch (this.uri.kind) {
|
|
108
|
+
case UriKind.Absolute:
|
|
109
|
+
return this.uri.value;
|
|
110
|
+
case UriKind.Relative:
|
|
111
|
+
throw new Exception("This operation is not supported for a relative URI.");
|
|
112
|
+
default:
|
|
113
|
+
const never = this.uri;
|
|
114
|
+
return never;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
get isAbsoluteUri() {
|
|
118
|
+
return this.uri.kind === UriKind.Absolute;
|
|
119
|
+
}
|
|
120
|
+
get absoluteUri() {
|
|
121
|
+
return this.asUrl().href;
|
|
122
|
+
}
|
|
123
|
+
get scheme() {
|
|
124
|
+
const protocol = this.asUrl().protocol;
|
|
125
|
+
return protocol.slice(0, protocol.length - 1);
|
|
126
|
+
}
|
|
127
|
+
get host() {
|
|
128
|
+
const host = this.asUrl().host;
|
|
129
|
+
if (host.includes(":")) {
|
|
130
|
+
return host.split(":")[0];
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
return host;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
get absolutePath() {
|
|
137
|
+
return this.asUrl().pathname;
|
|
138
|
+
}
|
|
139
|
+
get query() {
|
|
140
|
+
return this.asUrl().search;
|
|
141
|
+
}
|
|
142
|
+
get isDefaultPort() {
|
|
143
|
+
return this.port === 80;
|
|
144
|
+
}
|
|
145
|
+
get port() {
|
|
146
|
+
const port = this.asUrl().port;
|
|
147
|
+
if (port === "") {
|
|
148
|
+
return 80;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
return parseInt(port);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
get pathAndQuery() {
|
|
155
|
+
const url = this.asUrl();
|
|
156
|
+
return url.pathname + url.search;
|
|
157
|
+
}
|
|
158
|
+
get fragment() {
|
|
159
|
+
return this.asUrl().hash;
|
|
160
|
+
}
|
|
161
|
+
get originalString() {
|
|
162
|
+
return this.uri.original;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
export default Uri;
|