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 | const head = o.head || o.banner,
|
60 | rows = o.rows || o.matrix;
|
61 | return {
|
62 | head,
|
63 | rows
|
64 | };
|
65 | };
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | const matchShallow = o => {
|
73 | const head = o.head || o.banner,
|
74 | rows = o.rows || o.matrix;
|
75 | return {
|
76 | head: head.slice(),
|
77 | rows: rows.map(row => row.slice())
|
78 | };
|
79 | };
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | const matchClone = o => {
|
87 | const head = o.head || o.banner,
|
88 | rows = o.rows || o.matrix;
|
89 | return {
|
90 | head: head.slice(),
|
91 | rows: veho.Mx.clone(rows)
|
92 | };
|
93 | };
|
94 |
|
95 | exports.clone = clone;
|
96 | exports.matchClone = matchClone;
|
97 | exports.matchShallow = matchShallow;
|
98 | exports.matchSlice = matchSlice;
|
99 | exports.shallow = shallow;
|
100 | exports.slice = slice;
|