"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const utils_1 = require("../utils");
describe('utils >', () => {
    it('convert dates', () => __awaiter(void 0, void 0, void 0, function* () {
        const dates = ['2005-02-25', '2005-02-26', '2005-02-27'].map((x) => new Date(x));
        const numbers = [1109289600000, 1109376000000, 1109462400000];
        chai_1.expect(Array.from(utils_1.convert_dates(dates))).to.deep.equal(numbers);
        chai_1.expect([Array.from(utils_1.convert_dates([dates])[0])]).to.deep.equal([numbers]);
        chai_1.expect(Array.from(utils_1.convert_dates(numbers))).to.deep.equal(numbers);
        chai_1.expect(Array.from(utils_1.convert_dates([numbers, numbers]))).to.deep.equal([
            numbers,
            numbers,
        ]);
    }));
    it('deepCopy', () => {
        const ar = new Float64Array([0, 0.5]);
        chai_1.expect(Array.from(utils_1.deepCopy(ar))).to.deep.equal(Array.from(ar));
        chai_1.expect(Array.from(utils_1.deepCopy([ar])[0])).to.deep.equal(Array.from(ar));
        chai_1.expect(Array.from(utils_1.deepCopy({ ar: ar }).ar)).to.deep.equal(Array.from(ar));
    });
});
//# sourceMappingURL=utils.js.map