File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
lib/node_modules/@stdlib/ndarray/docs/types Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ import stride = require( '@stdlib/ndarray/stride' );
7373import strides = require( '@stdlib/ndarray/strides' ) ;
7474import sub2ind = require( '@stdlib/ndarray/sub2ind' ) ;
7575import ndarray2array = require( '@stdlib/ndarray/to-array' ) ;
76+ import ndarray2json = require( '@stdlib/ndarray/to-json' ) ;
7677import zeros = require( '@stdlib/ndarray/zeros' ) ;
7778import zerosLike = require( '@stdlib/ndarray/zeros-like' ) ;
7879
@@ -1599,6 +1600,27 @@ interface Namespace {
15991600 */
16001601 ndarray2array : typeof ndarray2array ;
16011602
1603+ /**
1604+ * Serializes an ndarray as a JSON object.
1605+ *
1606+ * ## Notes
1607+ *
1608+ * - The function does **not** serialize data outside of the buffer region defined by the ndarray view.
1609+ *
1610+ * @param x - input ndarray
1611+ * @returns JSON object
1612+ *
1613+ * @example
1614+ * var array = require( '@stdlib/ndarray/array' );
1615+ *
1616+ * var x = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] );
1617+ * // returns <ndarray>
1618+ *
1619+ * var o = ns.ndarray2json( x );
1620+ * // returns {...}
1621+ */
1622+ ndarray2json : typeof ndarray2json ;
1623+
16021624 /**
16031625 * Creates a zero-filled array having a specified shape and data type.
16041626 *
You can’t perform that action at this time.
0 commit comments