mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Improve json-edit-related scriptlets
This commit is contained in:
parent
f1689a9ab3
commit
98d3e9500a
1 changed files with 4 additions and 1 deletions
|
|
@ -486,7 +486,10 @@ export class JSONPath {
|
|||
if ( outcome ) { return k; }
|
||||
}
|
||||
#modifyVal(obj, key) {
|
||||
const { modify, rval } = this.#compiled;
|
||||
let { modify, rval } = this.#compiled;
|
||||
if ( typeof rval === 'string' ) {
|
||||
rval = rval.replace('${now}', `${Date.now()}`);
|
||||
}
|
||||
switch ( modify ) {
|
||||
case undefined:
|
||||
obj[key] = rval;
|
||||
|
|
|
|||
Loading…
Reference in a new issue