Improve json-edit-related scriptlets

This commit is contained in:
Raymond Hill 2026-02-24 08:50:41 -05:00
parent f1689a9ab3
commit 98d3e9500a
No known key found for this signature in database
GPG key ID: F5630CAE62A14316

View file

@ -486,7 +486,10 @@ export class JSONPath {
if ( outcome ) { return k; } if ( outcome ) { return k; }
} }
#modifyVal(obj, key) { #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 ) { switch ( modify ) {
case undefined: case undefined:
obj[key] = rval; obj[key] = rval;