File tree 1 file changed +12
-6
lines changed
lib/node_modules/@stdlib/ndarray/base/ndarraylike2object/lib
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ var accessorSetter = require( '@stdlib/array/base/accessor-setter' );
26
26
var getter = require ( '@stdlib/array/base/getter' ) ;
27
27
var setter = require ( '@stdlib/array/base/setter' ) ;
28
28
var numel = require ( '@stdlib/ndarray/base/numel' ) ;
29
+ var getDType = require ( '@stdlib/ndarray/base/dtype' ) ;
30
+ var getShape = require ( '@stdlib/ndarray/base/shape' ) ;
31
+ var getStrides = require ( '@stdlib/ndarray/base/strides' ) ;
32
+ var getOffset = require ( '@stdlib/ndarray/base/offset' ) ;
33
+ var getOrder = require ( '@stdlib/ndarray/base/order' ) ;
34
+ var getData = require ( '@stdlib/ndarray/base/data-buffer' ) ;
29
35
30
36
31
37
// MAIN //
@@ -73,9 +79,9 @@ function ndarraylike2object( x ) {
73
79
var sh ;
74
80
var dt ;
75
81
76
- xbuf = x . data ;
77
- sh = x . shape ;
78
- dt = x . dtype ;
82
+ xbuf = getData ( x ) ;
83
+ sh = getShape ( x ) ;
84
+ dt = getDType ( x ) ;
79
85
80
86
bool = isAccessorArray ( xbuf ) ;
81
87
@@ -85,9 +91,9 @@ function ndarraylike2object( x ) {
85
91
'data' : xbuf ,
86
92
'length' : numel ( sh ) ,
87
93
'shape' : sh ,
88
- 'strides' : x . strides ,
89
- 'offset' : x . offset ,
90
- 'order' : x . order ,
94
+ 'strides' : getStrides ( x ) ,
95
+ 'offset' : getOffset ( x ) ,
96
+ 'order' : getOrder ( x ) ,
91
97
'accessorProtocol' : bool ,
92
98
'accessors' : ( bool ) ?
93
99
[ accessorGetter ( dt ) , accessorSetter ( dt ) ] :
You can’t perform that action at this time.
0 commit comments