@stdlib/console-log-each 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 +30 -0
- package/NOTICE +1 -1
- package/README.md +22 -6
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +7 -0
- package/docs/types/index.d.ts +2 -2
- package/lib/main.js +13 -2
- package/package.json +18 -15
- package/docs/repl.txt +0 -24
- package/docs/types/test.ts +0 -39
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/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2023 The Stdlib Authors.
|
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
|
# logEach
|
|
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] -->
|
|
@@ -64,7 +75,7 @@ logEach( '%d < %d ', x, y );
|
|
|
64
75
|
// e.g., => '1 < 4\n2 < 5\n3 < 6\n'
|
|
65
76
|
```
|
|
66
77
|
|
|
67
|
-
If an interpolated argument is not
|
|
78
|
+
If an interpolated argument is not an array-like object, the argument is broadcasted for each iteration.
|
|
68
79
|
|
|
69
80
|
```javascript
|
|
70
81
|
var x = [ 1, 2, 3 ];
|
|
@@ -84,7 +95,8 @@ logEach( '%d < %d', x, y );
|
|
|
84
95
|
|
|
85
96
|
## Notes
|
|
86
97
|
|
|
87
|
-
- If the function is provided
|
|
98
|
+
- If the function is provided array-like objects of unequal lengths, the function throws an error.
|
|
99
|
+
- The function supports array-like objects supporting the accessor protocol (e.g., [`Complex128Array`][@stdlib/array/complex128], [`Complex64Array`][@stdlib/array/complex64], etc).
|
|
88
100
|
|
|
89
101
|
</section>
|
|
90
102
|
|
|
@@ -159,7 +171,7 @@ See [LICENSE][stdlib-license].
|
|
|
159
171
|
|
|
160
172
|
## Copyright
|
|
161
173
|
|
|
162
|
-
Copyright © 2016-
|
|
174
|
+
Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
163
175
|
|
|
164
176
|
</section>
|
|
165
177
|
|
|
@@ -172,8 +184,8 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
172
184
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/console-log-each.svg
|
|
173
185
|
[npm-url]: https://npmjs.org/package/@stdlib/console-log-each
|
|
174
186
|
|
|
175
|
-
[test-image]: https://github.com/stdlib-js/console-log-each/actions/workflows/test.yml/badge.svg?branch=v0.0
|
|
176
|
-
[test-url]: https://github.com/stdlib-js/console-log-each/actions/workflows/test.yml?query=branch:v0.0
|
|
187
|
+
[test-image]: https://github.com/stdlib-js/console-log-each/actions/workflows/test.yml/badge.svg?branch=v0.1.0
|
|
188
|
+
[test-url]: https://github.com/stdlib-js/console-log-each/actions/workflows/test.yml?query=branch:v0.1.0
|
|
177
189
|
|
|
178
190
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/console-log-each/main.svg
|
|
179
191
|
[coverage-url]: https://codecov.io/github/stdlib-js/console-log-each?branch=main
|
|
@@ -186,7 +198,7 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
186
198
|
-->
|
|
187
199
|
|
|
188
200
|
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
189
|
-
[chat-url]: https://gitter.im
|
|
201
|
+
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
|
|
190
202
|
|
|
191
203
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
192
204
|
|
|
@@ -202,6 +214,10 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
202
214
|
|
|
203
215
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/console-log-each/main/LICENSE
|
|
204
216
|
|
|
217
|
+
[@stdlib/array/complex128]: https://www.npmjs.com/package/@stdlib/stdlib
|
|
218
|
+
|
|
219
|
+
[@stdlib/array/complex64]: https://www.npmjs.com/package/@stdlib/stdlib
|
|
220
|
+
|
|
205
221
|
</section>
|
|
206
222
|
|
|
207
223
|
<!-- /.links -->
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var q=function(u,s){return function(){return s||u((s={exports:{}}).exports,s),s.exports}};var d=q(function(P,m){
|
|
2
|
+
var w=require('@stdlib/assert-is-string/dist').isPrimitive,c=require('@stdlib/assert-is-collection/dist'),p=require('@stdlib/array-base-accessors/dist'),f=require('@stdlib/error-tools-fmtprodmsg/dist'),E=require('@stdlib/console-log/dist');function b(u){var s,l,t,h,o,n,v,r,g,i,e,a;if(!w(u))throw new TypeError(f('1aZ3F',u));for(o=arguments.length,t=[],s=[],n=[],e=1;e<o;e++)if(r=arguments[e],c(r)){i=p(r),t.push(i.accessors[0]),n.push(r),s.push(1),v=r.length,e+=1;break}else r=[r],i=p(r),t.push(i.accessors[0]),n.push(r),s.push(0);for(v===void 0&&(v=1);e<o;e++){if(r=arguments[e],c(r)){if(r.length!==v)throw new RangeError(format('1aZD1'));g=1}else r=[r],g=0;i=p(r),t.push(i.accessors[0]),n.push(r),s.push(g)}for(h=[u],l=[],e=1;e<o;e++)h.push(null),l.push(0);for(e=0;e<v;e++){for(a=0;a<o-1;a++)h[a+1]=t[a](n[a],l[a]),l[a]+=s[a];E(f.apply(null,h))}}m.exports=b
|
|
3
|
+
});var x=d();module.exports=x;
|
|
4
|
+
/** @license Apache-2.0 */
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../lib/main.js", "../lib/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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 isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar accessors = require( '@stdlib/array-base-accessors' );\nvar format = require( '@stdlib/string-format' );\nvar logger = require( '@stdlib/console-log' );\n\n\n// MAIN //\n\n/**\n* Inserts array element values into a format string and prints the result.\n*\n* @param {string} str - format string\n* @param {...(Collection|*)} args - collections or values\n* @throws {TypeError} first argument must be a string\n* @throws {RangeError} provided collections must have the same length\n* @returns {void}\n*/\nfunction logEach( str ) {\n\tvar strides;\n\tvar offsets;\n\tvar getters;\n\tvar values;\n\tvar nargs;\n\tvar args;\n\tvar len;\n\tvar v;\n\tvar s;\n\tvar o;\n\tvar i;\n\tvar j;\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\tnargs = arguments.length;\n\tgetters = [];\n\tstrides = [];\n\targs = [];\n\tfor ( i = 1; i < nargs; i++ ) {\n\t\tv = arguments[ i ];\n\t\tif ( isCollection( v ) ) {\n\t\t\to = accessors( v );\n\t\t\tgetters.push( o.accessors[ 0 ] );\n\t\t\targs.push( v );\n\t\t\tstrides.push( 1 );\n\t\t\tlen = v.length;\n\t\t\ti += 1;\n\t\t\tbreak;\n\t\t} else {\n\t\t\tv = [ v ];\n\t\t\to = accessors( v );\n\t\t\tgetters.push( o.accessors[ 0 ] );\n\t\t\targs.push( v );\n\t\t\tstrides.push( 0 );\n\t\t}\n\t}\n\tif ( len === void 0 ) {\n\t\tlen = 1;\n\t}\n\tfor ( ; i < nargs; i++ ) {\n\t\tv = arguments[ i ];\n\t\tif ( isCollection( v ) ) {\n\t\t\tif ( v.length !== len ) {\n\t\t\t\tthrow new RangeError( 'invalid argument. Provided collections must have the same length.' );\n\t\t\t}\n\t\t\ts = 1;\n\t\t} else {\n\t\t\tv = [ v ];\n\t\t\ts = 0;\n\t\t}\n\t\to = accessors( v );\n\t\tgetters.push( o.accessors[ 0 ] );\n\t\targs.push( v );\n\t\tstrides.push( s );\n\t}\n\tvalues = [ str ];\n\toffsets = [];\n\tfor ( i = 1; i < nargs; i++ ) {\n\t\tvalues.push( null );\n\t\toffsets.push( 0 );\n\t}\n\tfor ( i = 0; i < len; i++ ) {\n\t\tfor ( j = 0; j < nargs-1; j++ ) {\n\t\t\tvalues[ j+1 ] = getters[ j ]( args[ j ], offsets[ j ] );\n\t\t\toffsets[ j ] += strides[ j ];\n\t\t}\n\t\tlogger( format.apply( null, values ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = logEach;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Insert array element values into a format string and print the result.\n*\n* @module @stdlib/console-log-each\n*\n* @example\n* var logEach = require( '@stdlib/console-log-each' );\n*\n* var x = [ 1, 2, 3 ];\n* var y = [ 4, 5, 6 ];\n*\n* logEach( '%d < %d ', x, y );\n* // e.g., => '1 < 4\\n2 < 5\\n3 < 6\\n'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAe,QAAS,8BAA+B,EACvDC,EAAY,QAAS,8BAA+B,EACpDC,EAAS,QAAS,uBAAwB,EAC1CC,EAAS,QAAS,qBAAsB,EAc5C,SAASC,EAASC,EAAM,CACvB,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,GAAK,CAAClB,EAAUM,CAAI,EACnB,MAAM,IAAI,UAAWH,EAAQ,kEAAmEG,CAAI,CAAE,EAMvG,IAJAK,EAAQ,UAAU,OAClBF,EAAU,CAAC,EACXF,EAAU,CAAC,EACXK,EAAO,CAAC,EACFK,EAAI,EAAGA,EAAIN,EAAOM,IAEvB,GADAH,EAAI,UAAWG,CAAE,EACZhB,EAAca,CAAE,EAAI,CACxBE,EAAId,EAAWY,CAAE,EACjBL,EAAQ,KAAMO,EAAE,UAAW,CAAE,CAAE,EAC/BJ,EAAK,KAAME,CAAE,EACbP,EAAQ,KAAM,CAAE,EAChBM,EAAMC,EAAE,OACRG,GAAK,EACL,KACD,MACCH,EAAI,CAAEA,CAAE,EACRE,EAAId,EAAWY,CAAE,EACjBL,EAAQ,KAAMO,EAAE,UAAW,CAAE,CAAE,EAC/BJ,EAAK,KAAME,CAAE,EACbP,EAAQ,KAAM,CAAE,EAMlB,IAHKM,IAAQ,SACZA,EAAM,GAECI,EAAIN,EAAOM,IAAM,CAExB,GADAH,EAAI,UAAWG,CAAE,EACZhB,EAAca,CAAE,EAAI,CACxB,GAAKA,EAAE,SAAWD,EACjB,MAAM,IAAI,WAAY,mEAAoE,EAE3FE,EAAI,CACL,MACCD,EAAI,CAAEA,CAAE,EACRC,EAAI,EAELC,EAAId,EAAWY,CAAE,EACjBL,EAAQ,KAAMO,EAAE,UAAW,CAAE,CAAE,EAC/BJ,EAAK,KAAME,CAAE,EACbP,EAAQ,KAAMQ,CAAE,CACjB,CAGA,IAFAL,EAAS,CAAEJ,CAAI,EACfE,EAAU,CAAC,EACLS,EAAI,EAAGA,EAAIN,EAAOM,IACvBP,EAAO,KAAM,IAAK,EAClBF,EAAQ,KAAM,CAAE,EAEjB,IAAMS,EAAI,EAAGA,EAAIJ,EAAKI,IAAM,CAC3B,IAAMC,EAAI,EAAGA,EAAIP,EAAM,EAAGO,IACzBR,EAAQQ,EAAE,CAAE,EAAIT,EAASS,CAAE,EAAGN,EAAMM,CAAE,EAAGV,EAASU,CAAE,CAAE,EACtDV,EAASU,CAAE,GAAKX,EAASW,CAAE,EAE5Bd,EAAQD,EAAO,MAAO,KAAMO,CAAO,CAAE,CACtC,CACD,CAKAX,EAAO,QAAUM,IC9EjB,IAAIc,EAAO,IAKX,OAAO,QAAUA",
|
|
6
|
+
"names": ["require_main", "__commonJSMin", "exports", "module", "isString", "isCollection", "accessors", "format", "logger", "logEach", "str", "strides", "offsets", "getters", "values", "nargs", "args", "len", "v", "s", "o", "i", "j", "main"]
|
|
7
|
+
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
// TypeScript Version:
|
|
19
|
+
// TypeScript Version: 4.1
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Inserts array element values into a format string and prints the result.
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
* @param str - format string
|
|
29
29
|
* @param args - collections or values
|
|
30
|
-
* @throws
|
|
30
|
+
* @throws provided collections must have the same length
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* var logEach = require( `@stdlib/console/log-each` );
|
package/lib/main.js
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
var isString = require( '@stdlib/assert-is-string' ).isPrimitive;
|
|
24
24
|
var isCollection = require( '@stdlib/assert-is-collection' );
|
|
25
|
+
var accessors = require( '@stdlib/array-base-accessors' );
|
|
25
26
|
var format = require( '@stdlib/string-format' );
|
|
26
27
|
var logger = require( '@stdlib/console-log' );
|
|
27
28
|
|
|
@@ -40,30 +41,38 @@ var logger = require( '@stdlib/console-log' );
|
|
|
40
41
|
function logEach( str ) {
|
|
41
42
|
var strides;
|
|
42
43
|
var offsets;
|
|
44
|
+
var getters;
|
|
43
45
|
var values;
|
|
44
46
|
var nargs;
|
|
45
47
|
var args;
|
|
46
48
|
var len;
|
|
47
49
|
var v;
|
|
48
50
|
var s;
|
|
51
|
+
var o;
|
|
49
52
|
var i;
|
|
50
53
|
var j;
|
|
51
54
|
if ( !isString( str ) ) {
|
|
52
55
|
throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );
|
|
53
56
|
}
|
|
54
57
|
nargs = arguments.length;
|
|
58
|
+
getters = [];
|
|
55
59
|
strides = [];
|
|
56
60
|
args = [];
|
|
57
61
|
for ( i = 1; i < nargs; i++ ) {
|
|
58
62
|
v = arguments[ i ];
|
|
59
63
|
if ( isCollection( v ) ) {
|
|
64
|
+
o = accessors( v );
|
|
65
|
+
getters.push( o.accessors[ 0 ] );
|
|
60
66
|
args.push( v );
|
|
61
67
|
strides.push( 1 );
|
|
62
68
|
len = v.length;
|
|
63
69
|
i += 1;
|
|
64
70
|
break;
|
|
65
71
|
} else {
|
|
66
|
-
|
|
72
|
+
v = [ v ];
|
|
73
|
+
o = accessors( v );
|
|
74
|
+
getters.push( o.accessors[ 0 ] );
|
|
75
|
+
args.push( v );
|
|
67
76
|
strides.push( 0 );
|
|
68
77
|
}
|
|
69
78
|
}
|
|
@@ -81,6 +90,8 @@ function logEach( str ) {
|
|
|
81
90
|
v = [ v ];
|
|
82
91
|
s = 0;
|
|
83
92
|
}
|
|
93
|
+
o = accessors( v );
|
|
94
|
+
getters.push( o.accessors[ 0 ] );
|
|
84
95
|
args.push( v );
|
|
85
96
|
strides.push( s );
|
|
86
97
|
}
|
|
@@ -92,7 +103,7 @@ function logEach( str ) {
|
|
|
92
103
|
}
|
|
93
104
|
for ( i = 0; i < len; i++ ) {
|
|
94
105
|
for ( j = 0; j < nargs-1; j++ ) {
|
|
95
|
-
values[ j+1 ] =
|
|
106
|
+
values[ j+1 ] = getters[ j ]( args[ j ], offsets[ j ] );
|
|
96
107
|
offsets[ j ] += strides[ j ];
|
|
97
108
|
}
|
|
98
109
|
logger( format.apply( null, values ) );
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/console-log-each",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Insert array element values into a format string and print the result.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -37,20 +37,23 @@
|
|
|
37
37
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@stdlib/
|
|
41
|
-
"@stdlib/assert-is-
|
|
42
|
-
"@stdlib/
|
|
43
|
-
"@stdlib/
|
|
40
|
+
"@stdlib/array-base-accessors": "^0.1.0",
|
|
41
|
+
"@stdlib/assert-is-collection": "^0.1.0",
|
|
42
|
+
"@stdlib/assert-is-string": "^0.1.0",
|
|
43
|
+
"@stdlib/console-log": "^0.1.0",
|
|
44
|
+
"@stdlib/string-format": "^0.1.0",
|
|
45
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.1.0"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@stdlib/array-
|
|
47
|
-
"@stdlib/array-
|
|
48
|
-
"@stdlib/
|
|
49
|
-
"@stdlib/
|
|
50
|
-
"@stdlib/math-base-special-
|
|
51
|
-
"@stdlib/
|
|
52
|
-
"@stdlib/
|
|
53
|
-
"@stdlib/utils-
|
|
48
|
+
"@stdlib/array-complex128": "^0.1.0",
|
|
49
|
+
"@stdlib/array-filled-by": "^0.0.2",
|
|
50
|
+
"@stdlib/array-zeros": "^0.1.0",
|
|
51
|
+
"@stdlib/bench": "^0.1.0",
|
|
52
|
+
"@stdlib/math-base-special-abs": "^0.1.0",
|
|
53
|
+
"@stdlib/math-base-special-pow": "^0.1.0",
|
|
54
|
+
"@stdlib/random-base-discrete-uniform": "^0.0.6",
|
|
55
|
+
"@stdlib/utils-map": "^0.0.1",
|
|
56
|
+
"@stdlib/utils-nary-function": "^0.1.0",
|
|
54
57
|
"proxyquire": "^2.0.0",
|
|
55
58
|
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
56
59
|
"istanbul": "^0.4.1",
|
|
@@ -75,7 +78,7 @@
|
|
|
75
78
|
"stdlib"
|
|
76
79
|
],
|
|
77
80
|
"funding": {
|
|
78
|
-
"type": "
|
|
79
|
-
"url": "https://
|
|
81
|
+
"type": "opencollective",
|
|
82
|
+
"url": "https://opencollective.com/stdlib"
|
|
80
83
|
}
|
|
81
84
|
}
|
package/docs/repl.txt
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
{{alias}}( str[, ...args] )
|
|
3
|
-
Inserts array element values into a format string and prints the result.
|
|
4
|
-
|
|
5
|
-
If an interpolated argument is not a collection, the argument is broadcasted
|
|
6
|
-
for each iteration.
|
|
7
|
-
|
|
8
|
-
Parameters
|
|
9
|
-
----------
|
|
10
|
-
str: String
|
|
11
|
-
Format string.
|
|
12
|
-
|
|
13
|
-
args: ...any (optional)
|
|
14
|
-
Collections or values.
|
|
15
|
-
|
|
16
|
-
Examples
|
|
17
|
-
--------
|
|
18
|
-
> var x = [ 1, 2, 3 ];
|
|
19
|
-
> var y = [ 4, 5, 6 ];
|
|
20
|
-
> {{alias}}( '%d < %d ', x, y );
|
|
21
|
-
|
|
22
|
-
See Also
|
|
23
|
-
--------
|
|
24
|
-
|
package/docs/types/test.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @license Apache-2.0
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2022 The Stdlib Authors.
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import logEach = require( './index' );
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// TESTS //
|
|
23
|
-
|
|
24
|
-
// The function returns undefined...
|
|
25
|
-
{
|
|
26
|
-
logEach( '%d', [ 1, 2, 3 ] ); // $ExpectType void
|
|
27
|
-
logEach( '%d, %d', [ 1, 2, 3 ], 2 ); // $ExpectType void
|
|
28
|
-
logEach( '%d, %d', [ 1, 2, 3 ], [ 2, 3, 4 ] ); // $ExpectType void
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// The compiler throws an error if the function is provided a first argument which is not string...
|
|
32
|
-
{
|
|
33
|
-
logEach( 123, [ 1, 2, 3 ] ); // $ExpectError
|
|
34
|
-
logEach( true, [ 1, 2, 3 ] ); // $ExpectError
|
|
35
|
-
logEach( false, [ 1, 2, 3 ] ); // $ExpectError
|
|
36
|
-
logEach( {}, [ 1, 2, 3 ] ); // $ExpectError
|
|
37
|
-
logEach( null, [ 1, 2, 3 ] ); // $ExpectError
|
|
38
|
-
logEach( undefined, [ 1, 2, 3 ] ); // $ExpectError
|
|
39
|
-
}
|