@stdlib/array-base-flatten 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CITATION.cff ADDED
@@ -0,0 +1,30 @@
1
+ cff-version: 1.2.0
2
+ title: stdlib
3
+ message: >-
4
+ If you use this software, please cite it using the
5
+ metadata from this file.
6
+
7
+ type: software
8
+
9
+ authors:
10
+ - name: The Stdlib Authors
11
+ url: https://github.com/stdlib-js/stdlib/graphs/contributors
12
+
13
+ repository-code: https://github.com/stdlib-js/stdlib
14
+ url: https://stdlib.io
15
+
16
+ abstract: |
17
+ Standard library for JavaScript and Node.js.
18
+
19
+ keywords:
20
+ - JavaScript
21
+ - Node.js
22
+ - TypeScript
23
+ - standard library
24
+ - scientific computing
25
+ - numerical computing
26
+ - statistical computing
27
+
28
+ license: Apache-2.0 AND BSL-1.0
29
+
30
+ date-released: 2016
package/README.md CHANGED
@@ -18,6 +18,17 @@ limitations under the License.
18
18
 
19
19
  -->
20
20
 
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+ <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+ <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
21
32
  # flatten
22
33
 
23
34
  [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -209,8 +220,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
209
220
  [npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-flatten.svg
210
221
  [npm-url]: https://npmjs.org/package/@stdlib/array-base-flatten
211
222
 
212
- [test-image]: https://github.com/stdlib-js/array-base-flatten/actions/workflows/test.yml/badge.svg?branch=v0.0.1
213
- [test-url]: https://github.com/stdlib-js/array-base-flatten/actions/workflows/test.yml?query=branch:v0.0.1
223
+ [test-image]: https://github.com/stdlib-js/array-base-flatten/actions/workflows/test.yml/badge.svg?branch=v0.1.0
224
+ [test-url]: https://github.com/stdlib-js/array-base-flatten/actions/workflows/test.yml?query=branch:v0.1.0
214
225
 
215
226
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-flatten/main.svg
216
227
  [coverage-url]: https://codecov.io/github/stdlib-js/array-base-flatten?branch=main
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import flatten from '../docs/types/index';
3
+ export = flatten;
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";var s=function(a,r){return function(){return r||a((r={exports:{}}).exports,r),r.exports}};var x=s(function(I,L){
2
+ var D=require('@stdlib/ndarray-base-shape2strides/dist'),E=require('@stdlib/ndarray-base-vind2bind/dist'),F=require('@stdlib/ndarray-base-numel/dist'),w=require('@stdlib/blas-ext-base-grev/dist'),y=require('@stdlib/array-base-zeros/dist'),G="throw";function z(a,r,n,e,u){var i;for(i=0;i<r;i++)n[u]=a[i],u+=e}function o(a,r,n,e,u,i,v){var q,l,t,c;for(t=e+1,q=t===r,l=n[e],c=0;c<l;c++)q?(u[v]=a[c],v+=i):v=o(a[c],r,n,t,u,i,v);return v}function M(a,r,n,e,u,i){var v,q,l,t,c,j,g;for(v=F(n),q=y(v),o(a,r,n,0,q,1,0),l="row-major",c=D(n,l),t=y(r),z(n,r,t,1,0),w(r,t,1),w(r,c,1),g=0;g<v;g++)j=E(t,c,0,l,g,G),e[i]=q[j],i+=u}function R(a,r,n,e,u,i){var v=r.length;return v===0?e:v===1?(z(a,r[0],e,u,i),e):n?(M(a,v,r,e,u,i),e):(o(a,v,r,0,e,u,i),e)}L.exports=R
3
+ });var b=s(function(J,O){
4
+ var S=require('@stdlib/ndarray-base-numel/dist'),k=require('@stdlib/array-base-zeros/dist'),m=x();function p(a,r,n){var e=k(S(r));return m(a,r,n,e,1,0)}O.exports=p
5
+ });var A=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),C=b(),B=x();A(C,"assign",B);module.exports=C;
6
+ /** @license Apache-2.0 */
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/assign.js", "../lib/main.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar shape2strides = require( '@stdlib/ndarray-base-shape2strides' );\nvar vind2bind = require( '@stdlib/ndarray-base-vind2bind' );\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar grev = require( '@stdlib/blas-ext-base-grev' );\nvar zeros = require( '@stdlib/array-base-zeros' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// FUNCTIONS //\n\n/**\n* Copies a specified number of array elements to a provided array.\n*\n* @private\n* @param {Array} x - input array\n* @param {NonNegativeInteger} N - number of elements to copy\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = [ 0, 0, 0 ];\n* copy( x, 3, out, 1, 0 );\n*\n* var o = out;\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x, N, out, stride, offset ) {\n\tvar i;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tout[ offset ] = x[ i ];\n\t\toffset += stride;\n\t}\n}\n\n/**\n* Recursively flattens an array in lexicographic order.\n*\n* @private\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {NonNegativeInteger} dim - dimension index\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n* @returns {NonNegativeInteger} offset for next output array element\n*/\nfunction recurseLexicographic( x, ndims, shape, dim, out, stride, offset ) {\n\tvar FLG;\n\tvar S;\n\tvar d;\n\tvar i;\n\n\t// Check whether we've reached the last dimension:\n\td = dim + 1;\n\tFLG = ( d === ndims );\n\n\tS = shape[ dim ];\n\tfor ( i = 0; i < S; i++ ) {\n\t\tif ( FLG ) {\n\t\t\tout[ offset ] = x[ i ];\n\t\t\toffset += stride;\n\t\t} else {\n\t\t\toffset = recurseLexicographic( x[ i ], ndims, shape, d, out, stride, offset ); // eslint-disable-line max-len\n\t\t}\n\t}\n\treturn offset;\n}\n\n/**\n* Flattens an array in colexicographic order.\n*\n* @private\n* @param {Array} x - array to flatten\n* @param {NonNegativeInteger} ndims - number of dimensions in the input array\n* @param {NonNegativeIntegerArray} shape - shape of the input array\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array offset\n*/\nfunction flattenColexicographic( x, ndims, shape, out, stride, offset ) {\n\tvar len;\n\tvar tmp;\n\tvar ord;\n\tvar sh;\n\tvar sx;\n\tvar j;\n\tvar i;\n\n\t// Note that, in contrast to lexicographic iteration, we cannot readily define a straightforward recursive definition for colexicographic iteration. Accordingly, we have to perform a workaround in which we first flatten in lexicographic order and then perform an out-of-place transposition to return an array in colexicographic order.\n\n\t// Determine how many elements will be in the output array:\n\tlen = numel( shape );\n\n\t// For input arrays having an arbitrary number of dimensions, first flatten in lexicographic order:\n\ttmp = zeros( len );\n\trecurseLexicographic( x, ndims, shape, 0, tmp, 1, 0 );\n\n\t// Define the memory layout:\n\tord = 'row-major';\n\n\t// Generate a stride array for lexicographic order:\n\tsx = shape2strides( shape, ord );\n\n\t// Reverse the dimensions and strides (i.e., define the shape and strides of the transpose):\n\tsh = zeros( ndims );\n\tcopy( shape, ndims, sh, 1, 0 );\n\tgrev( ndims, sh, 1 );\n\tgrev( ndims, sx, 1 );\n\n\t// Iterate over each element based on the linear **view** index (note: this has negative performance implications due to lack of data locality)...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = vind2bind( sh, sx, 0, ord, i, MODE );\n\t\tout[ offset ] = tmp[ j ];\n\t\toffset += stride;\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array and assigns elements to a provided output array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false, new Float64Array( 4 ), 1, 0 );\n* // returns <Float64Array>[ 1, 2, 3, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0 );\n* // returns <Float64Array>[ 1, 3, 2, 4 ]\n*/\nfunction flatten( x, shape, colexicographic, out, stride, offset ) {\n\tvar ndims = shape.length;\n\tif ( ndims === 0 ) { // 0-dimensional array\n\t\treturn out;\n\t}\n\tif ( ndims === 1 ) { // 1-dimensional array\n\t\t// For 1-dimensional arrays, we can perform a simple copy:\n\t\tcopy( x, shape[ 0 ], out, stride, offset );\n\t\treturn out;\n\t}\n\tif ( colexicographic ) {\n\t\tflattenColexicographic( x, ndims, shape, out, stride, offset );\n\t\treturn out;\n\t}\n\trecurseLexicographic( x, ndims, shape, 0, out, stride, offset );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar zeros = require( '@stdlib/array-base-zeros' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Flattens an n-dimensional nested array.\n*\n* ## Notes\n*\n* - The function assumes that all nested arrays have the same length (i.e., the input array is **not** a ragged array).\n*\n* @param {Array} x - input nested array\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {boolean} colexicographic - specifies whether to flatten array values in colexicographic order\n* @returns {Array} flattened array\n*\n* @example\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*/\nfunction flatten( x, shape, colexicographic ) {\n\tvar out = zeros( numel( shape ) );\n\treturn assign( x, shape, colexicographic, out, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = flatten;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Flatten an n-dimensional nested array.\n*\n* @module @stdlib/array-base-flatten\n*\n* @example\n* var flatten = require( '@stdlib/array-base-flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], false );\n* // returns [ 1, 2, 3, 4 ]\n*\n* @example\n* var flatten = require( '@stdlib/array-base-flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = flatten( x, [ 2, 2 ], true );\n* // returns [ 1, 3, 2, 4 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var flatten = require( '@stdlib/array-base-flatten' );\n*\n* var x = [ [ 1, 2 ], [ 3, 4 ] ];\n*\n* var out = new Float64Array( 4 );\n* var y = flatten.assign( x, [ 2, 2 ], true, out, 1, 0 );\n* // returns <Float64Array>[ 1, 3, 2, 4 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,oCAAqC,EAC9DC,EAAY,QAAS,gCAAiC,EACtDC,EAAQ,QAAS,4BAA6B,EAC9CC,EAAO,QAAS,4BAA6B,EAC7CC,EAAQ,QAAS,0BAA2B,EAK5CC,EAAO,QAwBX,SAASC,EAAMC,EAAGC,EAAGC,EAAKC,EAAQC,EAAS,CAC1C,IAAI,EACJ,IAAM,EAAI,EAAG,EAAIH,EAAG,IACnBC,EAAKE,CAAO,EAAIJ,EAAG,CAAE,EACrBI,GAAUD,CAEZ,CAeA,SAASE,EAAsBL,EAAGM,EAAOC,EAAOC,EAAKN,EAAKC,EAAQC,EAAS,CAC1E,IAAIK,EACAC,EACAC,EACAC,EAOJ,IAJAD,EAAIH,EAAM,EACVC,EAAQE,IAAML,EAEdI,EAAIH,EAAOC,CAAI,EACTI,EAAI,EAAGA,EAAIF,EAAGE,IACdH,GACJP,EAAKE,CAAO,EAAIJ,EAAGY,CAAE,EACrBR,GAAUD,GAEVC,EAASC,EAAsBL,EAAGY,CAAE,EAAGN,EAAOC,EAAOI,EAAGT,EAAKC,EAAQC,CAAO,EAG9E,OAAOA,CACR,CAaA,SAASS,EAAwBb,EAAGM,EAAOC,EAAOL,EAAKC,EAAQC,EAAS,CACvE,IAAIU,EACAC,EACAC,EACAC,EACAC,EACA,EACAN,EAwBJ,IAnBAE,EAAMnB,EAAOY,CAAM,EAGnBQ,EAAMlB,EAAOiB,CAAI,EACjBT,EAAsBL,EAAGM,EAAOC,EAAO,EAAGQ,EAAK,EAAG,CAAE,EAGpDC,EAAM,YAGNE,EAAKzB,EAAec,EAAOS,CAAI,EAG/BC,EAAKpB,EAAOS,CAAM,EAClBP,EAAMQ,EAAOD,EAAOW,EAAI,EAAG,CAAE,EAC7BrB,EAAMU,EAAOW,EAAI,CAAE,EACnBrB,EAAMU,EAAOY,EAAI,CAAE,EAGbN,EAAI,EAAGA,EAAIE,EAAKF,IACrB,EAAIlB,EAAWuB,EAAIC,EAAI,EAAGF,EAAKJ,EAAGd,CAAK,EACvCI,EAAKE,CAAO,EAAIW,EAAK,CAAE,EACvBX,GAAUD,CAEZ,CAoCA,SAASgB,EAASnB,EAAGO,EAAOa,EAAiBlB,EAAKC,EAAQC,EAAS,CAClE,IAAIE,EAAQC,EAAM,OAClB,OAAKD,IAAU,EACPJ,EAEHI,IAAU,GAEdP,EAAMC,EAAGO,EAAO,CAAE,EAAGL,EAAKC,EAAQC,CAAO,EAClCF,GAEHkB,GACJP,EAAwBb,EAAGM,EAAOC,EAAOL,EAAKC,EAAQC,CAAO,EACtDF,IAERG,EAAsBL,EAAGM,EAAOC,EAAO,EAAGL,EAAKC,EAAQC,CAAO,EACvDF,EACR,CAKAV,EAAO,QAAU2B,IC1MjB,IAAAE,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,4BAA6B,EAC9CC,EAAQ,QAAS,0BAA2B,EAC5CC,EAAS,IA6Bb,SAASC,EAASC,EAAGC,EAAOC,EAAkB,CAC7C,IAAIC,EAAMN,EAAOD,EAAOK,CAAM,CAAE,EAChC,OAAOH,EAAQE,EAAGC,EAAOC,EAAiBC,EAAK,EAAG,CAAE,CACrD,CAKAR,EAAO,QAAUI,ICJjB,IAAIK,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,EAAS,IAKbF,EAAaC,EAAM,SAAUC,CAAO,EAKpC,OAAO,QAAUD",
6
+ "names": ["require_assign", "__commonJSMin", "exports", "module", "shape2strides", "vind2bind", "numel", "grev", "zeros", "MODE", "copy", "x", "N", "out", "stride", "offset", "recurseLexicographic", "ndims", "shape", "dim", "FLG", "S", "d", "i", "flattenColexicographic", "len", "tmp", "ord", "sh", "sx", "flatten", "colexicographic", "require_main", "__commonJSMin", "exports", "module", "numel", "zeros", "assign", "flatten", "x", "shape", "colexicographic", "out", "setReadOnly", "main", "assign"]
7
+ }
@@ -20,57 +20,8 @@
20
20
 
21
21
  /// <reference types="@stdlib/types"/>
22
22
 
23
- import { Collection } from '@stdlib/types/object';
24
-
25
- /**
26
- * One-dimensional array.
27
- */
28
- type Array1D<T> = Collection<T>;
29
-
30
- /**
31
- * Two-dimensional array.
32
- */
33
- type Array2D<T> = Array<Array1D<T>>;
34
-
35
- /**
36
- * Three-dimensional array.
37
- */
38
- type Array3D<T> = Array<Array2D<T>>;
39
-
40
- /**
41
- * Four-dimensional array.
42
- */
43
- type Array4D<T> = Array<Array3D<T>>;
44
-
45
- /**
46
- * Five-dimensional array.
47
- */
48
- type Array5D<T> = Array<Array4D<T>>;
49
-
50
- /**
51
- * Six-dimensional array.
52
- */
53
- type Array6D<T> = Array<Array5D<T>>;
54
-
55
- /**
56
- * Seven-dimensional array.
57
- */
58
- type Array7D<T> = Array<Array6D<T>>;
59
-
60
- /**
61
- * Eight-dimensional array.
62
- */
63
- type Array8D<T> = Array<Array7D<T>>;
64
-
65
- /**
66
- * Nine-dimensional array.
67
- */
68
- type Array9D<T> = Array<Array8D<T>>;
69
-
70
- /**
71
- * Ten-dimensional array.
72
- */
73
- type Array10D<T> = Array<Array9D<T>>;
23
+ import { Collection, Array1D, Array2D, Array3D, Array4D, Array5D, Array6D, Array7D, Array8D, Array9D, Array10D } from '@stdlib/types/array';
24
+ import { Shape } from '@stdlib/types/ndarray';
74
25
 
75
26
  /**
76
27
  * n-dimensional nested array.
@@ -105,7 +56,7 @@ interface Flatten {
105
56
  * var out = flatten( x, [ 2, 2 ], true );
106
57
  * // returns [ 1, 3, 2, 4 ]
107
58
  */
108
- <T = unknown>( x: ArrayND<T>, shape: Collection<number>, colexicographic: boolean ): Array<T>;
59
+ <T = unknown>( x: ArrayND<T>, shape: Shape, colexicographic: boolean ): Array<T>;
109
60
 
110
61
  /**
111
62
  * Flattens an n-dimensional nested array and assigns elements to a provided output array.
@@ -138,7 +89,7 @@ interface Flatten {
138
89
  * var out = flatten.assign( x, [ 2, 2 ], true, new Float64Array( 4 ), 1, 0 );
139
90
  * // returns <Float64Array>[ 1, 3, 2, 4 ]
140
91
  */
141
- assign<T = unknown, U = unknown>( x: ArrayND<T>, shape: Collection<number>, colexicographic: boolean, out: Collection<U>, stride: number, offset: number ): Collection<T | U>;
92
+ assign<T = unknown, U = unknown>( x: ArrayND<T>, shape: Shape, colexicographic: boolean, out: Collection<U>, stride: number, offset: number ): Collection<T | U>;
142
93
  }
143
94
 
144
95
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/array-base-flatten",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Flatten an n-dimensional nested array.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,22 +37,22 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/array-base-zeros": "^0.0.2",
41
- "@stdlib/blas-ext-base-grev": "^0.0.10",
42
- "@stdlib/ndarray-base-numel": "^0.0.8",
43
- "@stdlib/ndarray-base-shape2strides": "^0.0.8",
44
- "@stdlib/ndarray-base-vind2bind": "^0.0.8",
45
- "@stdlib/types": "^0.0.14",
46
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.7"
40
+ "@stdlib/array-base-zeros": "^0.1.0",
41
+ "@stdlib/blas-ext-base-grev": "^0.1.0",
42
+ "@stdlib/ndarray-base-numel": "^0.1.0",
43
+ "@stdlib/ndarray-base-shape2strides": "^0.1.0",
44
+ "@stdlib/ndarray-base-vind2bind": "^0.1.0",
45
+ "@stdlib/types": "^0.1.0",
46
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@stdlib/array-base-filled": "^0.0.2",
50
- "@stdlib/array-base-zero-to": "^0.0.6",
51
- "@stdlib/array-float64": "^0.0.6",
52
- "@stdlib/assert-has-own-property": "^0.0.7",
53
- "@stdlib/assert-is-array": "^0.0.7",
54
- "@stdlib/assert-is-float64array": "^0.0.8",
55
- "@stdlib/bench": "^0.0.12",
49
+ "@stdlib/array-base-filled": "^0.1.0",
50
+ "@stdlib/array-base-zero-to": "^0.1.0",
51
+ "@stdlib/array-float64": "^0.1.0",
52
+ "@stdlib/assert-has-own-property": "^0.1.0",
53
+ "@stdlib/assert-is-array": "^0.1.0",
54
+ "@stdlib/assert-is-float64array": "^0.1.0",
55
+ "@stdlib/bench": "^0.1.0",
56
56
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
57
57
  "istanbul": "^0.4.1",
58
58
  "tap-min": "git+https://github.com/Planeshifter/tap-min.git"