Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1c2c038

Browse filesBrowse files
committed
Auto-generated commit
1 parent f7e25b8 commit 1c2c038
Copy full SHA for 1c2c038

File tree

4 files changed

+19
-12
lines changed
Filter options

4 files changed

+19
-12
lines changed

‎.github/workflows/publish.yml

Copy file name to clipboardExpand all lines: .github/workflows/publish.yml
+1-1Lines changed: 1 addition & 1 deletion
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

‎CONTRIBUTORS

Copy file name to clipboardExpand all lines: CONTRIBUTORS
+12-7Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,37 @@
33
# Contributors listed in alphabetical order.
44

55
Ali Salesi <ali_sal1381@yahoo.com>
6+
Amit Jimiwal <amitjimiwal45@gmail.com>
67
Athan Reines <kgryte@gmail.com>
78
Brendan Graetz <bguiz@users.noreply.github.com>
89
Bruno Fenzl <brunofenzl@gmail.com>
910
Christopher Dambamuromo <chridam@gmail.com>
11+
Dan Rose <danoftheroses@gmail.com>
1012
Dominik Moritz <domoritz@gmail.com>
13+
Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
1114
Frank Kovacs <fran70kk@gmail.com>
12-
Harshita Kalani <95532771+HarshitaKalani@users.noreply.github.com>
13-
James <jdgelok@gmail.com>
15+
Harshita Kalani <harshitakalani02@gmail.com>
16+
James Gelok <jdgelok@gmail.com>
1417
Jithin KS <jithinks112@gmail.com>
1518
Joey Reed <joeyrreed@gmail.com>
16-
Jordan-Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
19+
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
1720
Joris Labie <joris.labie1@gmail.com>
1821
Justin Dennison <justin1dennison@gmail.com>
19-
Marcus <mfantham@users.noreply.github.com>
22+
Marcus Fantham <mfantham@users.noreply.github.com>
2023
Matt Cochrane <matthew.cochrane.eng@gmail.com>
2124
Milan Raj <rajsite@users.noreply.github.com>
2225
Momtchil Momtchev <momtchil@momtchev.com>
26+
Naresh Jagadeesan <naresh.naresh000@gmail.com>
27+
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
2328
Ognjen Jevremović <ognjenjevremovic@users.noreply.github.com>
2429
Philipp Burckhardt <pburckhardt@outlook.com>
25-
Pranav <85227306+Pranavchiku@users.noreply.github.com>
30+
Pranav Goswami <goswami.4@iitj.ac.in>
2631
Ricky Reusser <rsreusser@gmail.com>
32+
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
2733
Ryan Seal <splrk@users.noreply.github.com>
2834
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
2935
Shraddheya Shendre <shendreshraddheya@gmail.com>
3036
Stephannie Jiménez Gacha <steff456@hotmail.com>
3137
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
32-
dorrin-sot <59933477+dorrin-sot@users.noreply.github.com>
3338
orimiles5 <97595296+orimiles5@users.noreply.github.com>
34-
rei2hu <rei2hu@users.noreply.github.com>
39+
rei2hu <reimu@reimu.ws>

‎lib/main.js

Copy file name to clipboardExpand all lines: lib/main.js
+4-2Lines changed: 4 additions & 2 deletions
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.' );

‎package.json

Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"url": "https://github.com/stdlib-js/stdlib/issues"
3838
},
3939
"dependencies": {
40+
"@stdlib/array-base-flatten": "github: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": "github: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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.