UNPKG

ts-prime

Version:

A utility library for JavaScript and Typescript.

19 lines (18 loc) 739 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ensureType_1 = require("./ensureType"); var guards_1 = require("./guards"); var partition_1 = require("./partition"); var pipe_1 = require("./pipe"); test("partition data first", function () { var arr = [1, 2, 3, 4, 5, 6, "1", "2"]; var type = partition_1.partition(arr, guards_1.isString); ensureType_1.ensureType(type); expect(type).toEqual([["1", "2"], [1, 2, 3, 4, 5, 6]]); }); test("partition data last", function () { var arr = [1, 2, 3, 4, 5, 6, "1", "2"]; var type = pipe_1.pipe(arr, partition_1.partition(guards_1.isString)); ensureType_1.ensureType(type); expect(type).toEqual([["1", "2"], [1, 2, 3, 4, 5, 6]]); });