@bitrix24/b24jssdk
Version:
Bitrix24 REST API JavaScript SDK
36 lines (33 loc) • 1.05 kB
JavaScript
/**
* @package @bitrix24/b24jssdk
* @version 3.0.0
* @copyright (c) 2026 Bitrix24
* @license MIT
* @see https://github.com/bitrix24/b24jssdk
* @see https://bitrix24.github.io/b24jssdk/
*/
;
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
const EMPTY = Object.freeze({});
function isPlainObject(value) {
return "object" === typeof value && null !== value && !Array.isArray(value);
}
__name(isPlainObject, "isPlainObject");
function normalisePlacementOptions(raw) {
try {
if (isPlainObject(raw)) {
return Object.freeze({ ...raw });
}
if ("string" === typeof raw && raw.length > 0) {
const parsed = JSON.parse(raw);
return isPlainObject(parsed) ? Object.freeze({ ...parsed }) : EMPTY;
}
} catch {
return EMPTY;
}
return EMPTY;
}
__name(normalisePlacementOptions, "normalisePlacementOptions");
exports.normalisePlacementOptions = normalisePlacementOptions;
//# sourceMappingURL=_placement-options.cjs.map