stringzy
Version:
A versatile string manipulation library providing a range of text utilities for JavaScript and Node.js applications.
32 lines (31 loc) • 1.2 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_test_1 = require("node:test");
const node_assert_1 = __importDefault(require("node:assert"));
const splitChunks_1 = require("../../transformations/splitChunks");
(0, node_test_1.describe)('splitChunks', () => {
(0, node_test_1.it)('creates chunks of size 3', () => {
node_assert_1.default.deepStrictEqual((0, splitChunks_1.splitChunks)('hello world', 3), ['hel', 'lo ', 'wor', 'ld']);
});
(0, node_test_1.it)('creates chunks of size 2', () => {
node_assert_1.default.deepStrictEqual((0, splitChunks_1.splitChunks)('hello world', 2), ['he', 'll', 'o ', 'wo', 'rl', 'd']);
});
(0, node_test_1.it)('creates chunks of size 1', () => {
node_assert_1.default.deepStrictEqual((0, splitChunks_1.splitChunks)('hello world'), [
'h',
'e',
'l',
'l',
'o',
' ',
'w',
'o',
'r',
'l',
'd',
]);
});
});
;