1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | var veho = require('veho');
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | const slice = ({
|
17 | head,
|
18 | rows
|
19 | }) => ({
|
20 | head,
|
21 | rows
|
22 | });
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | const shallow = ({
|
31 | head,
|
32 | rows
|
33 | }) => ({
|
34 | head: head.slice(),
|
35 | rows: rows.map(row => row.slice())
|
36 | });
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | const clone = ({
|
45 | head,
|
46 | rows
|
47 | }) => ({
|
48 | head: head.slice(),
|
49 | rows: veho.Mx.clone(rows)
|
50 | });
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | const matchSlice = (o = {}) => {
|
59 | var _o$head, _o$rows;
|
60 |
|
61 | const head = (_o$head = o.head) !== null && _o$head !== void 0 ? _o$head : o.banner,
|
62 | rows = (_o$rows = o.rows) !== null && _o$rows !== void 0 ? _o$rows : o.matrix;
|
63 | return {
|
64 | head,
|
65 | rows
|
66 | };
|
67 | };
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | const matchShallow = (o = {}) => {
|
75 | var _o$head2, _o$rows2;
|
76 |
|
77 | const head = (_o$head2 = o.head) !== null && _o$head2 !== void 0 ? _o$head2 : o.banner,
|
78 | rows = (_o$rows2 = o.rows) !== null && _o$rows2 !== void 0 ? _o$rows2 : o.matrix;
|
79 | return {
|
80 | head: head.slice(),
|
81 | rows: rows.map(row => row.slice())
|
82 | };
|
83 | };
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 | const matchClone = (o = {}) => {
|
91 | var _o$head3, _o$rows3;
|
92 |
|
93 | const head = (_o$head3 = o.head) !== null && _o$head3 !== void 0 ? _o$head3 : o.banner,
|
94 | rows = (_o$rows3 = o.rows) !== null && _o$rows3 !== void 0 ? _o$rows3 : o.matrix;
|
95 | return {
|
96 | head: head.slice(),
|
97 | rows: veho.Mx.clone(rows)
|
98 | };
|
99 | };
|
100 |
|
101 | exports.clone = clone;
|
102 | exports.matchClone = matchClone;
|
103 | exports.matchShallow = matchShallow;
|
104 | exports.matchSlice = matchSlice;
|
105 | exports.shallow = shallow;
|
106 | exports.slice = slice;
|