UNPKG

@bxshefby/b24jssdk

Version:

Bitrix24 REST API JavaScript SDK

35 lines (32 loc) • 998 B
/** * @package @bxshefby/b24jssdk * @version 3.3.0 * @copyright (c) 2026 Bitrix24 * @license MIT * @see https://github.com/bx-shef/b24-js-sdk * @see https://b24-js-sdk.bx-shef.by/ */ 'use strict'; 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;