Skip to content

Commit 1592fe5

Browse files
committed
Auto-generated commit
1 parent 90b3c27 commit 1592fe5

File tree

2 files changed

+47
-43
lines changed

2 files changed

+47
-43
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ A total of 37 issues were closed in this release:
675675

676676
<details>
677677

678+
- [`c380fdd`](https://github.com/stdlib-js/stdlib/commit/c380fdd083d276c4e7eea1c2e0b664abad95e7b9) - **refactor:** move functions to module scope _(by Athan Reines)_
678679
- [`0aeccc2`](https://github.com/stdlib-js/stdlib/commit/0aeccc26acf8805e65efec785132deec907dd073) - **refactor:** rename variable _(by Athan Reines)_
679680
- [`d0514f7`](https://github.com/stdlib-js/stdlib/commit/d0514f706cd96237b73f6b6cc02539534e5b0a00) - **refactor:** use assertion utility _(by Athan Reines)_
680681
- [`cc057c6`](https://github.com/stdlib-js/stdlib/commit/cc057c682563ebf77e7c1b7c7a9168a57fb091e3) - **refactor:** use assertion utility _(by Athan Reines)_

base/zip2views1d/lib/main.js

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,51 @@ var ndarraylike2ndarray = require( './../../../base/ndarraylike2ndarray' );
2727
var numel = require( './../../../numel' );
2828

2929

30+
// FUNCTIONS //
31+
32+
/**
33+
* Returns an accessor for returning the value associated with a label.
34+
*
35+
* @private
36+
* @param {Collection} arr - input array
37+
* @returns {Function} accessor
38+
*/
39+
function getValue( arr ) {
40+
return get;
41+
42+
/**
43+
* Returns the value associated with a label.
44+
*
45+
* @private
46+
* @returns {*} result
47+
*/
48+
function get() {
49+
return arr.get( this._i ); // eslint-disable-line no-invalid-this
50+
}
51+
}
52+
53+
/**
54+
* Returns an accessor for setting the value associated with a label.
55+
*
56+
* @private
57+
* @param {Collection} arr - input array
58+
* @returns {Function} accessor
59+
*/
60+
function setValue( arr ) {
61+
return set;
62+
63+
/**
64+
* Sets the value associated with a label.
65+
*
66+
* @private
67+
* @param {*} value - value to set
68+
*/
69+
function set( value ) {
70+
arr.set( this._i, value ); // eslint-disable-line no-invalid-this
71+
}
72+
}
73+
74+
3075
// MAIN //
3176

3277
/**
@@ -111,7 +156,7 @@ function zip2views1d( arrays, labels ) {
111156
* @param {NonNegativeInteger} i - element index
112157
* @returns {Datum} datum instance
113158
*/
114-
function Datum( i ) {
159+
function Datum( i ) { // eslint-disable-line stdlib/no-unnecessary-nested-functions
115160
setNonEnumerableReadOnly( this, '_i', i );
116161
return this;
117162
}
@@ -132,48 +177,6 @@ function zip2views1d( arrays, labels ) {
132177
}
133178
return out;
134179

135-
/**
136-
* Returns an accessor for returning the value associated with a label.
137-
*
138-
* @private
139-
* @param {Collection} arr - input array
140-
* @returns {Function} accessor
141-
*/
142-
function getValue( arr ) {
143-
return get;
144-
145-
/**
146-
* Returns the value associated with a label.
147-
*
148-
* @private
149-
* @returns {*} result
150-
*/
151-
function get() {
152-
return arr.get( this._i ); // eslint-disable-line no-invalid-this
153-
}
154-
}
155-
156-
/**
157-
* Returns an accessor for setting the value associated with a label.
158-
*
159-
* @private
160-
* @param {Collection} arr - input array
161-
* @returns {Function} accessor
162-
*/
163-
function setValue( arr ) {
164-
return set;
165-
166-
/**
167-
* Sets the value associated with a label.
168-
*
169-
* @private
170-
* @param {*} value - value to set
171-
*/
172-
function set( value ) {
173-
arr.set( this._i, value ); // eslint-disable-line no-invalid-this
174-
}
175-
}
176-
177180
/**
178181
* Serializes a datum to JSON.
179182
*

0 commit comments

Comments
 (0)