UNPKG

@configurator/ravendb

Version:
34 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JavaScriptMap = void 0; const os = require("os"); class JavaScriptMap { constructor(suffix, pathToMap) { this._argCounter = 0; this._scriptLines = []; this._parameters = {}; this._suffix = suffix; this._pathToMap = pathToMap; } set(key, value) { const argumentName = this._getNextArgumentName(); this._scriptLines.push("this." + this._pathToMap + "." + key + " = args." + argumentName + ";"); this._parameters[argumentName] = value; return this; } remove(key) { this._scriptLines.push("delete this." + this._pathToMap + "." + key + ";"); return this; } _getNextArgumentName() { return "val_" + this._argCounter++ + "_" + this._suffix; } getScript() { return this._scriptLines.join(os.EOL); } get parameters() { return this._parameters; } } exports.JavaScriptMap = JavaScriptMap; //# sourceMappingURL=JavaScriptMap.js.map