Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@stdlib/array-base-filled2d

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/array-base-filled2d - npm Package Compare versions

Comparing version
0.0.1
to
0.1.0
CITATION.cff

Sorry, the diff of this file is not supported yet

+3
/// <reference path="../docs/types/index.d.ts" />
import filled2d from '../docs/types/index';
export = filled2d;
"use strict";var f=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var v=f(function(d,s){
var l=require('@stdlib/array-base-filled/dist');function n(e,r){var i,a,u,t;for(a=r[1],u=r[0],i=[],t=0;t<u;t++)i.push(l(e,a));return i}s.exports=n
});var o=v();module.exports=o;
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map
{
"version": 3,
"sources": ["../lib/main.js", "../lib/index.js"],
"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 filled = require( '@stdlib/array-base-filled' );\n\n\n// MAIN //\n\n/**\n* Returns a filled two-dimensional nested array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = filled2d( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var out = filled2d( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\nfunction filled2d( value, shape ) {\n\tvar arr;\n\tvar S0;\n\tvar S1;\n\tvar i;\n\n\tS0 = shape[ 1 ];\n\tS1 = shape[ 0 ];\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < S1; i++ ) {\n\t\tarr.push( filled( value, S0 ) );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled2d;\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* Create a filled two-dimensional nested array.\n*\n* @module @stdlib/array-base-filled2d\n*\n* @example\n* var filled2d = require( '@stdlib/array-base-filled2d' );\n*\n* var out = filled2d( 0.0, [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*\n* @example\n* var filled2d = require( '@stdlib/array-base-filled2d' );\n*\n* var out = filled2d( 'beep', [ 3, 1 ] );\n* // returns [ [ 'beep' ], [ 'beep' ], [ 'beep' ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAS,QAAS,2BAA4B,EAoBlD,SAASC,EAAUC,EAAOC,EAAQ,CACjC,IAAIC,EACAC,EACAC,EACAC,EAOJ,IALAF,EAAKF,EAAO,CAAE,EACdG,EAAKH,EAAO,CAAE,EAGdC,EAAM,CAAC,EACDG,EAAI,EAAGA,EAAID,EAAIC,IACpBH,EAAI,KAAMJ,EAAQE,EAAOG,CAAG,CAAE,EAE/B,OAAOD,CACR,CAKAL,EAAO,QAAUE,ICtBjB,IAAIO,EAAO,IAKX,OAAO,QAAUA",
"names": ["require_main", "__commonJSMin", "exports", "module", "filled", "filled2d", "value", "shape", "arr", "S0", "S1", "i", "main"]
}
+8
-2

@@ -23,5 +23,11 @@ /*

import { Collection } from '@stdlib/types/object';
import { Collection } from '@stdlib/types/array';
import { Shape2D } from '@stdlib/types/ndarray';
/**
* Two-dimensional nested array.
*/
type Array2D<T> = Array<Array<T>>;
/**
* Returns a filled two-dimensional nested array.

@@ -41,3 +47,3 @@ *

*/
declare function filled2d<T = unknown>( value: T, shape: Collection<number> ): Array<Array<T>>;
declare function filled2d<T = unknown>( value: T, shape: Shape2D ): Array2D<T>;

@@ -44,0 +50,0 @@

+1
-1

@@ -33,3 +33,3 @@ /**

* @param {NonNegativeIntegerArray} shape - array shape
* @returns {ArrayArray} filled array
* @returns {Array} filled array
*

@@ -36,0 +36,0 @@ * @example

{
"name": "@stdlib/array-base-filled2d",
"version": "0.0.1",
"version": "0.1.0",
"description": "Create a filled two-dimensional nested array.",

@@ -40,11 +40,11 @@ "license": "Apache-2.0",

"dependencies": {
"@stdlib/array-base-filled": "^0.0.2",
"@stdlib/types": "^0.0.14"
"@stdlib/array-base-filled": "^0.1.0",
"@stdlib/types": "^0.1.0"
},
"devDependencies": {
"@stdlib/assert-is-array-array": "^0.0.7",
"@stdlib/bench": "^0.0.12",
"@stdlib/math-base-special-floor": "^0.0.8",
"@stdlib/math-base-special-pow": "^0.0.7",
"@stdlib/math-base-special-sqrt": "^0.0.8",
"@stdlib/assert-is-array-array": "^0.1.0",
"@stdlib/bench": "^0.1.0",
"@stdlib/math-base-special-floor": "^0.1.0",
"@stdlib/math-base-special-pow": "^0.1.0",
"@stdlib/math-base-special-sqrt": "^0.1.0",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",

@@ -51,0 +51,0 @@ "istanbul": "^0.4.1",

@@ -21,2 +21,13 @@ <!--

<details>
<summary>
About stdlib...
</summary>
<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>
<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>
<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>
<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>
</details>
# filled2d

@@ -163,4 +174,4 @@

[test-image]: https://github.com/stdlib-js/array-base-filled2d/actions/workflows/test.yml/badge.svg?branch=v0.0.1
[test-url]: https://github.com/stdlib-js/array-base-filled2d/actions/workflows/test.yml?query=branch:v0.0.1
[test-image]: https://github.com/stdlib-js/array-base-filled2d/actions/workflows/test.yml/badge.svg?branch=v0.1.0
[test-url]: https://github.com/stdlib-js/array-base-filled2d/actions/workflows/test.yml?query=branch:v0.1.0

@@ -167,0 +178,0 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-filled2d/main.svg