echogarden 1.8.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -18
- package/data/schemas/options.json +52 -47
- package/dist/alignment/DTWSequenceAlignment.d.ts +1 -1
- package/dist/alignment/DTWSequenceAlignment.js +5 -5
- package/dist/alignment/DTWSequenceAlignment.js.map +1 -1
- package/dist/alignment/SpeechAlignment.js +6 -6
- package/dist/alignment/SpeechAlignment.js.map +1 -1
- package/dist/api/Alignment.d.ts +1 -1
- package/dist/api/Alignment.js +49 -11
- package/dist/api/Alignment.js.map +1 -1
- package/dist/api/Denoising.d.ts +4 -2
- package/dist/api/Denoising.js +65 -13
- package/dist/api/Denoising.js.map +1 -1
- package/dist/api/SourceSeparation.js +9 -6
- package/dist/api/SourceSeparation.js.map +1 -1
- package/dist/api/SpeechLanguageDetection.js +4 -4
- package/dist/api/SpeechLanguageDetection.js.map +1 -1
- package/dist/api/Synthesis.d.ts +2 -2
- package/dist/api/Synthesis.js +10 -7
- package/dist/api/Synthesis.js.map +1 -1
- package/dist/api/VoiceActivityDetection.js +2 -2
- package/dist/api/VoiceActivityDetection.js.map +1 -1
- package/dist/audio/AudioBufferConversion.d.ts +2 -2
- package/dist/audio/AudioBufferConversion.js +77 -43
- package/dist/audio/AudioBufferConversion.js.map +1 -1
- package/dist/audio/AudioPlayer.d.ts +7 -5
- package/dist/audio/AudioPlayer.js +135 -49
- package/dist/audio/AudioPlayer.js.map +1 -1
- package/dist/audio/AudioUtilities.d.ts +4 -3
- package/dist/audio/AudioUtilities.js +30 -15
- package/dist/audio/AudioUtilities.js.map +1 -1
- package/dist/audio/SoxPath.js +3 -3
- package/dist/audio/SoxPath.js.map +1 -1
- package/dist/build-tools/MakeTarballsForInstalledPackages.js +3 -3
- package/dist/build-tools/MakeTarballsForInstalledPackages.js.map +1 -1
- package/dist/cli/CLI.js +30 -36
- package/dist/cli/CLI.js.map +1 -1
- package/dist/cli/CLIConfigFile.js +2 -2
- package/dist/cli/CLIConfigFile.js.map +1 -1
- package/dist/cli/CLIOptions.d.ts +2 -0
- package/dist/cli/CLIOptions.js +1 -1
- package/dist/cli/CLIOptions.js.map +1 -1
- package/dist/codecs/FFMpegTranscoder.d.ts +3 -3
- package/dist/codecs/FFMpegTranscoder.js +6 -6
- package/dist/codecs/FFMpegTranscoder.js.map +1 -1
- package/dist/codecs/TIMITCodec.d.ts +1 -1
- package/dist/codecs/TIMITCodec.js +4 -3
- package/dist/codecs/TIMITCodec.js.map +1 -1
- package/dist/codecs/WaveCodec.d.ts +3 -3
- package/dist/codecs/WaveCodec.js +37 -34
- package/dist/codecs/WaveCodec.js.map +1 -1
- package/dist/data-structures/DynamicTypedArray.d.ts +17 -0
- package/dist/data-structures/DynamicTypedArray.js +47 -0
- package/dist/data-structures/DynamicTypedArray.js.map +1 -0
- package/dist/data-structures/Queue.js.map +1 -0
- package/dist/data-structures/WindowedList.js.map +1 -0
- package/dist/denoising/NSNet2.d.ts +26 -0
- package/dist/denoising/NSNet2.js +128 -0
- package/dist/denoising/NSNet2.js.map +1 -0
- package/dist/denoising/RNNoise.js +3 -3
- package/dist/denoising/RNNoise.js.map +1 -1
- package/dist/dsp/FFT.d.ts +6 -1
- package/dist/dsp/FFT.js +17 -0
- package/dist/dsp/FFT.js.map +1 -1
- package/dist/encodings/Ascii.d.ts +10 -0
- package/dist/encodings/Ascii.js +41 -0
- package/dist/encodings/Ascii.js.map +1 -0
- package/dist/encodings/Base64.d.ts +5 -0
- package/dist/encodings/Base64.js +114 -0
- package/dist/encodings/Base64.js.map +1 -0
- package/dist/encodings/Hex.d.ts +3 -0
- package/dist/encodings/Hex.js +52 -0
- package/dist/encodings/Hex.js.map +1 -0
- package/dist/{utilities → encodings}/LEB128.d.ts +1 -1
- package/dist/{utilities → encodings}/LEB128.js +4 -4
- package/dist/encodings/LEB128.js.map +1 -0
- package/dist/{utilities → encodings}/LPVarInt.d.ts +1 -1
- package/dist/{utilities → encodings}/LPVarInt.js +6 -6
- package/dist/encodings/LPVarInt.js.map +1 -0
- package/dist/encodings/TextEncodingsCommon.d.ts +4 -0
- package/dist/encodings/TextEncodingsCommon.js +2 -0
- package/dist/encodings/TextEncodingsCommon.js.map +1 -0
- package/dist/encodings/Utf16.d.ts +10 -0
- package/dist/encodings/Utf16.js +36 -0
- package/dist/encodings/Utf16.js.map +1 -0
- package/dist/encodings/Utf32.d.ts +9 -0
- package/dist/encodings/Utf32.js +44 -0
- package/dist/encodings/Utf32.js.map +1 -0
- package/dist/encodings/Utf8.d.ts +10 -0
- package/dist/encodings/Utf8.js +97 -0
- package/dist/encodings/Utf8.js.map +1 -0
- package/dist/math/MedianFilter.js.map +1 -1
- package/dist/nlp/JapaneseSegmentation.js +2 -2
- package/dist/nlp/JapaneseSegmentation.js.map +1 -1
- package/dist/recognition/GoogleCloudSTT.js +2 -1
- package/dist/recognition/GoogleCloudSTT.js.map +1 -1
- package/dist/recognition/SileroSTT.js +3 -3
- package/dist/recognition/SileroSTT.js.map +1 -1
- package/dist/recognition/VoskSTT.js +3 -3
- package/dist/recognition/VoskSTT.js.map +1 -1
- package/dist/recognition/WhisperCppSTT.js +4 -5
- package/dist/recognition/WhisperCppSTT.js.map +1 -1
- package/dist/recognition/WhisperSTT.js +8 -7
- package/dist/recognition/WhisperSTT.js.map +1 -1
- package/dist/server/Client.d.ts +1 -1
- package/dist/server/Client.js +2 -1
- package/dist/server/Client.js.map +1 -1
- package/dist/server/Server.js +5 -4
- package/dist/server/Server.js.map +1 -1
- package/dist/server/Worker.js +1 -1
- package/dist/server/Worker.js.map +1 -1
- package/dist/source-separation/MDXNetSourceSeparation.js +1 -1
- package/dist/source-separation/MDXNetSourceSeparation.js.map +1 -1
- package/dist/speech-search/DTWSpeechSearch.d.ts +1 -1
- package/dist/speech-search/DTWSpeechSearch.js +25 -6
- package/dist/speech-search/DTWSpeechSearch.js.map +1 -1
- package/dist/subtitles/Subtitles.js +2 -2
- package/dist/subtitles/Subtitles.js.map +1 -1
- package/dist/synthesis/AzureCognitiveServicesTTS.js +17 -18
- package/dist/synthesis/AzureCognitiveServicesTTS.js.map +1 -1
- package/dist/synthesis/CoquiServerTTS.js +1 -1
- package/dist/synthesis/CoquiServerTTS.js.map +1 -1
- package/dist/synthesis/ElevenlabsTTS.js +1 -1
- package/dist/synthesis/ElevenlabsTTS.js.map +1 -1
- package/dist/synthesis/EspeakTTS.d.ts +0 -1
- package/dist/synthesis/EspeakTTS.js +0 -9
- package/dist/synthesis/EspeakTTS.js.map +1 -1
- package/dist/synthesis/FliteTTS.js +7 -8
- package/dist/synthesis/FliteTTS.js.map +1 -1
- package/dist/synthesis/GoogleCloudTTS.d.ts +1 -1
- package/dist/synthesis/GoogleCloudTTS.js +2 -1
- package/dist/synthesis/GoogleCloudTTS.js.map +1 -1
- package/dist/synthesis/GoogleTranslateTTS.d.ts +1 -1
- package/dist/synthesis/GoogleTranslateTTS.js +4 -3
- package/dist/synthesis/GoogleTranslateTTS.js.map +1 -1
- package/dist/synthesis/MicrosoftEdgeTTS.js +32 -7
- package/dist/synthesis/MicrosoftEdgeTTS.js.map +1 -1
- package/dist/synthesis/SapiTTS.js +1 -1
- package/dist/synthesis/SapiTTS.js.map +1 -1
- package/dist/synthesis/StreamlabsPollyTTS.d.ts +1 -1
- package/dist/synthesis/StreamlabsPollyTTS.js +1 -1
- package/dist/synthesis/StreamlabsPollyTTS.js.map +1 -1
- package/dist/synthesis/SvoxPicoTTS.js +6 -6
- package/dist/synthesis/SvoxPicoTTS.js.map +1 -1
- package/dist/synthesis/VitsTTS.js +2 -2
- package/dist/synthesis/VitsTTS.js.map +1 -1
- package/dist/tests/Test.js +1 -47
- package/dist/tests/Test.js.map +1 -1
- package/dist/text-language-detection/FastTextLanguageDetection.js +2 -2
- package/dist/text-language-detection/FastTextLanguageDetection.js.map +1 -1
- package/dist/typings/TypedArray.d.ts +4 -0
- package/dist/typings/TypedArray.js +2 -0
- package/dist/typings/TypedArray.js.map +1 -0
- package/dist/utilities/BinaryArrayConversion.d.ts +12 -22
- package/dist/utilities/BinaryArrayConversion.js +40 -90
- package/dist/utilities/BinaryArrayConversion.js.map +1 -1
- package/dist/utilities/BinaryUtilities.d.ts +13 -0
- package/dist/utilities/BinaryUtilities.js +113 -0
- package/dist/utilities/BinaryUtilities.js.map +1 -0
- package/dist/utilities/Compression.js +7 -6
- package/dist/utilities/Compression.js.map +1 -1
- package/dist/utilities/FileDownloader.js +26 -47
- package/dist/utilities/FileDownloader.js.map +1 -1
- package/dist/utilities/FileReader.d.ts +14 -0
- package/dist/utilities/FileReader.js +71 -0
- package/dist/utilities/FileReader.js.map +1 -0
- package/dist/utilities/FileSystem.d.ts +19 -16
- package/dist/utilities/FileSystem.js +170 -109
- package/dist/utilities/FileSystem.js.map +1 -1
- package/dist/utilities/FileWriter.d.ts +12 -0
- package/dist/utilities/FileWriter.js +60 -0
- package/dist/utilities/FileWriter.js.map +1 -0
- package/dist/utilities/NpmUtilities.d.ts +1 -0
- package/dist/utilities/NpmUtilities.js +14 -0
- package/dist/utilities/NpmUtilities.js.map +1 -0
- package/dist/utilities/PackageManager.js +7 -5
- package/dist/utilities/PackageManager.js.map +1 -1
- package/dist/utilities/PathUtilities.d.ts +8 -0
- package/dist/utilities/PathUtilities.js +28 -7
- package/dist/utilities/PathUtilities.js.map +1 -1
- package/dist/utilities/SignalChannel.d.ts +3 -1
- package/dist/utilities/SignalChannel.js +9 -5
- package/dist/utilities/SignalChannel.js.map +1 -1
- package/dist/utilities/StringBuilder.d.ts +10 -0
- package/dist/utilities/StringBuilder.js +39 -0
- package/dist/utilities/StringBuilder.js.map +1 -0
- package/dist/utilities/StringUtilities.js.map +1 -1
- package/dist/utilities/TarballMaker.js +6 -7
- package/dist/utilities/TarballMaker.js.map +1 -1
- package/dist/utilities/Timer.js +2 -2
- package/dist/utilities/Timer.js.map +1 -1
- package/dist/utilities/Utilities.d.ts +11 -5
- package/dist/utilities/Utilities.js +69 -33
- package/dist/utilities/Utilities.js.map +1 -1
- package/dist/utilities/VirtualFileReadStream.d.ts +3 -3
- package/dist/utilities/VirtualFileReadStream.js.map +1 -1
- package/dist/utilities/WasmMemoryManager.d.ts +5 -2
- package/dist/utilities/WasmMemoryManager.js +15 -4
- package/dist/utilities/WasmMemoryManager.js.map +1 -1
- package/docs/API.md +1 -1
- package/docs/Licenses.md +3 -0
- package/docs/Options.md +9 -3
- package/docs/Tasklist.md +0 -1
- package/docs/Technical.md +2 -2
- package/package.json +20 -22
- package/src/alignment/DTWSequenceAlignment.ts +5 -5
- package/src/alignment/SpeechAlignment.ts +6 -6
- package/src/api/Alignment.ts +65 -12
- package/src/api/Denoising.ts +97 -17
- package/src/api/SourceSeparation.ts +11 -8
- package/src/api/SpeechLanguageDetection.ts +4 -4
- package/src/api/Synthesis.ts +15 -11
- package/src/api/VoiceActivityDetection.ts +2 -2
- package/src/audio/AudioBufferConversion.ts +84 -45
- package/src/audio/AudioPlayer.ts +155 -53
- package/src/audio/AudioUtilities.ts +38 -22
- package/src/audio/SoxPath.ts +3 -3
- package/src/build-tools/MakeTarballsForInstalledPackages.ts +3 -3
- package/src/cli/CLI.ts +30 -36
- package/src/cli/CLIConfigFile.ts +2 -2
- package/src/cli/CLIOptions.ts +4 -1
- package/src/codecs/FFMpegTranscoder.ts +11 -11
- package/src/codecs/TIMITCodec.ts +5 -4
- package/src/codecs/WaveCodec.ts +42 -39
- package/src/data-structures/DynamicTypedArray.ts +64 -0
- package/src/denoising/NSNet2.ts +182 -0
- package/src/denoising/RNNoise.ts +3 -3
- package/src/dsp/FFT.ts +21 -1
- package/src/encodings/Ascii.ts +60 -0
- package/src/encodings/Base64.ts +157 -0
- package/src/encodings/Hex.ts +67 -0
- package/src/{utilities → encodings}/LEB128.ts +4 -4
- package/src/{utilities → encodings}/LPVarInt.ts +6 -6
- package/src/encodings/TextEncodingsCommon.ts +4 -0
- package/src/encodings/Utf16.ts +52 -0
- package/src/encodings/Utf32.ts +62 -0
- package/src/encodings/Utf8.ts +117 -0
- package/src/math/MedianFilter.ts +0 -2
- package/src/nlp/JapaneseSegmentation.ts +2 -2
- package/src/recognition/GoogleCloudSTT.ts +2 -1
- package/src/recognition/SileroSTT.ts +3 -3
- package/src/recognition/VoskSTT.ts +3 -3
- package/src/recognition/WhisperCppSTT.ts +4 -5
- package/src/recognition/WhisperSTT.ts +8 -7
- package/src/server/Client.ts +4 -3
- package/src/server/Server.ts +6 -5
- package/src/server/Worker.ts +1 -1
- package/src/source-separation/MDXNetSourceSeparation.ts +1 -1
- package/src/speech-search/DTWSpeechSearch.ts +36 -7
- package/src/subtitles/Subtitles.ts +3 -3
- package/src/synthesis/AzureCognitiveServicesTTS.ts +18 -15
- package/src/synthesis/CoquiServerTTS.ts +2 -2
- package/src/synthesis/ElevenlabsTTS.ts +1 -1
- package/src/synthesis/EspeakTTS.ts +0 -15
- package/src/synthesis/FliteTTS.ts +7 -8
- package/src/synthesis/GoogleCloudTTS.ts +3 -2
- package/src/synthesis/GoogleTranslateTTS.ts +5 -4
- package/src/synthesis/MicrosoftEdgeTTS.ts +47 -15
- package/src/synthesis/SapiTTS.ts +1 -1
- package/src/synthesis/StreamlabsPollyTTS.ts +1 -1
- package/src/synthesis/SvoxPicoTTS.ts +8 -8
- package/src/synthesis/VitsTTS.ts +2 -2
- package/src/tests/Test.ts +1 -60
- package/src/text-language-detection/FastTextLanguageDetection.ts +2 -2
- package/src/typings/Fillers.d.ts +2 -4
- package/src/typings/TypedArray.ts +5 -0
- package/src/utilities/BinaryArrayConversion.ts +51 -125
- package/src/utilities/BinaryUtilities.ts +138 -0
- package/src/utilities/Compression.ts +7 -6
- package/src/utilities/FileDownloader.ts +27 -52
- package/src/utilities/FileReader.ts +89 -0
- package/src/utilities/FileSystem.ts +213 -120
- package/src/utilities/FileWriter.ts +72 -0
- package/src/utilities/NpmUtilities.ts +23 -0
- package/src/utilities/PackageManager.ts +8 -5
- package/src/utilities/PathUtilities.ts +36 -7
- package/src/utilities/SignalChannel.ts +14 -7
- package/src/utilities/StringBuilder.ts +45 -0
- package/src/utilities/StringUtilities.ts +2 -0
- package/src/utilities/TarballMaker.ts +6 -7
- package/src/utilities/Timer.ts +4 -2
- package/src/utilities/Utilities.ts +79 -45
- package/src/utilities/VirtualFileReadStream.ts +5 -5
- package/src/utilities/WasmMemoryManager.ts +20 -6
- package/tsconfig.json +96 -0
- package/dist/utilities/DynamicUint8Array.d.ts +0 -9
- package/dist/utilities/DynamicUint8Array.js +0 -31
- package/dist/utilities/DynamicUint8Array.js.map +0 -1
- package/dist/utilities/LEB128.js.map +0 -1
- package/dist/utilities/LPVarInt.js.map +0 -1
- package/dist/utilities/Queue.js.map +0 -1
- package/dist/utilities/WindowedList.js.map +0 -1
- package/src/utilities/DynamicUint8Array.ts +0 -39
- /package/dist/{utilities → data-structures}/Queue.d.ts +0 -0
- /package/dist/{utilities → data-structures}/Queue.js +0 -0
- /package/dist/{utilities → data-structures}/WindowedList.d.ts +0 -0
- /package/dist/{utilities → data-structures}/WindowedList.js +0 -0
- /package/src/{utilities → data-structures}/Queue.ts +0 -0
- /package/src/{utilities → data-structures}/WindowedList.ts +0 -0
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
export class SignalChannel {
|
|
2
2
|
channel: MessageChannel
|
|
3
|
+
handlers = new Map<string, SignalChannelHandler>()
|
|
3
4
|
|
|
4
5
|
constructor() {
|
|
5
6
|
this.channel = new MessageChannel()
|
|
6
7
|
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
on(signalName: string, handler: (data?: any) => void) {
|
|
10
8
|
this.channel.port2.onmessage = (event: MessageEvent) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const signalName = event.data.signalName
|
|
10
|
+
const signalData = event.data.data
|
|
11
|
+
|
|
12
|
+
const handler = this.handlers.get(signalName)
|
|
14
13
|
|
|
15
|
-
handler
|
|
14
|
+
if (handler) {
|
|
15
|
+
handler(signalData)
|
|
16
|
+
}
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
on(signalName: string, handler: SignalChannelHandler) {
|
|
21
|
+
this.handlers.set(signalName, handler)
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
send(signalName: string, data?: any) {
|
|
20
25
|
this.channel.port1.postMessage({ signalName, data })
|
|
21
26
|
}
|
|
22
27
|
}
|
|
28
|
+
|
|
29
|
+
export type SignalChannelHandler = (data?: any) => void
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DynamicUint16Array, createDynamicUint16Array } from '../data-structures/DynamicTypedArray.js'
|
|
2
|
+
import { decodeUtf16 } from '../encodings/Utf16.js'
|
|
3
|
+
|
|
4
|
+
export class StringBuilder {
|
|
5
|
+
private outputBuffer: DynamicUint16Array
|
|
6
|
+
|
|
7
|
+
constructor(initialCapacity = 8) {
|
|
8
|
+
this.outputBuffer = createDynamicUint16Array(initialCapacity)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
appendCharCode(charCode: number) {
|
|
12
|
+
this.outputBuffer.add(charCode)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
appendCharCodes(...charCodes: number[]) {
|
|
16
|
+
this.outputBuffer.addArray(charCodes)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
appendCharCodeArray(charCodes: ArrayLike<number>) {
|
|
20
|
+
this.outputBuffer.addArray(charCodes)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
appendString(str: string) {
|
|
24
|
+
const length = str.length
|
|
25
|
+
|
|
26
|
+
for (let i = 0; i < length; i++) {
|
|
27
|
+
this.appendCharCode(str.charCodeAt(i))
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
appendCodePoint(codePoint: number) {
|
|
32
|
+
if (codePoint <= 0xffff) {
|
|
33
|
+
this.appendCharCode(codePoint)
|
|
34
|
+
} else if (codePoint <= 0x10ffff) {
|
|
35
|
+
this.appendCharCode(0xd800 + ((codePoint - 0x10000) >>> 10))
|
|
36
|
+
this.appendCharCode(0xdc00 + ((codePoint - 0x10000) & 1023))
|
|
37
|
+
} else {
|
|
38
|
+
throw new Error(`appendCodePoint: A code point of ${codePoint} cannot be encoded in UTF-16`)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
toString() {
|
|
43
|
+
return decodeUtf16(this.outputBuffer.toTypedArray())
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
1
|
import { createTarball } from './Compression.js'
|
|
3
2
|
import { ensureDir, move, readdir, stat } from './FileSystem.js'
|
|
4
3
|
import { appName } from '../api/Common.js'
|
|
5
4
|
import { getRandomHexString } from './Utilities.js'
|
|
6
|
-
import { getAppTempDir } from './PathUtilities.js'
|
|
5
|
+
import { getAppTempDir, getFileNameWithoutExtension, joinPath } from './PathUtilities.js'
|
|
7
6
|
|
|
8
7
|
export async function createNamedTarball(inputPath: string, name: string, tarballDir: string) {
|
|
9
8
|
const tempDir = getAppTempDir(appName)
|
|
10
9
|
await ensureDir(tempDir)
|
|
11
|
-
const tempFilename =
|
|
10
|
+
const tempFilename = joinPath(tempDir, getRandomHexString(16))
|
|
12
11
|
|
|
13
12
|
await createTarball(inputPath, tempFilename, name)
|
|
14
13
|
|
|
15
|
-
const targetFilname =
|
|
14
|
+
const targetFilname = joinPath(tarballDir, `${name}.tar.gz`)
|
|
16
15
|
|
|
17
16
|
await move(tempFilename, targetFilname)
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export async function createTarballForEachDirIn(baseDir: string, namePrefix: string, tarballDir: string) {
|
|
21
20
|
for (const dirName of await readdir(baseDir)) {
|
|
22
|
-
const dirPath =
|
|
21
|
+
const dirPath = joinPath(baseDir, dirName)
|
|
23
22
|
|
|
24
23
|
const fileStat = await stat(dirPath)
|
|
25
24
|
|
|
@@ -35,9 +34,9 @@ export async function createTarballForEachDirIn(baseDir: string, namePrefix: str
|
|
|
35
34
|
|
|
36
35
|
export async function createTarballForEachFileIn(baseDir: string, namePrefix: string, tarballDir: string) {
|
|
37
36
|
for (const filename of await readdir(baseDir)) {
|
|
38
|
-
const filenameWithoutExtension =
|
|
37
|
+
const filenameWithoutExtension = getFileNameWithoutExtension(filename)
|
|
39
38
|
|
|
40
|
-
const filePath =
|
|
39
|
+
const filePath = joinPath(baseDir, filename)
|
|
41
40
|
|
|
42
41
|
const fileStat = await stat(filePath)
|
|
43
42
|
|
package/src/utilities/Timer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { logToStderr, roundToDigits } from './Utilities.js'
|
|
2
2
|
|
|
3
3
|
declare const chrome: any
|
|
4
4
|
declare const process: any
|
|
@@ -27,6 +27,7 @@ export class Timer {
|
|
|
27
27
|
getElapsedTimeAndRestart(): number {
|
|
28
28
|
const elapsedTime = this.elapsedTime
|
|
29
29
|
this.restart()
|
|
30
|
+
|
|
30
31
|
return elapsedTime
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -35,7 +36,8 @@ export class Timer {
|
|
|
35
36
|
|
|
36
37
|
//
|
|
37
38
|
const message = `${title}: ${roundToDigits(elapsedTime, timePrecision)}ms`
|
|
38
|
-
|
|
39
|
+
|
|
40
|
+
logToStderr(message)
|
|
39
41
|
//
|
|
40
42
|
|
|
41
43
|
this.restart()
|
|
@@ -6,30 +6,37 @@ import { randomUUID, randomBytes } from 'node:crypto'
|
|
|
6
6
|
import { Logger } from './Logger.js'
|
|
7
7
|
import { ChildProcessWithoutNullStreams } from 'node:child_process'
|
|
8
8
|
import { inspect } from 'node:util'
|
|
9
|
+
import { TypedArray, TypedArrayConstructor } from '../typings/TypedArray.js'
|
|
10
|
+
import { encodeHex } from '../encodings/Hex.js'
|
|
9
11
|
|
|
10
12
|
const log = logToStderr
|
|
11
13
|
|
|
14
|
+
export function concatUint8Arrays(arrays: Uint8Array[]) {
|
|
15
|
+
return concatTypedArrays<Uint8Array>(Uint8Array, arrays)
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
export function concatFloat32Arrays(arrays: Float32Array[]) {
|
|
13
19
|
return concatTypedArrays<Float32Array>(Float32Array, arrays)
|
|
14
20
|
}
|
|
15
21
|
|
|
16
|
-
function concatTypedArrays<
|
|
22
|
+
function concatTypedArrays<T extends TypedArray>(TypedArrayConstructor: TypedArrayConstructor<T>, arrays: T[]) {
|
|
17
23
|
let totalLength = 0
|
|
18
24
|
|
|
19
|
-
for (const
|
|
20
|
-
totalLength +=
|
|
25
|
+
for (const array of arrays) {
|
|
26
|
+
totalLength += array.length
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
const result = new
|
|
29
|
+
const result = new TypedArrayConstructor(totalLength)
|
|
24
30
|
|
|
25
|
-
let
|
|
31
|
+
let writeOffset = 0
|
|
26
32
|
|
|
27
|
-
for (const
|
|
28
|
-
result.set(
|
|
29
|
-
|
|
33
|
+
for (const array of arrays) {
|
|
34
|
+
result.set(array, writeOffset)
|
|
35
|
+
|
|
36
|
+
writeOffset += array.length
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
return
|
|
39
|
+
return result as T
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
export function shuffleArray<T>(array: T[], randomGen: RandomGenerator) {
|
|
@@ -80,18 +87,14 @@ export function formatObjectToString(obj: any) {
|
|
|
80
87
|
return formattedString
|
|
81
88
|
}
|
|
82
89
|
|
|
83
|
-
export function getRandomHexString(charCount = 32
|
|
90
|
+
export function getRandomHexString(charCount = 32) {
|
|
84
91
|
if (charCount % 2 !== 0) {
|
|
85
92
|
throw new Error(`'charCount' must be an even number`)
|
|
86
93
|
}
|
|
87
94
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (upperCase) {
|
|
91
|
-
hex = hex.toUpperCase()
|
|
92
|
-
}
|
|
95
|
+
const randomHex = encodeHex(randomBytes(charCount / 2))
|
|
93
96
|
|
|
94
|
-
return
|
|
97
|
+
return randomHex
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
export function getRandomUUID(dashes = true) {
|
|
@@ -139,10 +142,61 @@ export function printMatrix(matrix: Float32Array[]) {
|
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
144
|
|
|
142
|
-
export function
|
|
143
|
-
|
|
145
|
+
export async function parseJson(jsonText: string, useJson5 = false) {
|
|
146
|
+
if (useJson5) {
|
|
147
|
+
const { default: JSON5 } = await import('json5')
|
|
148
|
+
|
|
149
|
+
return JSON5.parse(jsonText)
|
|
150
|
+
} else {
|
|
151
|
+
return JSON.parse(jsonText)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export async function stringifyAndFormatJson(obj: any, useJson5 = false) {
|
|
156
|
+
let textContent: string
|
|
157
|
+
|
|
158
|
+
if (useJson5) {
|
|
159
|
+
const { default: JSON5 } = await import('json5')
|
|
160
|
+
|
|
161
|
+
textContent = JSON5.stringify(obj, undefined, 4)
|
|
162
|
+
} else {
|
|
163
|
+
textContent = JSON.stringify(obj, undefined, 4)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return textContent
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export async function parseJSONAndGetType(str: string, useJson5 = false) {
|
|
170
|
+
let parsedValue: any = undefined
|
|
171
|
+
|
|
172
|
+
try {
|
|
173
|
+
parsedValue = await parseJson(str, useJson5)
|
|
174
|
+
} catch (e) {
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
let jsonType: 'null' | 'string' | 'number' | 'boolean' | 'array' | 'object' | undefined = undefined
|
|
178
|
+
|
|
179
|
+
if (parsedValue === null) {
|
|
180
|
+
jsonType = 'null'
|
|
181
|
+
} else if (typeof parsedValue === 'string') {
|
|
182
|
+
jsonType = 'string'
|
|
183
|
+
} else if (typeof parsedValue === 'number') {
|
|
184
|
+
jsonType = 'number'
|
|
185
|
+
} else if (typeof parsedValue === 'boolean') {
|
|
186
|
+
jsonType = 'boolean'
|
|
187
|
+
} else if (Array.isArray(parsedValue)) {
|
|
188
|
+
jsonType = 'array'
|
|
189
|
+
} else if (typeof parsedValue === 'object') {
|
|
190
|
+
jsonType = 'object'
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
parsedValue,
|
|
195
|
+
jsonType
|
|
196
|
+
}
|
|
144
197
|
}
|
|
145
198
|
|
|
199
|
+
|
|
146
200
|
export function secondsToHMS(totalSeconds: number) {
|
|
147
201
|
let remainingSeconds = totalSeconds
|
|
148
202
|
|
|
@@ -267,15 +321,15 @@ export function clip(num: number, min: number, max: number) {
|
|
|
267
321
|
}
|
|
268
322
|
|
|
269
323
|
export function readBinaryIncomingMessage(incomingMessage: IncomingMessage) {
|
|
270
|
-
return new Promise<
|
|
271
|
-
const chunks:
|
|
324
|
+
return new Promise<Uint8Array>((resolve, reject) => {
|
|
325
|
+
const chunks: Uint8Array[] = []
|
|
272
326
|
|
|
273
327
|
incomingMessage.on('data', (chunk) => {
|
|
274
|
-
chunks.push(
|
|
328
|
+
chunks.push(Uint8Array.from(chunk))
|
|
275
329
|
})
|
|
276
330
|
|
|
277
331
|
incomingMessage.on('end', () => {
|
|
278
|
-
resolve(
|
|
332
|
+
resolve(concatUint8Arrays(chunks))
|
|
279
333
|
})
|
|
280
334
|
|
|
281
335
|
incomingMessage.on('error', (e) => {
|
|
@@ -398,7 +452,7 @@ export async function runOperationWithRetries<R>(
|
|
|
398
452
|
throw new Error(`${operationName} failed after ${maxRetries} retry attempts`)
|
|
399
453
|
}
|
|
400
454
|
|
|
401
|
-
export function writeToStdinInChunks(process: ChildProcessWithoutNullStreams, buffer:
|
|
455
|
+
export function writeToStdinInChunks(process: ChildProcessWithoutNullStreams, buffer: Uint8Array, chunkSize: number) {
|
|
402
456
|
const writeChunk = (chunkOffset: number) => {
|
|
403
457
|
if (chunkOffset >= buffer.length) {
|
|
404
458
|
process.stdin.end() // End the stream after writing all chunks
|
|
@@ -431,26 +485,6 @@ export function getIntegerRange(start: number, end: number) {
|
|
|
431
485
|
return result
|
|
432
486
|
}
|
|
433
487
|
|
|
434
|
-
export function
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
for (const buffer of buffers) {
|
|
438
|
-
totalLength += buffer.length
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
const resultBuffer = Buffer.alloc(totalLength)
|
|
442
|
-
|
|
443
|
-
if (totalLength === 0) {
|
|
444
|
-
return resultBuffer
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
let writeOffset = 0
|
|
448
|
-
|
|
449
|
-
for (const buffer of buffers) {
|
|
450
|
-
resultBuffer.set(buffer, writeOffset)
|
|
451
|
-
|
|
452
|
-
writeOffset += buffer.length
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
return resultBuffer
|
|
488
|
+
export function isUint8Array(value: any): value is Uint8Array {
|
|
489
|
+
return value instanceof Uint8Array
|
|
456
490
|
}
|
|
@@ -2,7 +2,7 @@ import { Readable } from 'stream'
|
|
|
2
2
|
import { EventEmitter } from 'events'
|
|
3
3
|
import { ReadStream as FsReadStream } from 'fs'
|
|
4
4
|
|
|
5
|
-
export function createVirtualFileReadStreamForBuffer(buffer:
|
|
5
|
+
export function createVirtualFileReadStreamForBuffer(buffer: Uint8Array, path?: string) {
|
|
6
6
|
const bufferReadStream = new VirtualFileReadStream(buffer, path)
|
|
7
7
|
|
|
8
8
|
const proxyStream = new Proxy<FsReadStream>(bufferReadStream, {
|
|
@@ -23,19 +23,19 @@ export function createVirtualFileReadStreamForBuffer(buffer: Buffer, path?: stri
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export class VirtualFileReadStream extends Readable {
|
|
26
|
-
private readonly buffer:
|
|
26
|
+
private readonly buffer: Uint8Array
|
|
27
27
|
|
|
28
28
|
position: number
|
|
29
29
|
bytesRead: number
|
|
30
|
-
readonly path: string
|
|
30
|
+
readonly path: string
|
|
31
31
|
pending: boolean
|
|
32
32
|
readonly emitter: EventEmitter
|
|
33
33
|
|
|
34
|
-
constructor(buffer:
|
|
34
|
+
constructor(buffer: Uint8Array, virtualPath?: string) {
|
|
35
35
|
super({ autoDestroy: false })
|
|
36
36
|
|
|
37
37
|
this.buffer = buffer
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
this.position = 0
|
|
40
40
|
this.bytesRead = 0
|
|
41
41
|
this.path = virtualPath || ''
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { decodeUtf8, encodeUtf8 } from "../encodings/Utf8.js"
|
|
2
|
+
import { TypedArray } from "../typings/TypedArray.js"
|
|
3
|
+
import { concatUint8Arrays } from "./Utilities.js"
|
|
2
4
|
|
|
3
5
|
export class WasmMemoryManager {
|
|
4
6
|
wasmModule: any
|
|
@@ -223,7 +225,7 @@ export class WasmMemoryManager {
|
|
|
223
225
|
}
|
|
224
226
|
|
|
225
227
|
allocNullTerminatedUtf8String(str: string) {
|
|
226
|
-
const strBuffer =
|
|
228
|
+
const strBuffer = concatUint8Arrays([encodeUtf8(str), new Uint8Array(1)])
|
|
227
229
|
const ref = this.allocUint8Array(strBuffer.length)
|
|
228
230
|
ref.view.set(strBuffer)
|
|
229
231
|
return ref
|
|
@@ -257,6 +259,12 @@ export class WasmMemoryManager {
|
|
|
257
259
|
this.free(wasmReference)
|
|
258
260
|
}
|
|
259
261
|
}
|
|
262
|
+
|
|
263
|
+
detach<T extends WasmRef>(wasmReference: T) {
|
|
264
|
+
this.allocatedReferences.delete(wasmReference)
|
|
265
|
+
|
|
266
|
+
return wasmReference
|
|
267
|
+
}
|
|
260
268
|
}
|
|
261
269
|
|
|
262
270
|
abstract class ValueRef<T extends number | string> {
|
|
@@ -304,6 +312,10 @@ abstract class ValueRef<T extends number | string> {
|
|
|
304
312
|
this.manager.free(this as any)
|
|
305
313
|
}
|
|
306
314
|
|
|
315
|
+
detach() {
|
|
316
|
+
return this.manager.detach(this as any) as this
|
|
317
|
+
}
|
|
318
|
+
|
|
307
319
|
clearAddress() {
|
|
308
320
|
this.ptr = 0
|
|
309
321
|
}
|
|
@@ -409,7 +421,7 @@ export class NullTerminatedUtf8StringRef extends ValueRef<string> {
|
|
|
409
421
|
|
|
410
422
|
const strBytes = heapU8.subarray(ptr, ptr + endByteOffset)
|
|
411
423
|
|
|
412
|
-
const str =
|
|
424
|
+
const str = decodeUtf8(strBytes)
|
|
413
425
|
|
|
414
426
|
return str
|
|
415
427
|
}
|
|
@@ -461,6 +473,10 @@ abstract class TypedArrayRef<T extends TypedArray> {
|
|
|
461
473
|
this.ptr = 0
|
|
462
474
|
}
|
|
463
475
|
|
|
476
|
+
detach() {
|
|
477
|
+
return this.manager.detach(this)
|
|
478
|
+
}
|
|
479
|
+
|
|
464
480
|
get isFreed() { return this.ptr == 0 }
|
|
465
481
|
|
|
466
482
|
protected assertNotFreed() {
|
|
@@ -492,7 +508,7 @@ export class Uint8ArrayRef extends TypedArrayRef<Uint8Array> {
|
|
|
492
508
|
strBytes = strBytes.subarray(0, indexOfFirstZero)
|
|
493
509
|
}
|
|
494
510
|
|
|
495
|
-
const str =
|
|
511
|
+
const str = decodeUtf8(strBytes)
|
|
496
512
|
|
|
497
513
|
return str
|
|
498
514
|
}
|
|
@@ -539,8 +555,6 @@ export class Float64ArrayRef extends TypedArrayRef<Float64Array> {
|
|
|
539
555
|
return this.module.HEAPF64.subarray(startIndex, startIndex + this.length) as Float64Array
|
|
540
556
|
}
|
|
541
557
|
}
|
|
542
|
-
|
|
543
|
-
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array
|
|
544
558
|
export type WasmRef = ValueRef<number> | ValueRef<string> | TypedArrayRef<TypedArray>
|
|
545
559
|
|
|
546
560
|
export interface WasmMemoryManagerOptions {
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["src/**/*"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
/* Language and Environment */
|
|
13
|
+
"target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
14
|
+
// "lib": ["ES2022"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
15
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
16
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
17
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
18
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
19
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
20
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
21
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
22
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
23
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
24
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
25
|
+
/* Modules */
|
|
26
|
+
"module": "Node16", /* Specify what module code is generated. */
|
|
27
|
+
//"rootDir": "./src", /* Specify the root folder within your source files. */
|
|
28
|
+
"moduleResolution": "Node16", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
29
|
+
// "baseUrl": "./src", /* Specify the base directory to resolve non-relative module names. */
|
|
30
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
31
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
32
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
33
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
34
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
35
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
36
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
37
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
38
|
+
/* JavaScript Support */
|
|
39
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
40
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
41
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
42
|
+
/* Emit */
|
|
43
|
+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
44
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
45
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
46
|
+
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
47
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
48
|
+
"outDir": "./dist", /* Specify an output folder for all emitted files. */
|
|
49
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
50
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
51
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
52
|
+
"importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
53
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
54
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
55
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
56
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
57
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
58
|
+
"emitBOM": false, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
59
|
+
"newLine": "lf", /* Set the newline character for emitting files. */
|
|
60
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
61
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
62
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
63
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
64
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
65
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
66
|
+
/* Interop Constraints */
|
|
67
|
+
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
68
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
69
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
70
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
71
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
72
|
+
/* Type Checking */
|
|
73
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
74
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
75
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
76
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
77
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
78
|
+
"strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
79
|
+
"noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
80
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
81
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
82
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
83
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
84
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
85
|
+
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
86
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
87
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
88
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
89
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
90
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
91
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
92
|
+
/* Completeness */
|
|
93
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
94
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export class DynamicUint8Array {
|
|
2
|
-
data = new Uint8Array(4);
|
|
3
|
-
length = 0;
|
|
4
|
-
add(element) {
|
|
5
|
-
this.ensureCapacity(this.length + 1);
|
|
6
|
-
this.data[this.length] = element;
|
|
7
|
-
this.length += 1;
|
|
8
|
-
}
|
|
9
|
-
addMany(...elements) {
|
|
10
|
-
this.ensureCapacity(this.length + elements.length);
|
|
11
|
-
for (const element of elements) {
|
|
12
|
-
this.data[this.length] = element;
|
|
13
|
-
this.length += 1;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
ensureCapacity(requiredCapacity) {
|
|
17
|
-
if (requiredCapacity > this.data.length) {
|
|
18
|
-
const newCapacity = requiredCapacity * 2;
|
|
19
|
-
const newData = new Uint8Array(newCapacity);
|
|
20
|
-
newData.set(this.toUint8Array());
|
|
21
|
-
this.data = newData;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
toUint8Array() {
|
|
25
|
-
return this.data.subarray(0, this.length);
|
|
26
|
-
}
|
|
27
|
-
clear() {
|
|
28
|
-
this.length = 0;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=DynamicUint8Array.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicUint8Array.js","sourceRoot":"","sources":["../../src/utilities/DynamicUint8Array.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,iBAAiB;IAC7B,IAAI,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;IACxB,MAAM,GAAG,CAAC,CAAA;IAEV,GAAG,CAAC,OAAe;QAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAEpC,IAAI,CAAC,IA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