@inworld/tts 0.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.

Potentially problematic release.


This version of @inworld/tts might be problematic. Click here for more details.

@@ -0,0 +1,7 @@
1
+ /** Browser stub — bundlers substitute this for write-file.js in browser builds. */
2
+
3
+ import { ApiError } from './errors.js';
4
+
5
+ export async function writeFileSafe(_path, _data) {
6
+ throw new ApiError('outputFile is not supported in browser environments. Use the returned Uint8Array directly.');
7
+ }
@@ -0,0 +1,11 @@
1
+ /** Node.js file writer. Bundlers substitute write-file.browser.js in browser builds. */
2
+
3
+ import { ApiError } from './errors.js';
4
+
5
+ export async function writeFileSafe(path, data) {
6
+ if (typeof process === 'undefined' || !process.versions?.node) {
7
+ throw new ApiError('outputFile is not supported in browser environments. Use the returned Uint8Array directly.');
8
+ }
9
+ const { writeFile } = await import('fs/promises');
10
+ await writeFile(path, data);
11
+ }