@l10nmonster/helpers-ios 3.0.1 → 3.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## @l10nmonster/helpers-ios [3.0.2](https://public-github/l10nmonster/l10nmonster/compare/@l10nmonster/helpers-ios@3.0.1...@l10nmonster/helpers-ios@3.0.2) (2025-12-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Improve type definitions and checks ([826b412](https://public-github/l10nmonster/l10nmonster/commit/826b412f0f7e761d404165a243b0c2b26c416ac1))
7
+
8
+
9
+
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * **@l10nmonster/core:** upgraded to 3.1.1
15
+
1
16
  ## @l10nmonster/helpers-ios [3.0.1](https://public-github/l10nmonster/l10nmonster/compare/@l10nmonster/helpers-ios@3.0.0...@l10nmonster/helpers-ios@3.0.1) (2025-12-20)
2
17
 
3
18
 
package/index.js CHANGED
@@ -1,9 +1,14 @@
1
1
  import i18nStringsFiles from '@l10nmonster/i18n-strings-files';
2
2
  import { regex } from '@l10nmonster/core';
3
3
 
4
+ /** @typedef {import('@l10nmonster/core').ResourceFilter} ResourceFilter */
5
+
4
6
  export { StringsdictFilter } from './stringsdict.js';
5
7
 
6
- // filter for iOS .strings file (in utf-8)
8
+ /**
9
+ * Filter for iOS .strings files (in utf-8).
10
+ * @implements {ResourceFilter}
11
+ */
7
12
  export class StringsFilter {
8
13
  constructor(params) {
9
14
  this.emitComments = params?.emitComments || false;
@@ -45,6 +50,8 @@ const iosControlCharsToDecode = {
45
50
  r: '\r',
46
51
  f: '\f',
47
52
  };
53
+
54
+ /** @type {import('@l10nmonster/core').DecoderFunction} */
48
55
  export const escapesDecoder = regex.decoderMaker(
49
56
  'iosEscapesDecoder',
50
57
  /(?<node>\\(?<escapedChar>['"\\])|\\(?<escapedControl>[tbnrf])|\\U(?<codePoint>[0-9A-Za-z]{4}))/g, // note that in ios the \U is uppercase!
@@ -56,6 +63,7 @@ export const escapesDecoder = regex.decoderMaker(
56
63
  )
57
64
  );
58
65
 
66
+ /** @type {import('@l10nmonster/core').TextEncoderFunction} */
59
67
  export const escapesEncoder = regex.encoderMaker(
60
68
  'iosEscapesEncoder',
61
69
  // eslint-disable-next-line prefer-named-capture-group
@@ -73,6 +81,7 @@ export const escapesEncoder = regex.encoderMaker(
73
81
  // and https://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html
74
82
  // loosely based on https://stackoverflow.com/questions/45215648/regex-capture-type-specifiers-in-format-string
75
83
  // space and quote tags have been omitted to avoid matching unexpected combinations
84
+ /** @type {import('@l10nmonster/core').DecoderFunction} */
76
85
  export const phDecoder = regex.decoderMaker(
77
86
  'iosPHDecoder',
78
87
  /(?<tag>%(?:\d\$)?[0#+-]?[0-9*]*\.?\d*[hl]{0,2}[jztL]?[diuoxXeEfgGaAcpsSn@])/g,
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@l10nmonster/helpers-ios",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Helpers to deal with iOS file formats",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "scripts": {
8
- "test": "node --test"
8
+ "test": "node --test",
9
+ "typecheck": "tsc --noEmit"
9
10
  },
10
11
  "author": "Diego Lagunas",
11
12
  "license": "MIT",
@@ -14,6 +15,6 @@
14
15
  "plist": "^3.1.0"
15
16
  },
16
17
  "peerDependencies": {
17
- "@l10nmonster/core": "3.1.0"
18
+ "@l10nmonster/core": "3.1.1"
18
19
  }
19
20
  }
package/stringsdict.js CHANGED
@@ -1,8 +1,11 @@
1
1
  import plist from 'plist';
2
2
 
3
+ /** @typedef {import('@l10nmonster/core').ResourceFilter} ResourceFilter */
4
+
3
5
  /**
4
6
  * Filter for iOS .stringsdict files (plist format for pluralization).
5
7
  * @see https://developer.apple.com/documentation/xcode/localizing-strings-that-contain-plurals
8
+ * @implements {ResourceFilter}
6
9
  */
7
10
  export class StringsdictFilter {
8
11
 
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "../tsconfig.base.json",
3
+ "include": [
4
+ "*.js",
5
+ "**/*.js"
6
+ ],
7
+ "exclude": [
8
+ "node_modules",
9
+ "**/node_modules",
10
+ "test/**",
11
+ "tests/**",
12
+ "**/*.test.js",
13
+ "**/*.spec.js",
14
+ "dist/**",
15
+ "ui/**",
16
+ "types/**"
17
+ ]
18
+ }
package/.releaserc.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "branches": [
3
- "main",
4
- {
5
- "name": "next",
6
- "prerelease": "alpha"
7
- },
8
- {
9
- "name": "beta",
10
- "prerelease": "beta"
11
- }
12
- ],
13
- "tagFormat": "@l10nmonster/helpers-ios@${version}",
14
- "plugins": [
15
- "@semantic-release/commit-analyzer",
16
- "@semantic-release/release-notes-generator",
17
- {
18
- "path": "@semantic-release/changelog",
19
- "changelogFile": "CHANGELOG.md"
20
- },
21
- {
22
- "path": "@semantic-release/npm",
23
- "npmPublish": false
24
- },
25
- {
26
- "path": "@semantic-release/git",
27
- "assets": ["CHANGELOG.md", "package.json"],
28
- "message": "chore(release): @l10nmonster/helpers-ios@${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
29
- }
30
- ]
31
- }