@lokalise/polyglot-sdk 22.9.0 → 22.9.1

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.
@@ -1,5 +1,12 @@
1
1
  export function removeUnicodeNullCharacters(text) {
2
+ // Remove:
3
+ // 1. Actual null bytes (\u0000)
4
+ // 2. JSON escape sequence for null (\u0000) but NOT when it's literal text (\\u0000)
5
+ //
6
+ // Use negative lookbehind (?<!\\) to match \u0000 only when NOT preceded by backslash
7
+ // This preserves user's literal "\u0000" text while removing actual nulls
8
+ //
2
9
  // biome-ignore lint/suspicious/noControlCharactersInRegex: this fn is meant to remove null char
3
- return text.replace(/\\u0000|\u0000/g, '');
10
+ return text.replace(/(?<!\\)\\u0000|\u0000/g, '');
4
11
  }
5
12
  //# sourceMappingURL=removeUnicodeNullCharacters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"removeUnicodeNullCharacters.js","sourceRoot":"","sources":["../../../src/sdk/helpers/removeUnicodeNullCharacters.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,2BAA2B,CAAC,IAAY;IACtD,gGAAgG;IAChG,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AAC5C,CAAC"}
1
+ {"version":3,"file":"removeUnicodeNullCharacters.js","sourceRoot":"","sources":["../../../src/sdk/helpers/removeUnicodeNullCharacters.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,2BAA2B,CAAC,IAAY;IACtD,UAAU;IACV,gCAAgC;IAChC,qFAAqF;IACrF,EAAE;IACF,sFAAsF;IACtF,0EAA0E;IAC1E,EAAE;IACF,gGAAgG;IAChG,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAA;AACnD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/polyglot-sdk",
3
- "version": "22.9.0",
3
+ "version": "22.9.1",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"