UNPKG

@glue42/bbg-market-data

Version:

A high-level API that wraps existing Glue42 Bloomberg Bridge Market Data interop methods. The API is based on the jBloomberg open source wrapper.

22 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateSubscription = void 0; const utils_1 = require("../../utils"); function validateSubscription(subscription) { if (utils_1.isNullOrUndefined(subscription)) { throw new TypeError("subscription must be a non nullable value"); } const nameOf = utils_1.nameOf(subscription); if (utils_1.isEmpty(subscription.security)) { throw new TypeError(`subscription property ${nameOf("security")} is required to be a non empty string.`); } if (utils_1.isEmptyArray(subscription.fields)) { throw new TypeError(`subscription property ${nameOf("fields")} is required to be a non empty array.`); } const intervalNegative = utils_1.isNumber(subscription.intervalInSeconds) && subscription.intervalInSeconds < 0; if (intervalNegative) { throw new Error(`subscription property ${nameOf("intervalInSeconds")} must be a positive number.`); } } exports.validateSubscription = validateSubscription; //# sourceMappingURL=helpers.js.map