obj/src/persistence/JsonFilePersister.js
/**
     * Saves given data items to external JSON file.
     *
     * @param correlationId    (optional) transaction id to trace execution through call chain.
     * @param items             list if data items to save
     */
Saves given data items to external JSON file.
@param correlationId    (optional) transaction id to trace execution through call chain.
@param items             list if data items to save
Saves given data items to external JSON file . @param correlationId ( optional ) transaction id to trace execution through call chain . @param items list if data items to save
save(correlationId, items) {
        return __awaiter(this, void 0, void 0, function* () {
            try {
                let json = pip_services3_commons_nodex_3.JsonConverter.toJson(items);
                fs.writeFileSync(this._path, json);
            }
            catch (ex) {
                throw new pip_services3_commons_nodex_2.FileException(correlationId, "WRITE_FAILED", "Failed to write data file: " + this._path).withCause(ex);
            }
        });
    }
save ( correlationId , items ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { try { let json = pip_services3_commons_nodex_3 . JsonConverter . toJson ( items ) ; fs . writeFileSync ( this . _path , json ) ; } catch ( ex ) { throw new pip_services3_commons_nodex_2 . FileException ( correlationId , "WRITE_FAILED" , "Failed to write data file: " + this . _path ) . withCause ( ex ) ; } } ) ; }
Saves given data items to external JSON file.
Saves given data items to external JSON file .