Skip to content

Commit 98d3e95

Browse files
committed
Improve json-edit-related scriptlets
1 parent f1689a9 commit 98d3e95

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/js/jsonpath.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,10 @@ export class JSONPath {
486486
if ( outcome ) { return k; }
487487
}
488488
#modifyVal(obj, key) {
489-
const { modify, rval } = this.#compiled;
489+
let { modify, rval } = this.#compiled;
490+
if ( typeof rval === 'string' ) {
491+
rval = rval.replace('${now}', `${Date.now()}`);
492+
}
490493
switch ( modify ) {
491494
case undefined:
492495
obj[key] = rval;

0 commit comments

Comments
 (0)