@domql/utils 2.5.112 → 2.5.113

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.
@@ -20,6 +20,8 @@ var string_exports = {};
20
20
  __export(string_exports, {
21
21
  customDecodeURIComponent: () => customDecodeURIComponent,
22
22
  customEncodeURIComponent: () => customEncodeURIComponent,
23
+ decodeNewlines: () => decodeNewlines,
24
+ encodeNewlines: () => encodeNewlines,
23
25
  findKeyPosition: () => findKeyPosition,
24
26
  lowercaseFirstLetter: () => lowercaseFirstLetter,
25
27
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
@@ -123,6 +125,12 @@ const replaceOctalEscapeSequences = (str) => {
123
125
  return char;
124
126
  });
125
127
  };
128
+ const encodeNewlines = (str) => {
129
+ return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
130
+ };
131
+ const decodeNewlines = (encodedStr) => {
132
+ return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
133
+ };
126
134
  const customEncodeURIComponent = (str) => {
127
135
  return str.split("").map((char) => {
128
136
  if (/[^a-zA-Z0-9\s]/.test(char)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.5.112",
3
+ "version": "2.5.113",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -23,7 +23,7 @@
23
23
  "build": "yarn build:cjs",
24
24
  "prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
25
25
  },
26
- "gitHead": "8a59640e77bcd22114bdf64dfa4945604b5bfd1f",
26
+ "gitHead": "8436abbfa2752c4659982516ff9ad1db80862e42",
27
27
  "devDependencies": {
28
28
  "@babel/core": "^7.12.0"
29
29
  }
package/string.js CHANGED
@@ -125,6 +125,14 @@ export const replaceOctalEscapeSequences = (str) => {
125
125
  })
126
126
  }
127
127
 
128
+ export const encodeNewlines = (str) => {
129
+ return str.split('\n').join('/////n').split('`').join('/////tilde').split('$').join('/////dlrsgn')
130
+ }
131
+
132
+ export const decodeNewlines = (encodedStr) => {
133
+ return encodedStr.split('/////n').join('\n').split('/////tilde').join('`').split('/////dlrsgn').join('$')
134
+ }
135
+
128
136
  export const customEncodeURIComponent = (str) => {
129
137
  return str.split('').map(char => {
130
138
  if (/[^a-zA-Z0-9\s]/.test(char)) {