Skip to content

Commit f0f5191

Browse files
ghostery-adblocker-bot[bot]Ghostery Adblocker Bot
andauthored
Update scriptlets (#8)
Co-authored-by: Ghostery Adblocker Bot <ghostery-adblocker-bot@users.noreply.github.com>
1 parent 5f665dc commit f0f5191

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"type": "module",
77
"scripts": {
8-
"build": "deno build.ts --tagName 1.64.0 > ubo.js",
8+
"build": "deno build.ts --tagName 1.64.1b4 > ubo.js",
99
"test": "node --test"
1010
},
1111
"author": {

ubo.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6115,7 +6115,8 @@ function safeSelf() {
61156115
}
61166116
function jsonlEditFn(jsonp, text = '') {
61176117
const safe = safeSelf();
6118-
const linesBefore = text.split(/\n+/);
6118+
const lineSeparator = /\r?\n/.exec(text)?.[0] || '\n';
6119+
const linesBefore = text.split('\n');
61196120
const linesAfter = [];
61206121
for ( const lineBefore of linesBefore ) {
61216122
let obj;
@@ -6128,9 +6129,10 @@ function jsonlEditFn(jsonp, text = '') {
61286129
linesAfter.push(lineBefore);
61296130
continue;
61306131
}
6131-
linesAfter.push(JSONPath.toJSON(obj, safe.JSON_stringify));
6132+
const lineAfter = safe.JSON_stringify(obj);
6133+
linesAfter.push(lineAfter);
61326134
}
6133-
return linesAfter.join('\n');
6135+
return linesAfter.join(lineSeparator);
61346136
}
61356137
class JSONPath {
61366138
static create(query) {
@@ -6812,7 +6814,8 @@ function safeSelf() {
68126814
}
68136815
function jsonlEditFn(jsonp, text = '') {
68146816
const safe = safeSelf();
6815-
const linesBefore = text.split(/\n+/);
6817+
const lineSeparator = /\r?\n/.exec(text)?.[0] || '\n';
6818+
const linesBefore = text.split('\n');
68166819
const linesAfter = [];
68176820
for ( const lineBefore of linesBefore ) {
68186821
let obj;
@@ -6825,9 +6828,10 @@ function jsonlEditFn(jsonp, text = '') {
68256828
linesAfter.push(lineBefore);
68266829
continue;
68276830
}
6828-
linesAfter.push(JSONPath.toJSON(obj, safe.JSON_stringify));
6831+
const lineAfter = safe.JSON_stringify(obj);
6832+
linesAfter.push(lineAfter);
68296833
}
6830-
return linesAfter.join('\n');
6834+
return linesAfter.join(lineSeparator);
68316835
}
68326836
class JSONPath {
68336837
static create(query) {
@@ -7589,7 +7593,8 @@ function safeSelf() {
75897593
}
75907594
function jsonlEditFn(jsonp, text = '') {
75917595
const safe = safeSelf();
7592-
const linesBefore = text.split(/\n+/);
7596+
const lineSeparator = /\r?\n/.exec(text)?.[0] || '\n';
7597+
const linesBefore = text.split('\n');
75937598
const linesAfter = [];
75947599
for ( const lineBefore of linesBefore ) {
75957600
let obj;
@@ -7602,9 +7607,10 @@ function jsonlEditFn(jsonp, text = '') {
76027607
linesAfter.push(lineBefore);
76037608
continue;
76047609
}
7605-
linesAfter.push(JSONPath.toJSON(obj, safe.JSON_stringify));
7610+
const lineAfter = safe.JSON_stringify(obj);
7611+
linesAfter.push(lineAfter);
76067612
}
7607-
return linesAfter.join('\n');
7613+
return linesAfter.join(lineSeparator);
76087614
}
76097615
class JSONPath {
76107616
static create(query) {
@@ -8374,7 +8380,8 @@ function safeSelf() {
83748380
}
83758381
function jsonlEditFn(jsonp, text = '') {
83768382
const safe = safeSelf();
8377-
const linesBefore = text.split(/\n+/);
8383+
const lineSeparator = /\r?\n/.exec(text)?.[0] || '\n';
8384+
const linesBefore = text.split('\n');
83788385
const linesAfter = [];
83798386
for ( const lineBefore of linesBefore ) {
83808387
let obj;
@@ -8387,9 +8394,10 @@ function jsonlEditFn(jsonp, text = '') {
83878394
linesAfter.push(lineBefore);
83888395
continue;
83898396
}
8390-
linesAfter.push(JSONPath.toJSON(obj, safe.JSON_stringify));
8397+
const lineAfter = safe.JSON_stringify(obj);
8398+
linesAfter.push(lineAfter);
83918399
}
8392-
return linesAfter.join('\n');
8400+
return linesAfter.join(lineSeparator);
83938401
}
83948402
class JSONPath {
83958403
static create(query) {

0 commit comments

Comments
 (0)