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 |
|
59 |
|
60 |
|
61 |
|
62 | const matchSlice = (o = {}) => {
|
63 | var _o$head, _o$rows;
|
64 |
|
65 | const head = (_o$head = o.head) !== null && _o$head !== void 0 ? _o$head : o.banner,
|
66 | rows = (_o$rows = o.rows) !== null && _o$rows !== void 0 ? _o$rows : o.matrix;
|
67 | return {
|
68 | head,
|
69 | rows
|
70 | };
|
71 | };
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | const matchShallow = (o = {}) => {
|
79 | var _o$head2, _o$rows2;
|
80 |
|
81 | const head = (_o$head2 = o.head) !== null && _o$head2 !== void 0 ? _o$head2 : o.banner,
|
82 | rows = (_o$rows2 = o.rows) !== null && _o$rows2 !== void 0 ? _o$rows2 : o.matrix;
|
83 | return {
|
84 | head: head.slice(),
|
85 | rows: rows.map(row => row.slice())
|
86 | };
|
87 | };
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 | const matchClone = (o = {}) => {
|
95 | var _o$head3, _o$rows3;
|
96 |
|
97 | const head = (_o$head3 = o.head) !== null && _o$head3 !== void 0 ? _o$head3 : o.banner,
|
98 | rows = (_o$rows3 = o.rows) !== null && _o$rows3 !== void 0 ? _o$rows3 : o.matrix;
|
99 | return {
|
100 | head: head.slice(),
|
101 | rows: veho.Mx.clone(rows)
|
102 | };
|
103 | };
|
104 |
|
105 | exports.clone = clone;
|
106 | exports.matchClone = matchClone;
|
107 | exports.matchShallow = matchShallow;
|
108 | exports.matchSlice = matchSlice;
|
109 | exports.shallow = shallow;
|
110 | exports.slice = slice;
|