@stdlib/array-base-last 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -96,8 +96,6 @@ var out = last( x );
96
96
 
97
97
  ```javascript
98
98
  var Complex64Array = require( '@stdlib/array-complex64' );
99
- var realf = require( '@stdlib/complex-realf' );
100
- var imagf = require( '@stdlib/complex-imagf' );
101
99
  var last = require( '@stdlib/array-base-last' );
102
100
 
103
101
  // Create a complex number array:
@@ -105,15 +103,9 @@ var arr = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
105
103
 
106
104
  // Return the last element:
107
105
  var out = last( arr );
108
- // returns <Complex64>
106
+ // returns <Complex64>[ 5.0, 6.0 ]
109
107
 
110
- var re = realf( out );
111
- // returns 5.0
112
-
113
- var im = imagf( out );
114
- // returns 6.0
115
-
116
- console.log( '%d + %di', re, im );
108
+ console.log( out.toString() );
117
109
  // => '5 + 6i'
118
110
  ```
119
111
 
@@ -163,7 +155,7 @@ See [LICENSE][stdlib-license].
163
155
 
164
156
  ## Copyright
165
157
 
166
- Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
158
+ Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].
167
159
 
168
160
  </section>
169
161
 
@@ -176,8 +168,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
176
168
  [npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-last.svg
177
169
  [npm-url]: https://npmjs.org/package/@stdlib/array-base-last
178
170
 
179
- [test-image]: https://github.com/stdlib-js/array-base-last/actions/workflows/test.yml/badge.svg?branch=v0.2.1
180
- [test-url]: https://github.com/stdlib-js/array-base-last/actions/workflows/test.yml?query=branch:v0.2.1
171
+ [test-image]: https://github.com/stdlib-js/array-base-last/actions/workflows/test.yml/badge.svg?branch=v0.2.3
172
+ [test-url]: https://github.com/stdlib-js/array-base-last/actions/workflows/test.yml?query=branch:v0.2.3
181
173
 
182
174
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-last/main.svg
183
175
  [coverage-url]: https://codecov.io/github/stdlib-js/array-base-last?branch=main
@@ -189,8 +181,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
189
181
 
190
182
  -->
191
183
 
192
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
193
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
184
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
185
+ [chat-url]: https://stdlib.zulipchat.com
194
186
 
195
187
  [stdlib]: https://github.com/stdlib-js/stdlib
196
188
 
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../lib/main.js", "../lib/index.js"],
4
- "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 resolveGetter = require( '@stdlib/array-base-resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Returns the last element of an array-like object.\n*\n* @param {Collection} arr - input array\n* @returns {*} - last element\n*\n* @example\n* var out = last( [ 1, 2, 3 ] );\n* // returns 3\n*/\nfunction last( arr ) {\n\tvar get;\n\tvar idx;\n\n\t// Resolve an accessor for retrieving input array elements:\n\tget = resolveGetter( arr );\n\n\t// Resolve the last index:\n\tidx = arr.length - 1;\n\n\t// Return the last element:\n\tif ( idx < 0 ) {\n\t\treturn;\n\t}\n\treturn get( arr, idx );\n}\n\n\n// EXPORTS //\n\nmodule.exports = last;\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* Return the last element of an array-like object.\n*\n* @module @stdlib/array-base-last\n*\n* @example\n* var last = require( '@stdlib/array-base-last' );\n*\n* var out = last( [ 1, 2, 3 ] );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
4
+ "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 resolveGetter = require( '@stdlib/array-base-resolve-getter' );\n\n\n// MAIN //\n\n/**\n* Returns the last element of an array-like object.\n*\n* @param {Collection} arr - input array\n* @returns {*} last element\n*\n* @example\n* var out = last( [ 1, 2, 3 ] );\n* // returns 3\n*/\nfunction last( arr ) {\n\tvar get;\n\tvar idx;\n\n\t// Resolve an accessor for retrieving input array elements:\n\tget = resolveGetter( arr );\n\n\t// Resolve the last index:\n\tidx = arr.length - 1;\n\n\t// Return the last element:\n\tif ( idx < 0 ) {\n\t\treturn;\n\t}\n\treturn get( arr, idx );\n}\n\n\n// EXPORTS //\n\nmodule.exports = last;\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* Return the last element of an array-like object.\n*\n* @module @stdlib/array-base-last\n*\n* @example\n* var last = require( '@stdlib/array-base-last' );\n*\n* var out = last( [ 1, 2, 3 ] );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
5
  "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,mCAAoC,EAejE,SAASC,EAAMC,EAAM,CACpB,IAAIC,EACAC,EASJ,GANAD,EAAMH,EAAeE,CAAI,EAGzBE,EAAMF,EAAI,OAAS,EAGd,EAAAE,EAAM,GAGX,OAAOD,EAAKD,EAAKE,CAAI,CACtB,CAKAL,EAAO,QAAUE,ICvBjB,IAAII,EAAO,IAKX,OAAO,QAAUA",
6
6
  "names": ["require_main", "__commonJSMin", "exports", "module", "resolveGetter", "last", "arr", "get", "idx", "main"]
7
7
  }
@@ -31,7 +31,7 @@ import { Collection } from '@stdlib/types/array';
31
31
  * @example
32
32
  * var arr = [ 1, 2, 3 ];
33
33
  *
34
- * var out = last( x );
34
+ * var out = last( arr );
35
35
  * // returns 3
36
36
  */
37
37
  declare function last<T = unknown>( arr: Collection<T> ): T;
package/lib/main.js CHANGED
@@ -29,7 +29,7 @@ var resolveGetter = require( '@stdlib/array-base-resolve-getter' );
29
29
  * Returns the last element of an array-like object.
30
30
  *
31
31
  * @param {Collection} arr - input array
32
- * @returns {*} - last element
32
+ * @returns {*} last element
33
33
  *
34
34
  * @example
35
35
  * var out = last( [ 1, 2, 3 ] );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/array-base-last",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Return the last element of an array-like object.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -30,7 +30,7 @@
30
30
  "url": "https://github.com/stdlib-js/stdlib/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@stdlib/array-base-resolve-getter": "^0.2.0"
33
+ "@stdlib/array-base-resolve-getter": "^0.2.2"
34
34
  },
35
35
  "devDependencies": {},
36
36
  "engines": {