lindera-wasm-web 3.0.1 → 3.0.3
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/lindera_wasm_bg.wasm +0 -0
- package/opfs.js +3 -2
- package/package.json +1 -1
package/lindera_wasm_bg.wasm
CHANGED
|
Binary file
|
package/opfs.js
CHANGED
|
@@ -175,15 +175,16 @@ async function extractZip(zipBuffer) {
|
|
|
175
175
|
* @param {object} [options] - Optional settings.
|
|
176
176
|
* @param {function} [options.onProgress] - Progress callback receiving
|
|
177
177
|
* `{ phase: string, loaded?: number, total?: number }`.
|
|
178
|
+
* @param {RequestInit} [options.fetchInit] - Additional options passed to `fetch()`.
|
|
178
179
|
* @returns {Promise<void>}
|
|
179
180
|
* @throws {Error} If download fails, archive is invalid, or required files are missing.
|
|
180
181
|
*/
|
|
181
182
|
export async function downloadDictionary(url, name, options = {}) {
|
|
182
|
-
const { onProgress } = options;
|
|
183
|
+
const { onProgress, fetchInit = {} } = options;
|
|
183
184
|
|
|
184
185
|
// Download
|
|
185
186
|
if (onProgress) onProgress({ phase: "downloading" });
|
|
186
|
-
const response = await fetch(url);
|
|
187
|
+
const response = await fetch(url, fetchInit);
|
|
187
188
|
if (!response.ok) {
|
|
188
189
|
throw new Error(`Failed to download dictionary: HTTP ${response.status}`);
|
|
189
190
|
}
|