rhine-var
Version:
Variables that support multi-user collaboration and persistence, making collaboration and variable operations as simple as possible, with strict and well-defined type hints.
16 lines (15 loc) • 461 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = map;
const index_1 = require("../../../index");
const var_utils_1 = require("../../utils/var.utils");
function map(defaultValue) {
if (!defaultValue) {
defaultValue = {};
}
const map = new index_1.YMap();
for (const key in defaultValue) {
map.set(key, (0, var_utils_1.ensureNativeOrBasic)(defaultValue[key]));
}
return map;
}