"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.replaceItemId = replaceItemId;
const util_1 = require("../util");
const deep_string_replace_1 = require("../objects/deep-string-replace");
/**
 * Replaces instances of item ids on an item model
 * @param {Object} obj Object graph to traverse
 * @param {string} itemId id to replace with `{{appid}}`
 */
function replaceItemId(obj, itemId, replacement = "{{appid}}") {
    const clone = (0, util_1.cloneObject)(obj);
    const re = new RegExp(itemId, "g");
    return (0, deep_string_replace_1.deepStringReplace)(clone, re, replacement);
}
//# sourceMappingURL=replace-item-id.js.map