@stdlib/console-log-each 0.1.0 → 0.2.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/NOTICE +1 -1
- package/README.md +8 -5
- package/SECURITY.md +5 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +3 -3
- package/docs/types/index.d.ts +1 -1
- package/lib/main.js +4 -8
- package/package.json +16 -15
- package/CITATION.cff +0 -30
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -171,7 +171,7 @@ See [LICENSE][stdlib-license].
|
|
|
171
171
|
|
|
172
172
|
## Copyright
|
|
173
173
|
|
|
174
|
-
Copyright © 2016-
|
|
174
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
175
175
|
|
|
176
176
|
</section>
|
|
177
177
|
|
|
@@ -184,8 +184,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
184
184
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/console-log-each.svg
|
|
185
185
|
[npm-url]: https://npmjs.org/package/@stdlib/console-log-each
|
|
186
186
|
|
|
187
|
-
[test-image]: https://github.com/stdlib-js/console-log-each/actions/workflows/test.yml/badge.svg?branch=v0.
|
|
188
|
-
[test-url]: https://github.com/stdlib-js/console-log-each/actions/workflows/test.yml?query=branch:v0.
|
|
187
|
+
[test-image]: https://github.com/stdlib-js/console-log-each/actions/workflows/test.yml/badge.svg?branch=v0.2.0
|
|
188
|
+
[test-url]: https://github.com/stdlib-js/console-log-each/actions/workflows/test.yml?query=branch:v0.2.0
|
|
189
189
|
|
|
190
190
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/console-log-each/main.svg
|
|
191
191
|
[coverage-url]: https://codecov.io/github/stdlib-js/console-log-each?branch=main
|
|
@@ -208,15 +208,18 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
208
208
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
209
209
|
|
|
210
210
|
[deno-url]: https://github.com/stdlib-js/console-log-each/tree/deno
|
|
211
|
+
[deno-readme]: https://github.com/stdlib-js/console-log-each/blob/deno/README.md
|
|
211
212
|
[umd-url]: https://github.com/stdlib-js/console-log-each/tree/umd
|
|
213
|
+
[umd-readme]: https://github.com/stdlib-js/console-log-each/blob/umd/README.md
|
|
212
214
|
[esm-url]: https://github.com/stdlib-js/console-log-each/tree/esm
|
|
215
|
+
[esm-readme]: https://github.com/stdlib-js/console-log-each/blob/esm/README.md
|
|
213
216
|
[branches-url]: https://github.com/stdlib-js/console-log-each/blob/main/branches.md
|
|
214
217
|
|
|
215
218
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/console-log-each/main/LICENSE
|
|
216
219
|
|
|
217
|
-
[@stdlib/array/complex128]: https://www.npmjs.com/package/@stdlib/
|
|
220
|
+
[@stdlib/array/complex128]: https://www.npmjs.com/package/@stdlib/array-complex128
|
|
218
221
|
|
|
219
|
-
[@stdlib/array/complex64]: https://www.npmjs.com/package/@stdlib/
|
|
222
|
+
[@stdlib/array/complex64]: https://www.npmjs.com/package/@stdlib/array-complex64
|
|
220
223
|
|
|
221
224
|
</section>
|
|
222
225
|
|
package/SECURITY.md
ADDED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
var
|
|
3
|
-
});var
|
|
1
|
+
"use strict";var d=function(i,s){return function(){return s||i((s={exports:{}}).exports,s),s.exports}};var c=d(function(y,m){
|
|
2
|
+
var q=require('@stdlib/assert-is-string/dist').isPrimitive,p=require('@stdlib/assert-is-collection/dist'),g=require('@stdlib/array-base-resolve-getter/dist'),f=require('@stdlib/error-tools-fmtprodmsg/dist'),w=require('@stdlib/console-log/dist');function E(i){var s,l,t,o,u,n,v,r,h,e,a;if(!q(i))throw new TypeError(f('1aZ3F',i));for(u=arguments.length,t=[],s=[],n=[],e=1;e<u;e++)if(r=arguments[e],p(r)){t.push(g(r)),n.push(r),s.push(1),v=r.length,e+=1;break}else r=[r],t.push(g(r)),n.push(r),s.push(0);for(v===void 0&&(v=1);e<u;e++){if(r=arguments[e],p(r)){if(r.length!==v)throw new RangeError(f('1aZD1'));h=1}else r=[r],h=0;t.push(g(r)),n.push(r),s.push(h)}for(o=[i],l=[],e=1;e<u;e++)o.push(null),l.push(0);for(e=0;e<v;e++){for(a=0;a<u-1;a++)o[a+1]=t[a](n[a],l[a]),l[a]+=s[a];w(f.apply(null,o))}}m.exports=E
|
|
3
|
+
});var b=c();module.exports=b;
|
|
4
4
|
/** @license Apache-2.0 */
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
5
|
-
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAe,QAAS,8BAA+B,EACvDC,
|
|
6
|
-
"names": ["require_main", "__commonJSMin", "exports", "module", "isString", "isCollection", "
|
|
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 resolveGetter = require( '@stdlib/array-base-resolve-getter' );\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 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\tgetters.push( resolveGetter( v ) );\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\tgetters.push( resolveGetter( v ) );\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\tgetters.push( resolveGetter( v ) );\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 //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AAS,CAAEJ,CAAI,EACfE,EAAU,CAAC,EACLQ,EAAI,EAAGA,EAAIL,EAAOK,IACvBN,EAAO,KAAM,IAAK,EAClBF,EAAQ,KAAM,CAAE,EAEjB,IAAMQ,EAAI,EAAGA,EAAIH,EAAKG,IAAM,CAC3B,IAAMC,EAAI,EAAGA,EAAIN,EAAM,EAAGM,IACzBP,EAAQO,EAAE,CAAE,EAAIR,EAASQ,CAAE,EAAGL,EAAMK,CAAE,EAAGT,EAASS,CAAE,CAAE,EACtDT,EAASS,CAAE,GAAKV,EAASU,CAAE,EAE5Bb,EAAQD,EAAO,MAAO,KAAMO,CAAO,CAAE,CACtC,CACD,CAKAX,EAAO,QAAUM,IC1EjB,IAAIa,EAAO,IAKX,OAAO,QAAUA",
|
|
6
|
+
"names": ["require_main", "__commonJSMin", "exports", "module", "isString", "isCollection", "resolveGetter", "format", "logger", "logEach", "str", "strides", "offsets", "getters", "values", "nargs", "args", "len", "v", "s", "i", "j", "main"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
package/lib/main.js
CHANGED
|
@@ -22,7 +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
|
|
25
|
+
var resolveGetter = require( '@stdlib/array-base-resolve-getter' );
|
|
26
26
|
var format = require( '@stdlib/string-format' );
|
|
27
27
|
var logger = require( '@stdlib/console-log' );
|
|
28
28
|
|
|
@@ -48,7 +48,6 @@ function logEach( str ) {
|
|
|
48
48
|
var len;
|
|
49
49
|
var v;
|
|
50
50
|
var s;
|
|
51
|
-
var o;
|
|
52
51
|
var i;
|
|
53
52
|
var j;
|
|
54
53
|
if ( !isString( str ) ) {
|
|
@@ -61,8 +60,7 @@ function logEach( str ) {
|
|
|
61
60
|
for ( i = 1; i < nargs; i++ ) {
|
|
62
61
|
v = arguments[ i ];
|
|
63
62
|
if ( isCollection( v ) ) {
|
|
64
|
-
|
|
65
|
-
getters.push( o.accessors[ 0 ] );
|
|
63
|
+
getters.push( resolveGetter( v ) );
|
|
66
64
|
args.push( v );
|
|
67
65
|
strides.push( 1 );
|
|
68
66
|
len = v.length;
|
|
@@ -70,8 +68,7 @@ function logEach( str ) {
|
|
|
70
68
|
break;
|
|
71
69
|
} else {
|
|
72
70
|
v = [ v ];
|
|
73
|
-
|
|
74
|
-
getters.push( o.accessors[ 0 ] );
|
|
71
|
+
getters.push( resolveGetter( v ) );
|
|
75
72
|
args.push( v );
|
|
76
73
|
strides.push( 0 );
|
|
77
74
|
}
|
|
@@ -90,8 +87,7 @@ function logEach( str ) {
|
|
|
90
87
|
v = [ v ];
|
|
91
88
|
s = 0;
|
|
92
89
|
}
|
|
93
|
-
|
|
94
|
-
getters.push( o.accessors[ 0 ] );
|
|
90
|
+
getters.push( resolveGetter( v ) );
|
|
95
91
|
args.push( v );
|
|
96
92
|
strides.push( s );
|
|
97
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/console-log-each",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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,27 +37,28 @@
|
|
|
37
37
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@stdlib/array-base-
|
|
41
|
-
"@stdlib/assert-is-collection": "^0.
|
|
42
|
-
"@stdlib/assert-is-string": "^0.
|
|
43
|
-
"@stdlib/console-log": "^0.
|
|
44
|
-
"@stdlib/string-format": "^0.
|
|
45
|
-
"@stdlib/error-tools-fmtprodmsg": "^0.
|
|
40
|
+
"@stdlib/array-base-resolve-getter": "^0.2.0",
|
|
41
|
+
"@stdlib/assert-is-collection": "^0.2.0",
|
|
42
|
+
"@stdlib/assert-is-string": "^0.2.0",
|
|
43
|
+
"@stdlib/console-log": "^0.2.0",
|
|
44
|
+
"@stdlib/string-format": "^0.2.0",
|
|
45
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.2.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@stdlib/array-complex128": "^0.1.0",
|
|
49
|
-
"@stdlib/array-filled-by": "^0.0
|
|
49
|
+
"@stdlib/array-filled-by": "^0.1.0",
|
|
50
50
|
"@stdlib/array-zeros": "^0.1.0",
|
|
51
|
-
"@stdlib/
|
|
52
|
-
"@stdlib/math-base-special-
|
|
53
|
-
"@stdlib/
|
|
54
|
-
"@stdlib/
|
|
55
|
-
"@stdlib/utils-
|
|
56
|
-
"@stdlib/utils-nary-function": "^0.1.0",
|
|
51
|
+
"@stdlib/math-base-special-abs": "^0.2.0",
|
|
52
|
+
"@stdlib/math-base-special-pow": "^0.2.0",
|
|
53
|
+
"@stdlib/random-base-discrete-uniform": "^0.1.0",
|
|
54
|
+
"@stdlib/utils-map": "^0.1.0",
|
|
55
|
+
"@stdlib/utils-nary-function": "^0.2.0",
|
|
57
56
|
"proxyquire": "^2.0.0",
|
|
58
57
|
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
59
58
|
"istanbul": "^0.4.1",
|
|
60
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
|
|
59
|
+
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",
|
|
60
|
+
"@stdlib/bench-harness": "^0.2.0",
|
|
61
|
+
"@stdlib/bench": "^0.3.1"
|
|
61
62
|
},
|
|
62
63
|
"engines": {
|
|
63
64
|
"node": ">=0.10.0",
|
package/CITATION.cff
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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
|