diff --git a/array/base/cartesian-power/coverage.ndjson b/array/base/cartesian-power/coverage.ndjson index f16365ce9b..530c0349d8 100644 --- a/array/base/cartesian-power/coverage.ndjson +++ b/array/base/cartesian-power/coverage.ndjson @@ -1 +1,2 @@ [139,139,100,12,12,100,1,1,100,139,139,100,"e21bcc8ee95d7211b3f8699e8bc1552c7cfed961","2023-08-24 13:14:54 -0700"] +[144,144,100,12,12,100,1,1,100,144,144,100,"24736d2f857ec3ab94b035a2dca2d602bb9c08c9","2024-01-26 22:45:32 -0800"] diff --git a/array/base/cartesian-power/index.html b/array/base/cartesian-power/index.html index 749a5d7747..def06468e2 100644 --- a/array/base/cartesian-power/index.html +++ b/array/base/cartesian-power/index.html @@ -25,7 +25,7 @@

All files array/base/cartesian-power/li
100% Statements - 139/139 + 144/144
@@ -46,7 +46,7 @@

All files array/base/cartesian-power/li
100% Lines - 139/139 + 144/144
@@ -99,13 +99,13 @@

All files array/base/cartesian-power/li
100% - 97/97 + 102/102 100% 11/11 100% 1/1 100% - 97/97 + 102/102 @@ -116,7 +116,7 @@

All files array/base/cartesian-power/li + + + + + + \ No newline at end of file diff --git a/array/cartesian-power/index.js.html b/array/cartesian-power/index.js.html new file mode 100644 index 0000000000..8891d4a416 --- /dev/null +++ b/array/cartesian-power/index.js.html @@ -0,0 +1,211 @@ + + + + + + Code coverage report for array/cartesian-power/lib/index.js + + + + + + + + + +
+
+

All files / array/cartesian-power/lib index.js

+
+ +
+ 100% + Statements + 42/42 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 42/42 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +431x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+ 
+'use strict';
+ 
+/**
+* Return the Cartesian power.
+*
+* @module @stdlib/array/cartesian-power
+*
+* @example
+* var cartesianPower = require( '@stdlib/array/cartesian-power' );
+*
+* var x = [ 1, 2 ];
+*
+* var out = cartesianPower( x, 2 );
+* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]
+*/
+ 
+// MAIN //
+ 
+var main = require( './main.js' );
+ 
+ 
+// EXPORTS //
+ 
+module.exports = main;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/array/cartesian-power/main.js.html b/array/cartesian-power/main.js.html new file mode 100644 index 0000000000..f9fdee9a8b --- /dev/null +++ b/array/cartesian-power/main.js.html @@ -0,0 +1,262 @@ + + + + + + Code coverage report for array/cartesian-power/lib/main.js + + + + + + + + + +
+
+

All files / array/cartesian-power/lib main.js

+
+ +
+ 100% + Statements + 59/59 +
+ + +
+ 100% + Branches + 6/6 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 59/59 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +601x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +39x +39x +9x +9x +39x +11x +11x +19x +39x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2024 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+ 
+'use strict';
+ 
+// MODULES //
+ 
+var isCollection = require( '@stdlib/assert/is-collection' );
+var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
+var base = require( '@stdlib/array/base/cartesian-power' );
+var format = require( '@stdlib/string/format' );
+ 
+ 
+// MAIN //
+ 
+/**
+* Returns the Cartesian power.
+*
+* @param {Collection} x - input array
+* @param {NonNegativeInteger} n - power
+* @throws {TypeError} first argument must be a collection
+* @throws {TypeError} second argument must be a nonnegative integer
+* @returns {Array<Array>} list of ordered tuples comprising the Cartesian product
+*
+* @example
+* var x = [ 1, 2 ];
+*
+* var out = cartesianPower( x, 2 );
+* // returns [ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ] ]
+*/
+function cartesianPower( x, n ) {
+	if ( !isCollection( x ) ) {
+		throw new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', x ) );
+	}
+	if ( !isNonNegativeInteger( n ) ) {
+		throw new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', n ) );
+	}
+	return base( x, n );
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = cartesianPower;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/array/coverage.ndjson b/array/coverage.ndjson index 3ffcc597f9..110a51e96c 100644 --- a/array/coverage.ndjson +++ b/array/coverage.ndjson @@ -12,3 +12,4 @@ [757,757,100,1,1,100,0,0,100,757,757,100,"322d1cac1bb150c548b5ad3b3086acd8e74a7bbd","2024-01-25 21:44:55 -0500"] [766,766,100,1,1,100,0,0,100,766,766,100,"8f7bed2a3081b387c37f7c848e86b521caecdc5a","2024-01-26 16:37:27 -0800"] [775,775,100,1,1,100,0,0,100,775,775,100,"87ac458d1542b6e91aee23786e50bce6d3e780be","2024-01-26 22:20:13 -0800"] +[784,784,100,1,1,100,0,0,100,784,784,100,"24736d2f857ec3ab94b035a2dca2d602bb9c08c9","2024-01-26 22:45:32 -0800"] diff --git a/array/index.html b/array/index.html index f8114fe0e1..daddf9db96 100644 --- a/array/index.html +++ b/array/index.html @@ -25,7 +25,7 @@

All files array/lib

100% Statements - 775/775 + 784/784
@@ -46,7 +46,7 @@

All files array/lib

100% Lines - 775/775 + 784/784
@@ -84,13 +84,13 @@

All files array/lib

100% - 775/775 + 784/784 100% 1/1 100% 0/0 100% - 775/775 + 784/784 @@ -101,7 +101,7 @@

All files array/lib