@zohodesk/client_build_tool 0.0.11-exp.15.1 → 0.0.11-exp.15.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.
@@ -1,81 +0,0 @@
1
- "use strict";
2
-
3
- function decodeUnicodeEscapes(str) {
4
- if (typeof str !== 'string') {
5
- return str;
6
- }
7
-
8
- return str.replace(/\\u([0-9a-fA-F]{4})/g, (match, hex) => {
9
- return String.fromCharCode(parseInt(hex, 16));
10
- });
11
- }
12
-
13
- function parseProperties(content) {
14
- const lines = content.split(/\r?\n/);
15
- const data = {};
16
- lines.forEach(line => {
17
- const trimmedLine = line.trim();
18
-
19
- if (trimmedLine.startsWith('#') || trimmedLine.startsWith('!') || trimmedLine === '') {
20
- return;
21
- }
22
-
23
- let separatorIndex = -1;
24
-
25
- for (let i = 0; i < trimmedLine.length; i++) {
26
- if ((trimmedLine[i] === '=' || trimmedLine[i] === ':') && (i === 0 || trimmedLine[i - 1] !== '\\')) {
27
- separatorIndex = i;
28
- break;
29
- }
30
- }
31
-
32
- if (separatorIndex > 0) {
33
- let key = trimmedLine.substring(0, separatorIndex).trim();
34
- let value = trimmedLine.substring(separatorIndex + 1).trim();
35
-
36
- if (key) {
37
- key = key.replace(/\\ /g, ' ');
38
- value = decodeUnicodeEscapes(value);
39
- data[key] = value;
40
- }
41
- }
42
- });
43
- return data;
44
- }
45
-
46
- function parsePropertiesToKeySet(content) {
47
- const lines = content.split(/\r?\n/);
48
- const keys = new Set();
49
- lines.forEach(line => {
50
- const trimmedLine = line.trim();
51
-
52
- if (trimmedLine.startsWith('#') || trimmedLine.startsWith('!') || trimmedLine === '') {
53
- return;
54
- }
55
-
56
- let separatorIndex = -1;
57
-
58
- for (let i = 0; i < trimmedLine.length; i++) {
59
- if ((trimmedLine[i] === '=' || trimmedLine[i] === ':') && (i === 0 || trimmedLine[i - 1] !== '\\')) {
60
- separatorIndex = i;
61
- break;
62
- }
63
- }
64
-
65
- if (separatorIndex > 0) {
66
- let key = trimmedLine.substring(0, separatorIndex).trim();
67
-
68
- if (key) {
69
- key = key.replace(/\\ /g, ' ');
70
- keys.add(key);
71
- }
72
- }
73
- });
74
- return keys;
75
- }
76
-
77
- module.exports = {
78
- parseProperties,
79
- parsePropertiesToKeySet,
80
- decodeUnicodeEscapes
81
- };