PluginProbe ʕ •ᴥ•ʔ
GPTranslate – Multilingual AI Translation for WordPress: Automatically Translate Websites / 2.12
GPTranslate – Multilingual AI Translation for WordPress: Automatically Translate Websites v2.12
2.33.7 2.33.6 2.33.5 2.33.2 2.32.10 2.33 2.33.1 2.32.6 2.32.7 2.32.8 trunk 2.10.3 2.10.4 2.10.5 2.10.6 2.11 2.12 2.13 2.14 2.14.1 2.15 2.15.1 2.16.1 2.16.2 2.17 2.18 2.18.1 2.18.2 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.25.1 2.25.2 2.26 2.27 2.27.10 2.27.5 2.28 2.28.1 2.29 2.30 2.31 2.32 2.32.5
gptranslate / assets / js / jsonrepair / streaming / stream.js
gptranslate / assets / js / jsonrepair / streaming Last commit date
buffer 1 year ago core.js 1 year ago core.js.map 1 year ago stack.js 1 year ago stack.js.map 1 year ago stream.js 1 year ago stream.js.map 1 year ago
stream.js
31 lines
1 import { Transform } from 'node:stream';
2 import { jsonrepairCore } from './core.js';
3 export function jsonrepairTransform(options) {
4 const repair = jsonrepairCore({
5 onData: chunk => transform.push(chunk),
6 bufferSize: options === null || options === void 0 ? void 0 : options.bufferSize,
7 chunkSize: options === null || options === void 0 ? void 0 : options.chunkSize
8 });
9 const transform = new Transform({
10 transform(chunk, encoding, callback) {
11 try {
12 repair.transform(chunk.toString());
13 } catch (err) {
14 this.emit('error', err);
15 } finally {
16 callback();
17 }
18 },
19 flush(callback) {
20 try {
21 repair.flush();
22 } catch (err) {
23 this.emit('error', err);
24 } finally {
25 callback();
26 }
27 }
28 });
29 return transform;
30 }
31 //# sourceMappingURL=stream.js.map