UNPKG

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
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = map; const var_utils_1 = require("../../utils/var.utils"); const index_1 = require("../../../index"); 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; }