1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | var _sliceAnsi = _interopRequireDefault(require("slice-ansi"));
|
9 |
|
10 | var _stringWidth = _interopRequireDefault(require("string-width"));
|
11 |
|
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | const wrapString = (subject, size) => {
|
26 | let subjectSlice;
|
27 | subjectSlice = subject;
|
28 | const chunks = [];
|
29 |
|
30 | do {
|
31 | chunks.push((0, _sliceAnsi.default)(subjectSlice, 0, size));
|
32 | subjectSlice = (0, _sliceAnsi.default)(subjectSlice, size).trim();
|
33 | } while ((0, _stringWidth.default)(subjectSlice));
|
34 |
|
35 | return chunks;
|
36 | };
|
37 |
|
38 | var _default = wrapString;
|
39 | exports.default = _default;
|
40 |
|
\ | No newline at end of file |