Skip to content

Commit a5e6915

Browse files
committed
Encoded data to REST server
1 parent 7cd12f7 commit a5e6915

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

dist/easycoder-min.js

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/easycoder.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7579,9 +7579,12 @@ const EasyCoder_Value = {
75797579
encode: (value, encoding) => {
75807580
if (value) {
75817581
switch (encoding) {
7582+
default:
75827583
case `ec`:
75837584
return value.replace(/\n/g, `~lf~`)
7584-
.replace(/\r/g, `~cr~`)
7585+
.replace(/%0a/g, `~lf~`)
7586+
.replace(/\n/g, `~cr~`)
7587+
.replace(/%0d/g, `~cr~`)
75857588
.replace(/"/g, `~dq~`)
75867589
.replace(/'/g, `~sq~`)
75877590
.replace(/\\/g, `~bs~`);
@@ -7591,8 +7594,6 @@ const EasyCoder_Value = {
75917594
return btoa(value);
75927595
case `sanitize`:
75937596
return value.normalize(`NFD`).replace(/[\u0300-\u036f]/g, ``);
7594-
default:
7595-
return value;
75967597
}
75977598
}
75987599
return value;
@@ -7601,9 +7602,10 @@ const EasyCoder_Value = {
76017602
decode: (value, encoding) => {
76027603
if (value) {
76037604
switch (encoding) {
7605+
default:
76047606
case `ec`:
76057607
return value.replace(/%0a/g, `\n`)
7606-
.replace(/~lf`/g, `\n`)
7608+
.replace(/~lf~/g, `\n`)
76077609
.replace(/%0d/g, `\r`)
76087610
.replace(/~cr~/g, `\n`)
76097611
.replace(/~dq~/g, `"`)
@@ -7614,8 +7616,6 @@ const EasyCoder_Value = {
76147616
return decoded.replace(/\+/g, ` `);
76157617
case `base64`:
76167618
return atob(value);
7617-
default:
7618-
return value;
76197619
}
76207620
}
76217621
return value;

js/easycoder/Value.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,12 @@ const EasyCoder_Value = {
173173
encode: (value, encoding) => {
174174
if (value) {
175175
switch (encoding) {
176+
default:
176177
case `ec`:
177178
return value.replace(/\n/g, `~lf~`)
178-
.replace(/\r/g, `~cr~`)
179+
.replace(/%0a/g, `~lf~`)
180+
.replace(/\n/g, `~cr~`)
181+
.replace(/%0d/g, `~cr~`)
179182
.replace(/"/g, `~dq~`)
180183
.replace(/'/g, `~sq~`)
181184
.replace(/\\/g, `~bs~`);
@@ -185,8 +188,6 @@ const EasyCoder_Value = {
185188
return btoa(value);
186189
case `sanitize`:
187190
return value.normalize(`NFD`).replace(/[\u0300-\u036f]/g, ``);
188-
default:
189-
return value;
190191
}
191192
}
192193
return value;
@@ -195,9 +196,10 @@ const EasyCoder_Value = {
195196
decode: (value, encoding) => {
196197
if (value) {
197198
switch (encoding) {
199+
default:
198200
case `ec`:
199201
return value.replace(/%0a/g, `\n`)
200-
.replace(/~lf`/g, `\n`)
202+
.replace(/~lf~/g, `\n`)
201203
.replace(/%0d/g, `\r`)
202204
.replace(/~cr~/g, `\n`)
203205
.replace(/~dq~/g, `"`)
@@ -208,8 +210,6 @@ const EasyCoder_Value = {
208210
return decoded.replace(/\+/g, ` `);
209211
case `base64`:
210212
return atob(value);
211-
default:
212-
return value;
213213
}
214214
}
215215
return value;

resources/doc/core.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)