UNPKG

pricehistory

Version:
18 lines (17 loc) 547 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const simpul_1 = require("simpul"); function normalizeCandles(option, candles) { var _a; if (!((_a = option.normalize) === null || _a === void 0 ? void 0 : _a.length)) return; for (const candle of candles) { for (const key of option.normalize) { candle[`${key}N`] = candle[key]; } } for (const key of option.normalize) { (0, simpul_1.scale)(candles, `${key}N`); } } exports.default = normalizeCandles;