File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
198198
# Publish package to npm:
199199
- name: 'Publish package to npm'
200-
uses: JS-DevTools/npm-publish@v1
200+
uses: JS-DevTools/npm-publish@v2
201201
with:
202202
token: ${{ secrets.NPM_TOKEN }}
203203
access: public
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,37 @@
33
# Contributors listed in alphabetical order.
44

55
Ali Salesi <[email protected]>
6+
Amit Jimiwal <[email protected]>
67
Athan Reines <[email protected]>
78
Brendan Graetz <[email protected]>
89
Bruno Fenzl <[email protected]>
910
Christopher Dambamuromo <[email protected]>
11+
1012
Dominik Moritz <[email protected]>
13+
Dorrin Sotoudeh <[email protected]>
1114
Frank Kovacs <[email protected]>
12-
Harshita Kalani <[email protected]..com>
13-
15+
Harshita Kalani <harshitakalani02@gmail.com>
16+
James Gelok <[email protected]>
1417
Jithin KS <[email protected]>
1518
Joey Reed <[email protected]>
16-
Jordan-Gallivan <[email protected]>
19+
Jordan Gallivan <[email protected]>
1720
Joris Labie <[email protected]>
1821
Justin Dennison <[email protected]>
19-
22+
Marcus Fantham <[email protected]>
2023
Matt Cochrane <[email protected]>
2124
Milan Raj <[email protected]>
2225
Momtchil Momtchev <[email protected]>
26+
Naresh Jagadeesan <[email protected]>
27+
Nithin Katta <[email protected]>
2328
Ognjen Jevremović <[email protected]>
2429
Philipp Burckhardt <[email protected]>
25-
30+
Pranav Goswami <[email protected]>
2631
Ricky Reusser <[email protected]>
32+
Roman Stetsyk <[email protected]>
2733
Ryan Seal <[email protected]>
2834
Seyyed Parsa Neshaei <[email protected]>
2935
Shraddheya Shendre <[email protected]>
3036
Stephannie Jiménez Gacha <[email protected]>
3137
Yernar Yergaziyev <[email protected]>
32-
dorrin-sot <[email protected]>
3338
orimiles5 <[email protected]>
34-
39+
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var isAllowedCast = require( '@stdlib/ndarray-base-assert-is-allowed-data-type-c
3838
var createBuffer = require( '@stdlib/ndarray-base-buffer' );
3939
var getType = require( '@stdlib/ndarray-base-buffer-dtype' );
4040
var arrayShape = require( '@stdlib/array-shape' );
41-
var flattenArray = require( '@stdlib/utils-flatten-array' );
41+
var flatten = require( '@stdlib/array-base-flatten' );
4242
var format = require( '@stdlib/string-format' );
4343
var isArrayLikeObject = require( './is_array_like_object.js' );
4444
var getDefaults = require( './defaults.js' );
@@ -122,6 +122,7 @@ function array() {
122122
var ndims;
123123
var nopts;
124124
var opts;
125+
var osh;
125126
var len;
126127
var ord;
127128
var FLG;
@@ -280,6 +281,7 @@ function array() {
280281
len = buffer.length;
281282
} else if ( opts.flatten && isArray( buffer ) ) {
282283
shape = arrayShape( buffer );
284+
osh = shape; // cache a reference to the inferred shape
283285
ndims = shape.length;
284286
len = numel( shape );
285287
} else {
@@ -313,7 +315,7 @@ function array() {
313315
}
314316
} else if ( buffer ) {
315317
if ( btype === 'generic' && opts.flatten ) {
316-
buffer = flattenArray( buffer );
318+
buffer = flatten( buffer, osh || arrayShape( buffer ), false );
317319
}
318320
if ( buffer.length !== len ) {
319321
throw new RangeError( 'invalid arguments. Array shape is incompatible with provided data source. Number of data source elements does not match array shape.' );
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"url": "https://.com/stdlib-js/stdlib/issues"
3838
},
3939
"dependencies": {
40+
"@stdlib/array-base-flatten": ":stdlib-js/array-base-flatten#main",
4041
"@stdlib/array-shape": "^0.0.6",
4142
"@stdlib/assert-has-own-property": "^0.0.7",
4243
"@stdlib/assert-is-array": "^0.0.7",
@@ -62,8 +63,7 @@
6263
"@stdlib/ndarray-ctor": "^0.0.10",
6364
"@stdlib/ndarray-defaults": ":stdlib-js/ndarray-defaults#main",
6465
"@stdlib/string-format": "^0.0.3",
65-
"@stdlib/types": "^0.0.14",
66-
"@stdlib/utils-flatten-array": "^0.0.7"
66+
"@stdlib/types": "^0.0.14"
6767
},
6868
"devDependencies": {
6969
"@stdlib/array-float32": "^0.0.6",

0 commit comments

Comments
 (0)