Skip to content

Commit c34a18c

Browse files
committed
Update artifacts
1 parent 42e4cf7 commit c34a18c

File tree

4 files changed

+86
-32
lines changed

4 files changed

+86
-32
lines changed

ndarray/pop/coverage.ndjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[138,138,100,7,7,100,1,1,100,138,138,100,"991888e902762f63479c8fd759182308f76ea6b4","2025-09-26 20:04:39 +0500"]
1+
[156,156,100,11,11,100,1,1,100,156,156,100,"9b0d519e8020f1bf2d693ffdf5dda6c0e3d5db11","2025-09-26 21:08:04 +0500"]

ndarray/pop/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ <h1><a href="../../../index.html">All files</a> ndarray/pop/lib</h1>
2525
<div class='fl pad1y space-right2'>
2626
<span class="strong">100% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>138/138</span>
28+
<span class='fraction'>156/156</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
3333
<span class="strong">100% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>7/7</span>
35+
<span class='fraction'>11/11</span>
3636
</div>
3737

3838

@@ -46,7 +46,7 @@ <h1><a href="../../../index.html">All files</a> ndarray/pop/lib</h1>
4646
<div class='fl pad1y space-right2'>
4747
<span class="strong">100% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>138/138</span>
49+
<span class='fraction'>156/156</span>
5050
</div>
5151

5252

@@ -99,13 +99,13 @@ <h1><a href="../../../index.html">All files</a> ndarray/pop/lib</h1>
9999
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
100100
</td>
101101
<td data-value="100" class="pct high">100%</td>
102-
<td data-value="79" class="abs high">79/79</td>
102+
<td data-value="97" class="abs high">97/97</td>
103103
<td data-value="100" class="pct high">100%</td>
104-
<td data-value="6" class="abs high">6/6</td>
104+
<td data-value="10" class="abs high">10/10</td>
105105
<td data-value="100" class="pct high">100%</td>
106106
<td data-value="1" class="abs high">1/1</td>
107107
<td data-value="100" class="pct high">100%</td>
108-
<td data-value="79" class="abs high">79/79</td>
108+
<td data-value="97" class="abs high">97/97</td>
109109
</tr>
110110

111111
</tbody>
@@ -116,7 +116,7 @@ <h1><a href="../../../index.html">All files</a> ndarray/pop/lib</h1>
116116
<div class='footer quiet pad2 space-top1 center small'>
117117
Code coverage generated by
118118
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119-
at 2025-09-26T15:08:09.654Z
119+
at 2025-09-26T16:10:19.389Z
120120
</div>
121121
<script src="../../../prettify.js"></script>
122122
<script>

ndarray/pop/index.js.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
222222
* var arr = ndarray2array( x );
223223
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
224224
*
225-
* var y = pop( x, 0 );
225+
* var y = pop( x );
226226
* // returns [ &lt;ndarray&gt;, &lt;ndarray&gt; ]
227227
*
228228
* arr = ndarray2array( y[ 0 ] );
229-
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
229+
* // returns [ [ 1 ], [ 3 ], [ 5 ] ]
230230
*
231231
* arr = ndarray2array( y[ 1 ] );
232-
* // returns [ [ 5.0, 6.0 ] ]
232+
* // returns [ [ 2 ], [ 4 ], [ 6 ] ]
233233
*/
234234
&nbsp;
235235
// MODULES //
@@ -247,7 +247,7 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
247247
<div class='footer quiet pad2 space-top1 center small'>
248248
Code coverage generated by
249249
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
250-
at 2025-09-26T15:08:09.654Z
250+
at 2025-09-26T16:10:19.389Z
251251
</div>
252252
<script src="../../../prettify.js"></script>
253253
<script>

ndarray/pop/main.js.html

Lines changed: 74 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
2525
<div class='fl pad1y space-right2'>
2626
<span class="strong">100% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>79/79</span>
28+
<span class='fraction'>97/97</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
3333
<span class="strong">100% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>6/6</span>
35+
<span class='fraction'>10/10</span>
3636
</div>
3737

3838

@@ -46,7 +46,7 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
4646
<div class='fl pad1y space-right2'>
4747
<span class="strong">100% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>79/79</span>
49+
<span class='fraction'>97/97</span>
5050
</div>
5151

5252

@@ -142,7 +142,25 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
142142
<a name='L77'></a><a href='#L77'>77</a>
143143
<a name='L78'></a><a href='#L78'>78</a>
144144
<a name='L79'></a><a href='#L79'>79</a>
145-
<a name='L80'></a><a href='#L80'>80</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
145+
<a name='L80'></a><a href='#L80'>80</a>
146+
<a name='L81'></a><a href='#L81'>81</a>
147+
<a name='L82'></a><a href='#L82'>82</a>
148+
<a name='L83'></a><a href='#L83'>83</a>
149+
<a name='L84'></a><a href='#L84'>84</a>
150+
<a name='L85'></a><a href='#L85'>85</a>
151+
<a name='L86'></a><a href='#L86'>86</a>
152+
<a name='L87'></a><a href='#L87'>87</a>
153+
<a name='L88'></a><a href='#L88'>88</a>
154+
<a name='L89'></a><a href='#L89'>89</a>
155+
<a name='L90'></a><a href='#L90'>90</a>
156+
<a name='L91'></a><a href='#L91'>91</a>
157+
<a name='L92'></a><a href='#L92'>92</a>
158+
<a name='L93'></a><a href='#L93'>93</a>
159+
<a name='L94'></a><a href='#L94'>94</a>
160+
<a name='L95'></a><a href='#L95'>95</a>
161+
<a name='L96'></a><a href='#L96'>96</a>
162+
<a name='L97'></a><a href='#L97'>97</a>
163+
<a name='L98'></a><a href='#L98'>98</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
146164
<span class="cline-any cline-yes">1x</span>
147165
<span class="cline-any cline-yes">1x</span>
148166
<span class="cline-any cline-yes">1x</span>
@@ -207,15 +225,33 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
207225
<span class="cline-any cline-yes">1x</span>
208226
<span class="cline-any cline-yes">1x</span>
209227
<span class="cline-any cline-yes">1x</span>
210-
<span class="cline-any cline-yes">38x</span>
211-
<span class="cline-any cline-yes">38x</span>
212-
<span class="cline-any cline-yes">10x</span>
213-
<span class="cline-any cline-yes">10x</span>
214-
<span class="cline-any cline-yes">38x</span>
228+
<span class="cline-any cline-yes">1x</span>
229+
<span class="cline-any cline-yes">1x</span>
230+
<span class="cline-any cline-yes">1x</span>
231+
<span class="cline-any cline-yes">56x</span>
232+
<span class="cline-any cline-yes">56x</span>
233+
<span class="cline-any cline-yes">56x</span>
234+
<span class="cline-any cline-yes">56x</span>
235+
<span class="cline-any cline-yes">56x</span>
236+
<span class="cline-any cline-yes">56x</span>
237+
<span class="cline-any cline-yes">56x</span>
238+
<span class="cline-any cline-yes">56x</span>
239+
<span class="cline-any cline-yes">20x</span>
240+
<span class="cline-any cline-yes">20x</span>
241+
<span class="cline-any cline-yes">56x</span>
242+
<span class="cline-any cline-yes">32x</span>
243+
<span class="cline-any cline-yes">32x</span>
244+
<span class="cline-any cline-yes">9x</span>
245+
<span class="cline-any cline-yes">9x</span>
246+
<span class="cline-any cline-yes">23x</span>
247+
<span class="cline-any cline-yes">23x</span>
215248
<span class="cline-any cline-yes">10x</span>
216249
<span class="cline-any cline-yes">10x</span>
217-
<span class="cline-any cline-yes">18x</span>
218-
<span class="cline-any cline-yes">38x</span>
250+
<span class="cline-any cline-yes">13x</span>
251+
<span class="cline-any cline-yes">13x</span>
252+
<span class="cline-any cline-yes">32x</span>
253+
<span class="cline-any cline-yes">17x</span>
254+
<span class="cline-any cline-yes">56x</span>
219255
<span class="cline-any cline-yes">1x</span>
220256
<span class="cline-any cline-yes">1x</span>
221257
<span class="cline-any cline-yes">1x</span>
@@ -243,6 +279,8 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
243279
&nbsp;
244280
// MODULES //
245281
&nbsp;
282+
var isPlainObject = require( '@stdlib/assert/is-plain-object' );
283+
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
246284
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
247285
var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
248286
var base = require( '@stdlib/ndarray/base/pop' );
@@ -255,7 +293,8 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
255293
* Returns an array containing a read-only truncated view of an input ndarray and a read-only view of the last element(s) along a specified dimension.
256294
*
257295
* @param {ndarray} x - input array
258-
* @param {integer} dim - dimension along which to perform the operation
296+
* @param {Object} options - functions options
297+
* @param {integer} options.dim=-1 - dimension along which to perform the operation
259298
* @throws {TypeError} first argument must be an ndarray having one or more dimensions
260299
* @throws {RangeError} dimension index exceeds the number of dimensions
261300
* @throws {TypeError} first argument must be an ndarray having one or more dimensions
@@ -277,23 +316,38 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
277316
* var arr = ndarray2array( x );
278317
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
279318
*
280-
* var y = pop( x, 0 );
319+
* var y = pop( x );
281320
* // returns [ &lt;ndarray&gt;, &lt;ndarray&gt; ]
282321
*
283322
* arr = ndarray2array( y[ 0 ] );
284-
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
323+
* // returns [ [ 1.0 ], [ 3.0 ], [ 5.0 ] ]
285324
*
286325
* arr = ndarray2array( y[ 1 ] );
287-
* // returns [ [ 5.0, 6.0 ] ]
326+
* // returns [ [ 2.0 ], [ 4.0 ], [ 6.0 ] ]
288327
*/
289-
function pop( x, dim ) {
328+
function pop( x ) {
329+
var options;
330+
var opts;
331+
&nbsp;
332+
opts = {
333+
'dim': -1
334+
};
290335
if ( !isndarrayLike( x ) ) {
291336
throw new TypeError( format( 'invalid argument. First argument must be an ndarray. Value: `%s`.', x ) );
292337
}
293-
if ( !isInteger( dim ) ) {
294-
throw new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', dim ) );
338+
if ( arguments.length &gt; 1 ) {
339+
options = arguments[ 1 ];
340+
if ( !isPlainObject( options ) ) {
341+
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
342+
}
343+
if ( hasOwnProp( options, 'dim' ) ) {
344+
if ( !isInteger( options.dim ) ) {
345+
throw new TypeError( format( 'invalid option. `%s` option must be an integer. Option: `%s`.', 'dim', options.dim ) );
346+
}
347+
opts.dim = options.dim;
348+
}
295349
}
296-
return base( x, dim, false );
350+
return base( x, opts.dim, false );
297351
}
298352
&nbsp;
299353
&nbsp;
@@ -307,7 +361,7 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">ndarray/p
307361
<div class='footer quiet pad2 space-top1 center small'>
308362
Code coverage generated by
309363
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
310-
at 2025-09-26T15:08:09.654Z
364+
at 2025-09-26T16:10:19.389Z
311365
</div>
312366
<script src="../../../prettify.js"></script>
313367
<script>

0 commit comments

Comments
 (0)