@esgettext/tools 1.3.2 → 1.3.4

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.
@@ -194,7 +194,8 @@ class Convert {
194
194
  filename = undefined;
195
195
  }
196
196
  if (typeof filename !== 'undefined') {
197
- return fs.readFileSync(filename);
197
+ const b = fs.readFileSync(filename);
198
+ return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
198
199
  }
199
200
  // Must read from standard input.
200
201
  const stdinFd = 0;
@@ -204,7 +205,8 @@ class Convert {
204
205
  while ((bytesRead = fs.readSync(stdinFd, buffer, 0, buffer.length, null)) > 0) {
205
206
  chunks.push(Buffer.from(buffer.subarray(0, bytesRead)));
206
207
  }
207
- return Buffer.concat(chunks);
208
+ const b = Buffer.concat(chunks);
209
+ return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
208
210
  }
209
211
  catch (error) {
210
212
  if (typeof filename === 'undefined') {
@@ -669,7 +669,7 @@ class Init {
669
669
  message: gtx._x("(Boolean) options to invoke '{tool}' with", {
670
670
  tool: 'msgmerge',
671
671
  }),
672
- default: '--verbose',
672
+ default: '--update --previous',
673
673
  }),
674
674
  msgfmt: yield (0, prompts_1.input)({
675
675
  message: gtx._x("The '{tool}' program to use:", { tool: 'msgfmt' }),
@@ -183,7 +183,8 @@ class Install {
183
183
  }));
184
184
  }
185
185
  const input = (0, fs_1.readFileSync)(inFile);
186
- const catalog = (0, runtime_1.parseMoCatalog)(input);
186
+ const b = input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);
187
+ const catalog = (0, runtime_1.parseMoCatalog)(b);
187
188
  const json = JSON.stringify(catalog);
188
189
  (0, fs_1.writeFile)(outFile, json, err => {
189
190
  if (err) {
@@ -208,7 +209,8 @@ class Install {
208
209
  }));
209
210
  }
210
211
  const input = (0, fs_1.readFileSync)(inFile);
211
- const catalog = (0, runtime_1.parseMoCatalog)(input);
212
+ const b = input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);
213
+ const catalog = (0, runtime_1.parseMoCatalog)(b);
212
214
  const msgs = {};
213
215
  for (const msgid in catalog.entries) {
214
216
  const msgstr = catalog.entries[msgid];
package/dist/package.js CHANGED
@@ -9,7 +9,7 @@ class Package {
9
9
  return 'https://github.com/gflohr/esgettext/issues';
10
10
  }
11
11
  static getVersion() {
12
- return '1.3.2';
12
+ return '1.3.4';
13
13
  }
14
14
  static getNpmRunAllVersion() {
15
15
  return '^4.1.5';
@@ -547,6 +547,10 @@ class Parser {
547
547
  ++i;
548
548
  continue;
549
549
  }
550
+ if (buf[i] === 0xd) {
551
+ ++i;
552
+ continue;
553
+ }
550
554
  if (0xc2 <= buf[i] &&
551
555
  buf[i] <= 0xdf &&
552
556
  0x80 <= buf[i + 1] &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esgettext/tools",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Gettext-like po creation and manipulation",
5
5
  "keywords": [
6
6
  "gettext",
@@ -104,7 +104,7 @@
104
104
  "dependencies": {
105
105
  "@babel/parser": "^7.24.7",
106
106
  "@babel/traverse": "^7.24.7",
107
- "@esgettext/runtime": "^1.3.2",
107
+ "@esgettext/runtime": "^1.3.4",
108
108
  "@inquirer/prompts": "^5.0.6",
109
109
  "@npmcli/package-json": "^5.2.0",
110
110
  "@valibot/i18n": "^0.15.0",
@@ -114,5 +114,5 @@
114
114
  "valibot": "^0.31.1",
115
115
  "yargs": "^17.7.2"
116
116
  },
117
- "gitHead": "b143ccc6342c751a27ebccfc345f23fa7cd6e318"
117
+ "gitHead": "b874712f63ffbc0dfeebd5d23a2fdeafd232857b"
118
118
  }