Add @mediabunny/flac-encoder extension, clean up some other code, fix incorrect top-level tsconfig

This commit is contained in:
Vanilagy
2026-03-04 21:21:52 +01:00
parent e18da824ce
commit a15283eaa3
35 changed files with 1713 additions and 48 deletions
+20
View File
@@ -0,0 +1,20 @@
/*!
* Copyright (c) 2026-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
const FLAC_ENCODER_LOADED_SYMBOL = Symbol.for('@mediabunny/flac-encoder loaded');
if ((globalThis as Record<symbol, unknown>)[FLAC_ENCODER_LOADED_SYMBOL]) {
console.error(
'[WARNING]\n@mediabunny/flac-encoder was loaded twice.'
+ ' This will likely cause the encoder not to work correctly.'
+ ' Check if multiple dependencies are importing different versions of @mediabunny/flac-encoder,'
+ ' or if something is being bundled incorrectly.',
);
}
(globalThis as Record<symbol, unknown>)[FLAC_ENCODER_LOADED_SYMBOL] = true;
export { registerFlacEncoder } from './encoder';