Example:
import { array, equals } from 'vectorious';
const x = array([1, 2, 3]);
/*
array([ 1, 2, 3 ], dtype=float64)
*/
const serialized = JSON.stringify(x);
/*
'{"data":{"0":1,"1":2,"2":3},"dtype":"float64","length":3,"shape":[3],"strides":[1]}'
*/
const deserialized = JSON.parse(serialized);
/*
{
data: { '0': 1, '1': 2, '2': 3 },
dtype: 'float64',
length: 3,
shape: [ 3 ],
strides: [ 1 ]
}
*/
const y = array(deserialized)
assert(equals(x, y));
Example: