From 0866260c3786523acae35aa25de5279b6b9b4df0 Mon Sep 17 00:00:00 2001 From: Aryan Kumar Date: Fri, 28 Aug 2026 18:44:41 -0700 Subject: [PATCH 1/3] chore: fix JavaScript lint errors (issue #14759) --- .../@stdlib/array/base/zip2views/lib/main.js | 126 ++++++++++-------- 1 file changed, 68 insertions(+), 58 deletions(-) diff --git a/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js b/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js index e78b5782b69a..b3a9fc65585c 100644 --- a/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js +++ b/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js @@ -26,6 +26,71 @@ var accessors = require( '@stdlib/array/base/accessors' ); var copy = require( '@stdlib/array/base/copy' ); +// FUNCTIONS // + +/** +* Returns an accessor for returning the value associated with a label. +* +* @private +* @param {Collection} arr - input array +* @param {Function} getter - array element accessor +* @returns {Function} accessor +*/ +function getValue( arr, getter ) { + return get; + + /** + * Returns the value associated with a label. + * + * @private + * @returns {*} result + */ + function get() { + return getter( arr, this._i ); // eslint-disable-line no-invalid-this + } +} + +/** +* Returns an accessor for setting the value associated with a label. +* +* @private +* @param {Collection} arr - input array +* @param {Function} setter - array element accessor +* @returns {Function} accessor +*/ +function setValue( arr, setter ) { + return set; + + /** + * Sets the value associated with a label. + * + * @private + * @param {*} value - value to set + */ + function set( value ) { + setter( arr, this._i, value ); // eslint-disable-line no-invalid-this + } +} + +// eslint-disable-next-line stdlib/jsdoc-typedef-typos +/** +* Constructor for creating a composite view of zipped elements. +* +* ## Notes +* +* - The constructor's prototype is reset at the start of each `zip2views` invocation (see below) so that views created by one invocation never inherit label accessors defined by a different invocation. +* +* @private +* @constructor +* @param {NonNegativeInteger} i - element index +* @returns {Datum} datum instance +*/ +function Datum( i ) { + setNonEnumerableReadOnly( this, '_i', i ); + return this; +} + + // MAIN // /** @@ -102,19 +167,8 @@ function zip2views( arrays, labels ) { // Create a copy of provided labels to prevent external mutation: keys = copy( labels ); - // eslint-disable-next-line stdlib/jsdoc-typedef-typos - /** - * Constructor for creating a composite view of zipped elements. - * - * @private - * @constructor - * @param {NonNegativeInteger} i - element index - * @returns {Datum} datum instance - */ - function Datum( i ) { - setNonEnumerableReadOnly( this, '_i', i ); - return this; - } + // Reset the shared constructor's prototype so that this invocation's views only ever expose this invocation's labels: + Datum.prototype = {}; // Define read/write accessors for each label... for ( i = 0; i < M; i++ ) { @@ -132,50 +186,6 @@ function zip2views( arrays, labels ) { } return out; - /** - * Returns an accessor for returning the value associated with a label. - * - * @private - * @param {Collection} arr - input array - * @param {Function} getter - array element accessor - * @returns {Function} accessor - */ - function getValue( arr, getter ) { - return get; - - /** - * Returns the value associated with a label. - * - * @private - * @returns {*} result - */ - function get() { - return getter( arr, this._i ); // eslint-disable-line no-invalid-this - } - } - - /** - * Returns an accessor for setting the value associated with a label. - * - * @private - * @param {Collection} arr - input array - * @param {Function} setter - array element accessor - * @returns {Function} accessor - */ - function setValue( arr, setter ) { - return set; - - /** - * Sets the value associated with a label. - * - * @private - * @param {*} value - value to set - */ - function set( value ) { - setter( arr, this._i, value ); // eslint-disable-line no-invalid-this - } - } - /** * Serializes a datum to JSON. * @@ -199,4 +209,4 @@ function zip2views( arrays, labels ) { // EXPORTS // -module.exports = zip2views; +module.exports = zip2views; \ No newline at end of file From ad08186ac655299e84eab2dcc380f60fafddc38b Mon Sep 17 00:00:00 2001 From: Aryan Kumar Date: Fri, 28 Aug 2026 18:55:22 -0700 Subject: [PATCH 2/3] fix: deleted blank space --- lib/node_modules/@stdlib/array/base/zip2views/lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js b/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js index b3a9fc65585c..19aa8ebb67a1 100644 --- a/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js +++ b/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js @@ -209,4 +209,4 @@ function zip2views( arrays, labels ) { // EXPORTS // -module.exports = zip2views; \ No newline at end of file +module.exports = zip2views; From 9766a710238b35a9bec69e44168d657210546277 Mon Sep 17 00:00:00 2001 From: Aryan Kumar Date: Fri, 28 Aug 2026 19:12:19 -0700 Subject: [PATCH 3/3] chore: fix JavaScript lint errors (issue #14759) --- .../@stdlib/utils/group/examples/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/utils/group/examples/index.js b/lib/node_modules/@stdlib/utils/group/examples/index.js index 073223dcaefd..3b1ecf62dcd0 100644 --- a/lib/node_modules/@stdlib/utils/group/examples/index.js +++ b/lib/node_modules/@stdlib/utils/group/examples/index.js @@ -25,6 +25,7 @@ var group = require( './../lib' ); var vals; var arr; var out; +var len; var g; var i; var j; @@ -32,16 +33,17 @@ var j; vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; // Generate a random collection... -arr = new Array( 100 ); -for ( i = 0; i < arr.length; i++ ) { +len = 100; +arr = []; +for ( i = 0; i < len; i++ ) { j = floor( randu()*vals.length ); - arr[ i ] = vals[ j ]; + arr.push( vals[ j ] ); } // Randomly assign collection values to groups... -g = new Array( arr.length ); +g = []; for ( i = 0; i < arr.length; i++ ) { - g[ i ] = floor( randu()*vals.length ); + g.push( floor( randu()*vals.length ) ); } // Compute the groups: