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,138 @@
|
|
|
1
|
+
const littleEndian = true;
|
|
2
|
+
export function isLittleEndian() {
|
|
3
|
+
return littleEndian;
|
|
4
|
+
}
|
|
5
|
+
export function getBytesBoolean(value) {
|
|
6
|
+
const bytes = new Uint8Array(1);
|
|
7
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
8
|
+
view.setUint8(0, value ? 1 : 0);
|
|
9
|
+
return bytes;
|
|
10
|
+
}
|
|
11
|
+
export function getBytesChar(value) {
|
|
12
|
+
const bytes = new Uint8Array(2);
|
|
13
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
14
|
+
view.setUint16(0, value.charCodeAt(0), littleEndian);
|
|
15
|
+
return bytes;
|
|
16
|
+
}
|
|
17
|
+
export function getBytesInt16(value) {
|
|
18
|
+
const bytes = new Uint8Array(2);
|
|
19
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
20
|
+
view.setInt16(0, value, littleEndian);
|
|
21
|
+
return bytes;
|
|
22
|
+
}
|
|
23
|
+
export function getBytesInt32(value) {
|
|
24
|
+
const bytes = new Uint8Array(4);
|
|
25
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
26
|
+
view.setInt32(0, value, littleEndian);
|
|
27
|
+
return bytes;
|
|
28
|
+
}
|
|
29
|
+
export function getBytesInt64(value) {
|
|
30
|
+
const bytes = new Uint8Array(8);
|
|
31
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
32
|
+
view.setBigInt64(0, value, littleEndian);
|
|
33
|
+
return bytes;
|
|
34
|
+
}
|
|
35
|
+
export function getBytesUInt16(value) {
|
|
36
|
+
const bytes = new Uint8Array(2);
|
|
37
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
38
|
+
view.setUint16(0, value, littleEndian);
|
|
39
|
+
return bytes;
|
|
40
|
+
}
|
|
41
|
+
export function getBytesUInt32(value) {
|
|
42
|
+
const bytes = new Uint8Array(4);
|
|
43
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
44
|
+
view.setUint32(0, value, littleEndian);
|
|
45
|
+
return bytes;
|
|
46
|
+
}
|
|
47
|
+
export function getBytesUInt64(value) {
|
|
48
|
+
const bytes = new Uint8Array(8);
|
|
49
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
50
|
+
view.setBigUint64(0, value, littleEndian);
|
|
51
|
+
return bytes;
|
|
52
|
+
}
|
|
53
|
+
export function getBytesSingle(value) {
|
|
54
|
+
const bytes = new Uint8Array(4);
|
|
55
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
56
|
+
view.setFloat32(0, value, littleEndian);
|
|
57
|
+
return bytes;
|
|
58
|
+
}
|
|
59
|
+
export function getBytesDouble(value) {
|
|
60
|
+
const bytes = new Uint8Array(8);
|
|
61
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
62
|
+
view.setFloat64(0, value, littleEndian);
|
|
63
|
+
return bytes;
|
|
64
|
+
}
|
|
65
|
+
export function int64BitsToDouble(value) {
|
|
66
|
+
const buffer = new ArrayBuffer(8);
|
|
67
|
+
const view = new DataView(buffer);
|
|
68
|
+
view.setBigInt64(0, value, littleEndian);
|
|
69
|
+
return view.getFloat64(0, littleEndian);
|
|
70
|
+
}
|
|
71
|
+
export function doubleToInt64Bits(value) {
|
|
72
|
+
const buffer = new ArrayBuffer(8);
|
|
73
|
+
const view = new DataView(buffer);
|
|
74
|
+
view.setFloat64(0, value, littleEndian);
|
|
75
|
+
return view.getBigInt64(0, littleEndian);
|
|
76
|
+
}
|
|
77
|
+
export function toBoolean(bytes, offset) {
|
|
78
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
79
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
80
|
+
return view.getUint8(offset) === 1 ? true : false;
|
|
81
|
+
}
|
|
82
|
+
export function toChar(bytes, offset) {
|
|
83
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
84
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
85
|
+
const code = view.getUint16(offset, littleEndian);
|
|
86
|
+
return String.fromCharCode(code);
|
|
87
|
+
}
|
|
88
|
+
export function toInt16(bytes, offset) {
|
|
89
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
90
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
91
|
+
return view.getInt16(offset, littleEndian);
|
|
92
|
+
}
|
|
93
|
+
export function toInt32(bytes, offset) {
|
|
94
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
95
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
96
|
+
return view.getInt32(offset, littleEndian);
|
|
97
|
+
}
|
|
98
|
+
export function toInt64(bytes, offset) {
|
|
99
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
100
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
101
|
+
return view.getBigInt64(offset, littleEndian);
|
|
102
|
+
}
|
|
103
|
+
export function toUInt16(bytes, offset) {
|
|
104
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
105
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
106
|
+
return view.getUint16(offset, littleEndian);
|
|
107
|
+
}
|
|
108
|
+
export function toUInt32(bytes, offset) {
|
|
109
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
110
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
111
|
+
return view.getUint32(offset, littleEndian);
|
|
112
|
+
}
|
|
113
|
+
export function toUInt64(bytes, offset) {
|
|
114
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
115
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
116
|
+
return view.getBigUint64(offset, littleEndian);
|
|
117
|
+
}
|
|
118
|
+
export function toSingle(bytes, offset) {
|
|
119
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
120
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
121
|
+
return view.getFloat32(offset, littleEndian);
|
|
122
|
+
}
|
|
123
|
+
export function toDouble(bytes, offset) {
|
|
124
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
125
|
+
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
126
|
+
return view.getFloat64(offset, littleEndian);
|
|
127
|
+
}
|
|
128
|
+
export function toString(bytes, offset, count) {
|
|
129
|
+
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
130
|
+
let buffer = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);
|
|
131
|
+
if (offset != null && count != null) {
|
|
132
|
+
buffer = buffer.subarray(offset, offset + count);
|
|
133
|
+
}
|
|
134
|
+
else if (offset != null) {
|
|
135
|
+
buffer = buffer.subarray(offset);
|
|
136
|
+
}
|
|
137
|
+
return Array.from(buffer).map((b) => ("0" + b.toString(16)).slice(-2)).join("-");
|
|
138
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FSharpRef } from "./Types.js";
|
|
2
|
+
import { Exception } from "./Util.js";
|
|
3
|
+
export function tryParse(str, defValue) {
|
|
4
|
+
if (str != null && str.match(/^\s*true\s*$/i)) {
|
|
5
|
+
defValue.contents = true;
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
else if (str != null && str.match(/^\s*false\s*$/i)) {
|
|
9
|
+
defValue.contents = false;
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
export function parse(str) {
|
|
15
|
+
const defValue = new FSharpRef(false);
|
|
16
|
+
if (tryParse(str, defValue)) {
|
|
17
|
+
return defValue.contents;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
throw new Exception(`String '${str}' was not recognized as a valid Boolean.`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## Unreleased
|
|
9
|
+
|
|
10
|
+
## 2.0.0-rc.6 - 2026-04-07
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
* [JS/TS] Fix `Async.StartChild` with timeout always timing out even when the computation finishes before the deadline (fixes #4481) (by @MangelMaxime)
|
|
15
|
+
|
|
16
|
+
## 2.0.0-rc.5 - 2026-03-31
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
* [JS/TS] Improve `Regex.Escape` and `Regex.Unescape` handling (by @MangelMaxime)
|
|
21
|
+
* [JS/TS] Fixed quotation for union string cases (by @MangelMaxime)
|
|
22
|
+
|
|
23
|
+
## 2.0.0-rc.4 - 2026-03-19
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
* [JS/TS] Fix `Unchecked.defaultof<char>` being emitted as `null` instead of `'\0'` (by @MangelMaxime)
|
|
28
|
+
|
|
29
|
+
## 2.0.0-rc.3 - 2026-03-10
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
* [TS] Expose optional `stack` property on `Exception` (by @MangelMaxime)
|
|
34
|
+
|
|
35
|
+
## 2.0.0-rc.2 - 2026-03-03
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
* [JS/TS] Allows compiling `fable-library-ts` for Browser environment (by @goswinr)
|
|
40
|
+
|
|
41
|
+
## 2.0.0-rc.1 - 2026-02-26
|
|
42
|
+
|
|
43
|
+
## 2.0.0-beta.7 - 2026-02-03
|
|
44
|
+
|
|
45
|
+
* [JS/TS] Fix `StringBuilder.Chars` getter and setter (by @MangelMaxime)
|
|
46
|
+
|
|
47
|
+
## 2.0.0-beta.6 - 2025-12-26
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
* [JS/TS] Fix #4305 `DateTimeOffset.Now` returns wrong time (by @ncave)
|
|
52
|
+
|
|
53
|
+
## 2.0.0-beta.5 - 2025-11-19
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
* [JS/TS] Replace the deprecated `substr` method with `slice` (by @Thorium)
|
|
58
|
+
|
|
59
|
+
## 2.0.0-beta.4 - 2025-07-25
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
* [JS/TS] Initial support for Nullable Reference Types (by @ncave)
|
|
64
|
+
|
|
65
|
+
## 2.0.0-beta.3 - 2025-03-14
|
|
66
|
+
|
|
67
|
+
### Fixed
|
|
68
|
+
|
|
69
|
+
* [JS/TS] Make `nullArgCheck` report the same error message as on .NET (by @MangelMaxime)
|
|
70
|
+
|
|
71
|
+
## 2.0.0-beta.2 - 2025-03-03
|
|
72
|
+
|
|
73
|
+
* [JS/TS] Fix #4049: decimal/bigint to integer conversion checks (by @ncave)
|
|
74
|
+
* [JS/TS] Fix `decimal` to `char` conversion checks (by @ManngelMaxime)
|
|
75
|
+
* [JS/TS] Propagate non-captured exception when running `Async.Start` or `Async.StartImmediate` (by @MangelMaxime)
|
|
76
|
+
* [JS/TS] Remove `Async.RunSynchronously` (by @MangelMaxime)
|
|
77
|
+
* [JS/TS] Change signature of `startWithContinuations` to always require all its arguments (by @MangelMaxime)
|
|
78
|
+
* [JS/TS] Fix short `DateTime` and `DateTimeOffset` short format strings (by @MangelMaxime)
|
|
79
|
+
* [JS/TS] Add `C` and `c` format for numeric types (by @MangelMaxime)
|
|
80
|
+
* [JS/TS] Add `B` and `b` format for numeric types (by @MangelMaxime)
|
|
81
|
+
* [JS/TS] Add `n` format for numeric types (by @MangelMaxime)
|
|
82
|
+
* [JS/TS] Fix numeric formats (by @MangelMaxime)
|
|
83
|
+
|
|
84
|
+
## 2.0.0-beta.1 - 2025-02-16
|
|
85
|
+
|
|
86
|
+
* Compiled with Fable 5.0.0-alpha.10
|
|
87
|
+
|
|
88
|
+
## 1.10.0 - 2025-01-23
|
|
89
|
+
|
|
90
|
+
### Added
|
|
91
|
+
|
|
92
|
+
* [JS/TS] Add `StringBuiler.Append(c: char, repeatCount: int)` overload (by @roboz0r)
|
|
93
|
+
|
|
94
|
+
## 1.9.0 - 2025-01-09
|
|
95
|
+
|
|
96
|
+
### Added
|
|
97
|
+
|
|
98
|
+
* [JS/TS] Add new `TimSpane` overload support coming from .NET 9 (by @MangelMaxime)
|
|
99
|
+
|
|
100
|
+
### Fixed
|
|
101
|
+
|
|
102
|
+
* [JS/TS] Fix `DateTimeOffset.ToLocalTime` (by @MangelMaxime)
|
|
103
|
+
|
|
104
|
+
## 1.8.0 - 2024-11-19
|
|
105
|
+
|
|
106
|
+
* [JS/TS] Fix `h` in `DateTime.ToString` (@MangelMaxime)
|
|
107
|
+
* [JS/TS] Fix `hh` in `DateTime.ToString` (@MangelMaxime)
|
|
108
|
+
|
|
109
|
+
## 1.7.0 - 2024-11-19
|
|
110
|
+
|
|
111
|
+
### Fixed
|
|
112
|
+
|
|
113
|
+
* [JS/TS] Added missing IReadOnlyCollection helpers (#3953)
|
|
114
|
+
|
|
115
|
+
## 1.6.0 - 2024-10-02
|
|
116
|
+
|
|
117
|
+
### Removed
|
|
118
|
+
|
|
119
|
+
* Remove `Async` (from `Async.ts`) class (by @MangelMaxime)
|
|
120
|
+
|
|
121
|
+
### Changed
|
|
122
|
+
|
|
123
|
+
* Renamed `IAsync` to `Async` in `AsyncBuilder.ts` (#3906) (by @ncave)
|
|
124
|
+
|
|
125
|
+
## 1.5.0 - 2024-09-19
|
|
126
|
+
|
|
127
|
+
### Added
|
|
128
|
+
|
|
129
|
+
* [JS/TS] Add support for `OrdinalIgnoreCase` overload for `String.EndsWith` (#3892) (by @goswinr)
|
|
130
|
+
* [JS/TS] Add `uri.Port`, `uri.IsDefaultPort` (by @MangelMaxime)
|
|
131
|
+
|
|
132
|
+
### Fixed
|
|
133
|
+
|
|
134
|
+
* [JS/TS] Fix escaping of `{` and `}` in FormattableString (#3890) (by @roboz0r)
|
|
135
|
+
* [JS/TS] Fix `uri.Host` to return the host name without the port (by @MangelMaxime)
|
|
136
|
+
* [JS/TS] Fix TypeScript compilation by resolving type of `jsOptions` (#3894) (by @MangelMaxime)
|
|
137
|
+
|
|
138
|
+
## 1.4.3 - 2024-09-04
|
|
139
|
+
|
|
140
|
+
* [JS/TS] Fixed Decimal comparisons (#3884) (by @ncave)
|
|
141
|
+
|
|
142
|
+
## 1.4.2 - 2024-06-13
|
|
143
|
+
|
|
144
|
+
### Fixed
|
|
145
|
+
|
|
146
|
+
* [JS/TS] Fixed BigInt.ToDecimal with negative values (#3500) (by @ncave)
|
|
147
|
+
|
|
148
|
+
## 1.4.1 - 2024-06-13
|
|
149
|
+
|
|
150
|
+
### Fixed
|
|
151
|
+
|
|
152
|
+
* [JS/TS] Fixed DateTime.MinValue, DateTime.MaxValue (#3836) (by @ncave)
|
|
153
|
+
|
|
154
|
+
## 1.4.0 - 2024-03-20
|
|
155
|
+
|
|
156
|
+
### Added
|
|
157
|
+
|
|
158
|
+
* [JS/TS] Add `ConditionalWeakTable` (by @chkn)
|
|
159
|
+
|
|
160
|
+
## 1.3.0 - 2024-03-18
|
|
161
|
+
|
|
162
|
+
* [JS/TS] `Boolean.tryParse` should not crash on `null` string (@goswinr)
|
|
163
|
+
|
|
164
|
+
## 1.2.0 - 2024-03-01
|
|
165
|
+
|
|
166
|
+
### Fixed
|
|
167
|
+
|
|
168
|
+
* [GH-3772](https://github.com/fable-compiler/Fable/pull/3772) [JS/TS] Re-implement `DateTime.ToString` custom format handling (by @MangelMaxime)
|
|
169
|
+
|
|
170
|
+
It now supports all custom format specifiers, and behave as if `CultureInfo.InvariantCulture` was used (Fable does not support Globalization).
|
|
171
|
+
|
|
172
|
+
## 1.1.0 - 2024-02-20
|
|
173
|
+
|
|
174
|
+
### Added
|
|
175
|
+
|
|
176
|
+
#### JavaScript
|
|
177
|
+
|
|
178
|
+
* [GH-3759](https://github.com/fable-compiler/Fable/issues/3759) Add `StringBuilder.Chars` (by @MangelMaxime)
|
|
179
|
+
* Add `StringBuilder.AppendFormat` (by @ncave)
|
|
180
|
+
* [GH-3748](https://github.com/fable-compiler/Fable/pull/3748) Add `Array.getItem` and `Array.setItem` (by @MangelMaxime)
|
|
181
|
+
|
|
182
|
+
## 1.0.0 - 2024-02-13
|
|
183
|
+
|
|
184
|
+
* Release stable version
|
|
185
|
+
|
|
186
|
+
## 1.0.0-beta-001 - 2024-02-12
|
|
187
|
+
|
|
188
|
+
### Changed
|
|
189
|
+
|
|
190
|
+
* Separate `Result` from `Choice`
|
|
191
|
+
* Released as part of Fable 4.12.0
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import * as Unicode from "./Unicode.13.0.0.js";
|
|
2
|
+
import { Exception } from "./Util.js";
|
|
3
|
+
function getCategoryFunc() {
|
|
4
|
+
// unpack Unicode codepoint ranges (delta encoded) and general categories
|
|
5
|
+
const offset = 35; // offsets unprintable characters
|
|
6
|
+
const a1 = [...Unicode.rangeDeltas].map((ch) => (ch.codePointAt(0) ?? 0) - offset);
|
|
7
|
+
const a2 = [...Unicode.categories].map((ch) => (ch.codePointAt(0) ?? 0) - offset);
|
|
8
|
+
const codepoints = new Uint32Array(a1);
|
|
9
|
+
const categories = new Uint8Array(a2);
|
|
10
|
+
for (let i = 1; i < codepoints.length; ++i) {
|
|
11
|
+
codepoints[i] += codepoints[i - 1];
|
|
12
|
+
}
|
|
13
|
+
// binary search in unicode ranges
|
|
14
|
+
return (cp) => {
|
|
15
|
+
let hi = codepoints.length;
|
|
16
|
+
let lo = 0;
|
|
17
|
+
while (hi - lo > 1) {
|
|
18
|
+
const mid = Math.floor((hi + lo) / 2);
|
|
19
|
+
const test = codepoints[mid];
|
|
20
|
+
if (cp < test) {
|
|
21
|
+
hi = mid;
|
|
22
|
+
}
|
|
23
|
+
else if (cp === test) {
|
|
24
|
+
hi = lo = mid;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
else if (test < cp) {
|
|
28
|
+
lo = mid;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return categories[lo];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export const UnicodeCategory = {
|
|
35
|
+
UppercaseLetter: 0,
|
|
36
|
+
LowercaseLetter: 1,
|
|
37
|
+
TitlecaseLetter: 2,
|
|
38
|
+
ModifierLetter: 3,
|
|
39
|
+
OtherLetter: 4,
|
|
40
|
+
NonSpacingMark: 5,
|
|
41
|
+
SpacingCombiningMark: 6,
|
|
42
|
+
EnclosingMark: 7,
|
|
43
|
+
DecimalDigitNumber: 8,
|
|
44
|
+
LetterNumber: 9,
|
|
45
|
+
OtherNumber: 10,
|
|
46
|
+
SpaceSeparator: 11,
|
|
47
|
+
LineSeparator: 12,
|
|
48
|
+
ParagraphSeparator: 13,
|
|
49
|
+
Control: 14,
|
|
50
|
+
Format: 15,
|
|
51
|
+
Surrogate: 16,
|
|
52
|
+
PrivateUse: 17,
|
|
53
|
+
ConnectorPunctuation: 18,
|
|
54
|
+
DashPunctuation: 19,
|
|
55
|
+
OpenPunctuation: 20,
|
|
56
|
+
ClosePunctuation: 21,
|
|
57
|
+
InitialQuotePunctuation: 22,
|
|
58
|
+
FinalQuotePunctuation: 23,
|
|
59
|
+
OtherPunctuation: 24,
|
|
60
|
+
MathSymbol: 25,
|
|
61
|
+
CurrencySymbol: 26,
|
|
62
|
+
ModifierSymbol: 27,
|
|
63
|
+
OtherSymbol: 28,
|
|
64
|
+
OtherNotAssigned: 29,
|
|
65
|
+
};
|
|
66
|
+
const isControlMask = 1 << UnicodeCategory.Control;
|
|
67
|
+
const isDigitMask = 1 << UnicodeCategory.DecimalDigitNumber;
|
|
68
|
+
const isLetterMask = 0
|
|
69
|
+
| 1 << UnicodeCategory.UppercaseLetter
|
|
70
|
+
| 1 << UnicodeCategory.LowercaseLetter
|
|
71
|
+
| 1 << UnicodeCategory.TitlecaseLetter
|
|
72
|
+
| 1 << UnicodeCategory.ModifierLetter
|
|
73
|
+
| 1 << UnicodeCategory.OtherLetter;
|
|
74
|
+
const isLetterOrDigitMask = isLetterMask | isDigitMask;
|
|
75
|
+
const isUpperMask = 1 << UnicodeCategory.UppercaseLetter;
|
|
76
|
+
const isLowerMask = 1 << UnicodeCategory.LowercaseLetter;
|
|
77
|
+
const isNumberMask = 0
|
|
78
|
+
| 1 << UnicodeCategory.DecimalDigitNumber
|
|
79
|
+
| 1 << UnicodeCategory.LetterNumber
|
|
80
|
+
| 1 << UnicodeCategory.OtherNumber;
|
|
81
|
+
const isPunctuationMask = 0
|
|
82
|
+
| 1 << UnicodeCategory.ConnectorPunctuation
|
|
83
|
+
| 1 << UnicodeCategory.DashPunctuation
|
|
84
|
+
| 1 << UnicodeCategory.OpenPunctuation
|
|
85
|
+
| 1 << UnicodeCategory.ClosePunctuation
|
|
86
|
+
| 1 << UnicodeCategory.InitialQuotePunctuation
|
|
87
|
+
| 1 << UnicodeCategory.FinalQuotePunctuation
|
|
88
|
+
| 1 << UnicodeCategory.OtherPunctuation;
|
|
89
|
+
const isSeparatorMask = 0
|
|
90
|
+
| 1 << UnicodeCategory.SpaceSeparator
|
|
91
|
+
| 1 << UnicodeCategory.LineSeparator
|
|
92
|
+
| 1 << UnicodeCategory.ParagraphSeparator;
|
|
93
|
+
const isSymbolMask = 0
|
|
94
|
+
| 1 << UnicodeCategory.MathSymbol
|
|
95
|
+
| 1 << UnicodeCategory.CurrencySymbol
|
|
96
|
+
| 1 << UnicodeCategory.ModifierSymbol
|
|
97
|
+
| 1 << UnicodeCategory.OtherSymbol;
|
|
98
|
+
const isWhiteSpaceMask = 0
|
|
99
|
+
| 1 << UnicodeCategory.SpaceSeparator
|
|
100
|
+
| 1 << UnicodeCategory.LineSeparator
|
|
101
|
+
| 1 << UnicodeCategory.ParagraphSeparator;
|
|
102
|
+
const unicodeCategoryFunc = getCategoryFunc();
|
|
103
|
+
function charCodeAt(s, index) {
|
|
104
|
+
if (index >= 0 && index < s.length) {
|
|
105
|
+
return s.charCodeAt(index);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
throw new Exception("Index out of range.");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export const getUnicodeCategory = (s) => getUnicodeCategory2(s, 0);
|
|
112
|
+
export const isControl = (s) => isControl2(s, 0);
|
|
113
|
+
export const isDigit = (s) => isDigit2(s, 0);
|
|
114
|
+
export const isLetter = (s) => isLetter2(s, 0);
|
|
115
|
+
export const isLetterOrDigit = (s) => isLetterOrDigit2(s, 0);
|
|
116
|
+
export const isUpper = (s) => isUpper2(s, 0);
|
|
117
|
+
export const isLower = (s) => isLower2(s, 0);
|
|
118
|
+
export const isNumber = (s) => isNumber2(s, 0);
|
|
119
|
+
export const isPunctuation = (s) => isPunctuation2(s, 0);
|
|
120
|
+
export const isSeparator = (s) => isSeparator2(s, 0);
|
|
121
|
+
export const isSymbol = (s) => isSymbol2(s, 0);
|
|
122
|
+
export const isWhiteSpace = (s) => isWhiteSpace2(s, 0);
|
|
123
|
+
export const isHighSurrogate = (s) => isHighSurrogate2(s, 0);
|
|
124
|
+
export const isLowSurrogate = (s) => isLowSurrogate2(s, 0);
|
|
125
|
+
export const isSurrogate = (s) => isSurrogate2(s, 0);
|
|
126
|
+
export function getUnicodeCategory2(s, index) {
|
|
127
|
+
const cp = charCodeAt(s, index);
|
|
128
|
+
return unicodeCategoryFunc(cp);
|
|
129
|
+
}
|
|
130
|
+
export function isControl2(s, index) {
|
|
131
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
132
|
+
return (test & isControlMask) !== 0;
|
|
133
|
+
}
|
|
134
|
+
export function isDigit2(s, index) {
|
|
135
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
136
|
+
return (test & isDigitMask) !== 0;
|
|
137
|
+
}
|
|
138
|
+
export function isLetter2(s, index) {
|
|
139
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
140
|
+
return (test & isLetterMask) !== 0;
|
|
141
|
+
}
|
|
142
|
+
export function isLetterOrDigit2(s, index) {
|
|
143
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
144
|
+
return (test & isLetterOrDigitMask) !== 0;
|
|
145
|
+
}
|
|
146
|
+
export function isUpper2(s, index) {
|
|
147
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
148
|
+
return (test & isUpperMask) !== 0;
|
|
149
|
+
}
|
|
150
|
+
export function isLower2(s, index) {
|
|
151
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
152
|
+
return (test & isLowerMask) !== 0;
|
|
153
|
+
}
|
|
154
|
+
export function isNumber2(s, index) {
|
|
155
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
156
|
+
return (test & isNumberMask) !== 0;
|
|
157
|
+
}
|
|
158
|
+
export function isPunctuation2(s, index) {
|
|
159
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
160
|
+
return (test & isPunctuationMask) !== 0;
|
|
161
|
+
}
|
|
162
|
+
export function isSeparator2(s, index) {
|
|
163
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
164
|
+
return (test & isSeparatorMask) !== 0;
|
|
165
|
+
}
|
|
166
|
+
export function isSymbol2(s, index) {
|
|
167
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
168
|
+
return (test & isSymbolMask) !== 0;
|
|
169
|
+
}
|
|
170
|
+
export function isWhiteSpace2(s, index) {
|
|
171
|
+
const test = 1 << getUnicodeCategory2(s, index);
|
|
172
|
+
if ((test & isWhiteSpaceMask) !== 0) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
const cp = charCodeAt(s, index);
|
|
176
|
+
return (0x09 <= cp && cp <= 0x0D) || cp === 0x85 || cp === 0xA0;
|
|
177
|
+
}
|
|
178
|
+
export function isHighSurrogate2(s, index) {
|
|
179
|
+
const cp = charCodeAt(s, index);
|
|
180
|
+
return (0xD800 <= cp && cp <= 0xDBFF);
|
|
181
|
+
}
|
|
182
|
+
export function isLowSurrogate2(s, index) {
|
|
183
|
+
const cp = charCodeAt(s, index);
|
|
184
|
+
return (0xDC00 <= cp && cp <= 0xDFFF);
|
|
185
|
+
}
|
|
186
|
+
export function isSurrogate2(s, index) {
|
|
187
|
+
const cp = charCodeAt(s, index);
|
|
188
|
+
return (0xD800 <= cp && cp <= 0xDFFF);
|
|
189
|
+
}
|
|
190
|
+
export function isSurrogatePair(s, index) {
|
|
191
|
+
return typeof index === "number"
|
|
192
|
+
? isHighSurrogate2(s, index) && isLowSurrogate2(s, index + 1)
|
|
193
|
+
: isHighSurrogate(s) && isLowSurrogate(index);
|
|
194
|
+
}
|
|
195
|
+
export function parse(input) {
|
|
196
|
+
if (input.length === 1) {
|
|
197
|
+
return input[0];
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
throw new Exception("String must be exactly one character long.");
|
|
201
|
+
}
|
|
202
|
+
}
|