Skip to content

Commit fd82d62

Browse files
committed
Auto-generated commit
1 parent d6e0790 commit fd82d62

File tree

2 files changed

+195
-34
lines changed

2 files changed

+195
-34
lines changed

docs/types/index.d.ts

Lines changed: 167 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ import cartesianProduct = require( '@stdlib/array-base-cartesian-product' );
6363
import cartesianSquare = require( '@stdlib/array-base-cartesian-square' );
6464
import copy = require( '@stdlib/array-base-copy' );
6565
import copyIndexed = require( '@stdlib/array-base-copy-indexed' );
66+
import countFalsy = require( '@stdlib/array-base-count-falsy' );
67+
import countTruthy = require( '@stdlib/array-base-count-truthy' );
6668
import dedupe = require( '@stdlib/array-base-dedupe' );
6769
import every = require( '@stdlib/array-base-every' );
6870
import everyBy = require( '@stdlib/array-base-every-by' );
6971
import everyByRight = require( '@stdlib/array-base-every-by-right' );
72+
import fancySlice = require( '@stdlib/array-base-fancy-slice' );
73+
import fancySliceAssign = require( '@stdlib/array-base-fancy-slice-assign' );
7074
import filled = require( '@stdlib/array-base-filled' );
7175
import filledBy = require( '@stdlib/array-base-filled-by' );
7276
import filled2d = require( '@stdlib/array-base-filled2d' );
@@ -117,8 +121,11 @@ import map2d = require( '@stdlib/array-base-map2d' );
117121
import map3d = require( '@stdlib/array-base-map3d' );
118122
import map4d = require( '@stdlib/array-base-map4d' );
119123
import map5d = require( '@stdlib/array-base-map5d' );
124+
import minSignedIntegerDataType = require( '@stdlib/array-base-min-signed-integer-dtype' );
125+
import minUnsignedIntegerDataType = require( '@stdlib/array-base-min-unsigned-integer-dtype' );
120126
import mskbinary2d = require( '@stdlib/array-base-mskbinary2d' );
121127
import mskfilter = require( '@stdlib/array-base-mskfilter' );
128+
import mskreject = require( '@stdlib/array-base-mskreject' );
122129
import mskunary2d = require( '@stdlib/array-base-mskunary2d' );
123130
import mskunary3d = require( '@stdlib/array-base-mskunary3d' );
124131
import nCartesianProduct = require( '@stdlib/array-base-n-cartesian-product' );
@@ -140,6 +147,7 @@ import quinary2d = require( '@stdlib/array-base-quinary2d' );
140147
import quinary3d = require( '@stdlib/array-base-quinary3d' );
141148
import quinary4d = require( '@stdlib/array-base-quinary4d' );
142149
import quinary5d = require( '@stdlib/array-base-quinary5d' );
150+
import reject = require( '@stdlib/array-base-reject' );
143151
import resolveGetter = require( '@stdlib/array-base-resolve-getter' );
144152
import resolveSetter = require( '@stdlib/array-base-resolve-setter' );
145153
import reverse = require( '@stdlib/array-base-reverse' );
@@ -1318,6 +1326,34 @@ interface Namespace {
13181326
*/
13191327
copyIndexed: typeof copyIndexed;
13201328

1329+
/**
1330+
* Counts the number of falsy values in an array.
1331+
*
1332+
* @param x - input array
1333+
* @returns number of falsy values
1334+
*
1335+
* @example
1336+
* var x = [ 0, 1, 0, 1, 1 ];
1337+
*
1338+
* var out = ns.countFalsy( x );
1339+
* // returns 2
1340+
*/
1341+
countFalsy: typeof countFalsy;
1342+
1343+
/**
1344+
* Counts the number of truthy values in an array.
1345+
*
1346+
* @param x - input array
1347+
* @returns number of truthy values
1348+
*
1349+
* @example
1350+
* var x = [ 0, 1, 0, 1, 1 ];
1351+
*
1352+
* var out = ns.countTruthy( x );
1353+
* // returns 3
1354+
*/
1355+
countTruthy: typeof countTruthy;
1356+
13211357
/**
13221358
* Removes consecutive duplicated values.
13231359
*
@@ -1419,6 +1455,55 @@ interface Namespace {
14191455
*/
14201456
everyByRight: typeof everyByRight;
14211457

1458+
/**
1459+
* Returns a shallow copy of a portion of an array.
1460+
*
1461+
* @param x - input array
1462+
* @param s - slice object
1463+
* @param strict - boolean indicating whether to enforce strict bounds checking
1464+
* @returns output array
1465+
*
1466+
* @example
1467+
* var Slice = require( '@stdlib/ns.fancySlice-ctor' );
1468+
*
1469+
* var x = [ 1, 2, 3, 4, 5, 6 ];
1470+
*
1471+
* var out = ns.fancySlice( x, new Slice( null, null, -1 ), false );
1472+
* // returns [ 6, 5, 4, 3, 2, 1 ]
1473+
*/
1474+
fancySlice: typeof fancySlice;
1475+
1476+
/**
1477+
* Assigns element values from a broadcasted input array to corresponding elements in an output array.
1478+
*
1479+
* ## Notes
1480+
*
1481+
* - The input array must be broadcast compatible with the output array slice to which elements will be assigned (i.e., contain only one element or the same number of elements as in the slice).
1482+
* - The input array must have a data type which can be safely cast to the output array data type. Floating-point data types (both real and complex) are allowed to downcast to a lower precision data type of the same kind (e.g., element values from a `'float64'` input array can be assigned to corresponding elements in a `'float32'` output array).
1483+
*
1484+
* @param x - input array
1485+
* @param y - output array
1486+
* @param s - slice object
1487+
* @param strict - boolean indicating whether to enforce strict bounds checking
1488+
* @returns output array
1489+
*
1490+
* @example
1491+
* var Slice = require( '@stdlib/slice-ctor' );
1492+
*
1493+
* var x = [ 1, 2, 3, 4 ];
1494+
* var y = [ 0, 0, 0, 0, 0, 0, 0, 0 ];
1495+
*
1496+
* var s = new Slice( null, null, 2 );
1497+
* // returns <Slice>
1498+
*
1499+
* var out = ns.fancySliceAssign( x, y, s, false );
1500+
* // returns [ 1, 0, 2, 0, 3, 0, 4, 0 ]
1501+
*
1502+
* var bool = ( out === y );
1503+
* // returns true
1504+
*/
1505+
fancySliceAssign: typeof fancySliceAssign;
1506+
14221507
/**
14231508
* Returns a filled "generic" array.
14241509
*
@@ -2562,6 +2647,38 @@ interface Namespace {
25622647
*/
25632648
map5d: typeof map5d;
25642649

2650+
/**
2651+
* Returns the minimum array data type for storing a provided signed integer value.
2652+
*
2653+
* @param value - scalar value
2654+
* @returns array data type
2655+
*
2656+
* @example
2657+
* var dt = ns.minSignedIntegerDataType( 1280 );
2658+
* // returns 'int16'
2659+
*
2660+
* @example
2661+
* var dt = ns.minSignedIntegerDataType( 3 );
2662+
* // returns 'int8'
2663+
*/
2664+
minSignedIntegerDataType: typeof minSignedIntegerDataType;
2665+
2666+
/**
2667+
* Returns the minimum array data type for storing a provided unsigned integer value.
2668+
*
2669+
* @param value - scalar value
2670+
* @returns array data type
2671+
*
2672+
* @example
2673+
* var dt = ns.minUnsignedIntegerDataType( 1280 );
2674+
* // returns 'uint16'
2675+
*
2676+
* @example
2677+
* var dt = ns.minUnsignedIntegerDataType( 3 );
2678+
* // returns 'uint8'
2679+
*/
2680+
minUnsignedIntegerDataType: typeof minUnsignedIntegerDataType;
2681+
25652682
/**
25662683
* Applies a binary callback to elements in two two-dimensional nested input arrays according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array.
25672684
*
@@ -2609,6 +2726,21 @@ interface Namespace {
26092726
*/
26102727
mskfilter: typeof mskfilter;
26112728

2729+
/**
2730+
* Returns a new array by applying a mask to a provided input array.
2731+
*
2732+
* @param x - input array
2733+
* @param mask - mask array
2734+
* @returns output array
2735+
*
2736+
* @example
2737+
* var x = [ 1, 2, 3, 4 ];
2738+
*
2739+
* var y = ns.mskreject( x, [ 0, 1, 0, 1 ] );
2740+
* // returns [ 1, 3 ]
2741+
*/
2742+
mskreject: typeof mskreject;
2743+
26122744
/**
26132745
* Applies a unary callback to elements in a two-dimensional nested input array according to elements in a two-dimensional nested mask array and assigns results to elements in a two-dimensional nested output array.
26142746
*
@@ -3115,6 +3247,22 @@ interface Namespace {
31153247
*/
31163248
quinary5d: typeof quinary5d;
31173249

3250+
/**
3251+
* Returns a shallow copy of an array containing only those elements which fail a test implemented by a predicate function.
3252+
*
3253+
* @param x - input array
3254+
* @param predicate - predicate function
3255+
* @param thisArg - predicate function execution context
3256+
* @returns output array
3257+
*
3258+
* @example
3259+
* var x = [ 1, -2, -3, 4 ];
3260+
*
3261+
* var out = ns.reject( x, isPositiveNumber );
3262+
* // returns [ -2, -3 ]
3263+
*/
3264+
reject: typeof reject;
3265+
31183266
/**
31193267
* Returns an accessor function for retrieving an element from an indexed array-like object.
31203268
*
@@ -3192,6 +3340,12 @@ interface Namespace {
31923340
* @returns output array
31933341
*
31943342
* @example
3343+
* var x = [ 1, 2, 3 ];
3344+
*
3345+
* var out = ns.slice( x, 0, 3 );
3346+
* // returns [ 1, 2, 3 ]
3347+
*
3348+
* @example
31953349
* var x = [ 1, 2, 3, 4, 5, 6 ];
31963350
*
31973351
* var out = ns.slice( x, 0, 3 );
@@ -3308,21 +3462,28 @@ interface Namespace {
33083462
strided2array5d: typeof strided2array5d;
33093463

33103464
/**
3311-
* Takes element from an array.
3312-
*
3313-
* ## Notes
3314-
*
3315-
* - The function does **not** perform bounds checking. If an index is less than zero or greater than the maximum index of `x`, the value of the corresponding element in the output array is undefined.
3465+
* Takes elements from an array.
33163466
*
33173467
* @param x - input array
33183468
* @param indices - list of element indices
3469+
* @param mode - index mode
33193470
* @returns output array
33203471
*
33213472
* @example
33223473
* var x = [ 1, 2, 3, 4 ];
33233474
*
3324-
* var y = ns.take( x, [ 1, 3 ] );
3475+
* var y = ns.take( x, [ 1, 3 ], 'throw' );
33253476
* // returns [ 2, 4 ]
3477+
*
3478+
* @example
3479+
* var x = [ 1, 2, 3, 4 ];
3480+
* var out = [ 0, 0, 0, 0 ];
3481+
*
3482+
* var arr = ns.take.assign( x, [ 1, 3 ], 'throw', out, 2, 0 );
3483+
* // returns [ 2, 0, 4, 0 ]
3484+
*
3485+
* var bool = ( arr === out );
3486+
* // returns true
33263487
*/
33273488
take: typeof take;
33283489

package.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
"@stdlib/array-base-cartesian-square": "^0.2.0",
8080
"@stdlib/array-base-copy": "^0.2.0",
8181
"@stdlib/array-base-copy-indexed": "^0.2.0",
82-
"@stdlib/array-base-count-falsy": "github:stdlib-js/array-base-count-falsy#main",
83-
"@stdlib/array-base-count-truthy": "github:stdlib-js/array-base-count-truthy#main",
82+
"@stdlib/array-base-count-falsy": "^0.1.0",
83+
"@stdlib/array-base-count-truthy": "^0.1.0",
8484
"@stdlib/array-base-dedupe": "^0.2.0",
8585
"@stdlib/array-base-every": "^0.2.0",
8686
"@stdlib/array-base-every-by": "^0.2.0",
@@ -198,14 +198,14 @@
198198
"@stdlib/array-base-zeros4d": "^0.2.0",
199199
"@stdlib/array-base-zeros5d": "^0.2.0",
200200
"@stdlib/array-base-zerosnd": "^0.2.0",
201-
"@stdlib/utils-define-read-only-property": "^0.2.0"
201+
"@stdlib/utils-define-read-only-property": "^0.2.1"
202202
},
203203
"devDependencies": {
204204
"@stdlib/array-base-assert-contains": "^0.2.0",
205205
"@stdlib/array-base-assert-has-same-values": "^0.2.0",
206206
"@stdlib/array-base-assert-is-accessor-array": "^0.2.0",
207207
"@stdlib/array-base-assert-is-complex-floating-point-data-type": "^0.2.0",
208-
"@stdlib/array-base-assert-is-complex-typed-array": "github:stdlib-js/array-base-assert-is-complex-typed-array#main",
208+
"@stdlib/array-base-assert-is-complex-typed-array": "^0.1.0",
209209
"@stdlib/array-base-assert-is-complex128array": "^0.2.0",
210210
"@stdlib/array-base-assert-is-complex64array": "^0.2.0",
211211
"@stdlib/array-base-assert-is-data-type": "^0.2.0",
@@ -243,16 +243,16 @@
243243
"@stdlib/array-uint8c": "^0.2.0",
244244
"@stdlib/array-zero-to": "^0.2.0",
245245
"@stdlib/array-zeros": "^0.2.0",
246-
"@stdlib/assert-has-own-property": "^0.2.0",
247-
"@stdlib/assert-instance-of": "^0.2.0",
248-
"@stdlib/assert-is-array": "^0.2.0",
246+
"@stdlib/assert-has-own-property": "^0.2.1",
247+
"@stdlib/assert-instance-of": "^0.2.1",
248+
"@stdlib/assert-is-array": "^0.2.1",
249249
"@stdlib/assert-is-array-array": "^0.2.0",
250-
"@stdlib/assert-is-boolean": "^0.2.0",
250+
"@stdlib/assert-is-boolean": "^0.2.1",
251251
"@stdlib/assert-is-collection": "^0.2.0",
252252
"@stdlib/assert-is-complex64": "^0.2.0",
253-
"@stdlib/assert-is-float64array": "^0.2.0",
254-
"@stdlib/assert-is-function": "^0.2.0",
255-
"@stdlib/assert-is-int32array": "^0.2.0",
253+
"@stdlib/assert-is-float64array": "^0.2.1",
254+
"@stdlib/assert-is-function": "^0.2.1",
255+
"@stdlib/assert-is-int32array": "^0.2.1",
256256
"@stdlib/assert-is-integer": "^0.2.0",
257257
"@stdlib/assert-is-method": "^0.2.0",
258258
"@stdlib/assert-is-nan": "^0.2.0",
@@ -266,9 +266,9 @@
266266
"@stdlib/assert-is-same-complex64array": "^0.2.0",
267267
"@stdlib/assert-is-same-float64array": "^0.2.0",
268268
"@stdlib/assert-is-same-value": "^0.2.0",
269-
"@stdlib/assert-is-string": "^0.2.0",
269+
"@stdlib/assert-is-string": "^0.2.1",
270270
"@stdlib/blas-base-gcopy": "^0.2.0",
271-
"@stdlib/blas-base-gscal": "^0.2.0",
271+
"@stdlib/blas-base-gscal": "^0.2.1",
272272
"@stdlib/blas-ext-base-gfill": "^0.2.0",
273273
"@stdlib/blas-ext-base-grev": "^0.2.0",
274274
"@stdlib/blas-ext-base-gsort2hp": "^0.2.0",
@@ -279,15 +279,15 @@
279279
"@stdlib/complex-imagf": "^0.2.0",
280280
"@stdlib/complex-real": "^0.2.0",
281281
"@stdlib/complex-realf": "^0.2.0",
282-
"@stdlib/constants-int16-max": "^0.2.0",
283-
"@stdlib/constants-int16-min": "^0.2.0",
284-
"@stdlib/constants-int32-max": "^0.2.0",
285-
"@stdlib/constants-int32-min": "^0.2.0",
286-
"@stdlib/constants-int8-max": "^0.2.0",
287-
"@stdlib/constants-int8-min": "^0.2.0",
288-
"@stdlib/constants-uint16-max": "^0.2.0",
289-
"@stdlib/constants-uint32-max": "^0.2.0",
290-
"@stdlib/constants-uint8-max": "^0.2.0",
282+
"@stdlib/constants-int16-max": "^0.2.1",
283+
"@stdlib/constants-int16-min": "^0.2.1",
284+
"@stdlib/constants-int32-max": "^0.2.1",
285+
"@stdlib/constants-int32-min": "^0.2.1",
286+
"@stdlib/constants-int8-max": "^0.2.1",
287+
"@stdlib/constants-int8-min": "^0.2.1",
288+
"@stdlib/constants-uint16-max": "^0.2.1",
289+
"@stdlib/constants-uint32-max": "^0.2.1",
290+
"@stdlib/constants-uint8-max": "^0.2.1",
291291
"@stdlib/math-base-assert-is-even": "^0.2.0",
292292
"@stdlib/math-base-assert-is-nan": "^0.2.0",
293293
"@stdlib/math-base-assert-is-nanf": "^0.2.0",
@@ -322,14 +322,14 @@
322322
"@stdlib/strided-base-reinterpret-complex": "github:stdlib-js/strided-base-reinterpret-complex#main",
323323
"@stdlib/strided-base-reinterpret-complex128": "^0.2.0",
324324
"@stdlib/strided-base-reinterpret-complex64": "^0.2.0",
325-
"@stdlib/string-format": "^0.2.0",
326-
"@stdlib/utils-constant-function": "^0.2.0",
327-
"@stdlib/utils-constructor-name": "^0.2.0",
328-
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0",
329-
"@stdlib/utils-define-nonenumerable-read-write-accessor": "^0.2.0",
325+
"@stdlib/string-format": "^0.2.1",
326+
"@stdlib/utils-constant-function": "^0.2.1",
327+
"@stdlib/utils-constructor-name": "^0.2.1",
328+
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1",
329+
"@stdlib/utils-define-nonenumerable-read-write-accessor": "^0.2.1",
330330
"@stdlib/utils-keys": "^0.2.0",
331331
"@stdlib/utils-nary-function": "^0.2.0",
332-
"@stdlib/utils-papply": "^0.2.0",
332+
"@stdlib/utils-papply": "^0.2.1",
333333
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
334334
"istanbul": "^0.4.1",
335335
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",

0 commit comments

Comments
 (0)