@stdlib/string-first 0.1.0 → 0.2.0
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 +1 -1
- package/README.md +14 -6
- package/SECURITY.md +5 -0
- package/docs/types/index.d.ts +1 -1
- package/package.json +10 -10
- package/CITATION.cff +0 -30
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ The function supports the following options:
|
|
|
72
72
|
- `'grapheme'`: grapheme clusters. Appropriate for strings containing visual characters which can span multiple Unicode code points (e.g., emoji).
|
|
73
73
|
- `'code_point'`: Unicode code points. Appropriate for strings containing visual characters which are comprised of more than one Unicode code unit (e.g., ideographic symbols and punctuation and mathematical alphanumerics).
|
|
74
74
|
- `'code_unit'`: UTF-16 code units. Appropriate for strings containing visual characters drawn from the basic multilingual plane (BMP) (e.g., common characters, such as those from the Latin, Greek, and Cyrillic alphabets).
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
Default: `'grapheme'`.
|
|
77
77
|
|
|
78
78
|
By default, the function returns the first character. To return the first `n` characters, provide a second argument specifying the number of characters to return.
|
|
@@ -101,7 +101,6 @@ out = first( 'foo bar', 10 );
|
|
|
101
101
|
|
|
102
102
|
<!-- /.notes -->
|
|
103
103
|
|
|
104
|
-
|
|
105
104
|
<section class="examples">
|
|
106
105
|
|
|
107
106
|
## Examples
|
|
@@ -146,7 +145,7 @@ str = first( '🐶🐮🐷🐰🐸', 10 );
|
|
|
146
145
|
## See Also
|
|
147
146
|
|
|
148
147
|
- <span class="package-name">[`@stdlib/string-first-cli`][@stdlib/string-first-cli]</span><span class="delimiter">: </span><span class="description">CLI package for use as a command-line utility.</span>
|
|
149
|
-
|
|
148
|
+
- <span class="package-name">[`@stdlib/string-remove-first`][@stdlib/string/remove-first]</span><span class="delimiter">: </span><span class="description">remove the first character(s) of a string.</span>
|
|
150
149
|
|
|
151
150
|
</section>
|
|
152
151
|
|
|
@@ -178,7 +177,7 @@ See [LICENSE][stdlib-license].
|
|
|
178
177
|
|
|
179
178
|
## Copyright
|
|
180
179
|
|
|
181
|
-
Copyright © 2016-
|
|
180
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
182
181
|
|
|
183
182
|
</section>
|
|
184
183
|
|
|
@@ -193,8 +192,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
193
192
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/string-first.svg
|
|
194
193
|
[npm-url]: https://npmjs.org/package/@stdlib/string-first
|
|
195
194
|
|
|
196
|
-
[test-image]: https://github.com/stdlib-js/string-first/actions/workflows/test.yml/badge.svg?branch=v0.
|
|
197
|
-
[test-url]: https://github.com/stdlib-js/string-first/actions/workflows/test.yml?query=branch:v0.
|
|
195
|
+
[test-image]: https://github.com/stdlib-js/string-first/actions/workflows/test.yml/badge.svg?branch=v0.2.0
|
|
196
|
+
[test-url]: https://github.com/stdlib-js/string-first/actions/workflows/test.yml?query=branch:v0.2.0
|
|
198
197
|
|
|
199
198
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-first/main.svg
|
|
200
199
|
[coverage-url]: https://codecov.io/github/stdlib-js/string-first?branch=main
|
|
@@ -221,8 +220,11 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
221
220
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
222
221
|
|
|
223
222
|
[deno-url]: https://github.com/stdlib-js/string-first/tree/deno
|
|
223
|
+
[deno-readme]: https://github.com/stdlib-js/string-first/blob/deno/README.md
|
|
224
224
|
[umd-url]: https://github.com/stdlib-js/string-first/tree/umd
|
|
225
|
+
[umd-readme]: https://github.com/stdlib-js/string-first/blob/umd/README.md
|
|
225
226
|
[esm-url]: https://github.com/stdlib-js/string-first/tree/esm
|
|
227
|
+
[esm-readme]: https://github.com/stdlib-js/string-first/blob/esm/README.md
|
|
226
228
|
[branches-url]: https://github.com/stdlib-js/string-first/blob/main/branches.md
|
|
227
229
|
|
|
228
230
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/string-first/main/LICENSE
|
|
@@ -231,6 +233,12 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
231
233
|
|
|
232
234
|
[mdn-regexp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
|
|
233
235
|
|
|
236
|
+
<!-- <related-links> -->
|
|
237
|
+
|
|
238
|
+
[@stdlib/string/remove-first]: https://www.npmjs.com/package/@stdlib/string-remove-first
|
|
239
|
+
|
|
240
|
+
<!-- </related-links> -->
|
|
241
|
+
|
|
234
242
|
</section>
|
|
235
243
|
|
|
236
244
|
<!-- /.links -->
|
package/SECURITY.md
ADDED
package/docs/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/string-first",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Return the first character(s) of a string.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@stdlib/array-base-assert-contains": "^0.
|
|
41
|
-
"@stdlib/assert-has-own-property": "^0.
|
|
42
|
-
"@stdlib/assert-is-nonnegative-integer": "^0.
|
|
43
|
-
"@stdlib/assert-is-plain-object": "^0.
|
|
44
|
-
"@stdlib/assert-is-string": "^0.
|
|
45
|
-
"@stdlib/string-base-first": "^0.
|
|
46
|
-
"@stdlib/string-base-first-code-point": "^0.
|
|
47
|
-
"@stdlib/string-base-first-grapheme-cluster": "^0.
|
|
48
|
-
"@stdlib/string-format": "^0.
|
|
40
|
+
"@stdlib/array-base-assert-contains": "^0.2.0",
|
|
41
|
+
"@stdlib/assert-has-own-property": "^0.2.0",
|
|
42
|
+
"@stdlib/assert-is-nonnegative-integer": "^0.2.0",
|
|
43
|
+
"@stdlib/assert-is-plain-object": "^0.2.0",
|
|
44
|
+
"@stdlib/assert-is-string": "^0.2.0",
|
|
45
|
+
"@stdlib/string-base-first": "^0.2.0",
|
|
46
|
+
"@stdlib/string-base-first-code-point": "^0.2.0",
|
|
47
|
+
"@stdlib/string-base-first-grapheme-cluster": "^0.2.0",
|
|
48
|
+
"@stdlib/string-format": "^0.2.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
package/CITATION.cff
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: stdlib
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this software, please cite it using the
|
|
5
|
-
metadata from this file.
|
|
6
|
-
|
|
7
|
-
type: software
|
|
8
|
-
|
|
9
|
-
authors:
|
|
10
|
-
- name: The Stdlib Authors
|
|
11
|
-
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
-
|
|
13
|
-
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
-
url: https://stdlib.io
|
|
15
|
-
|
|
16
|
-
abstract: |
|
|
17
|
-
Standard library for JavaScript and Node.js.
|
|
18
|
-
|
|
19
|
-
keywords:
|
|
20
|
-
- JavaScript
|
|
21
|
-
- Node.js
|
|
22
|
-
- TypeScript
|
|
23
|
-
- standard library
|
|
24
|
-
- scientific computing
|
|
25
|
-
- numerical computing
|
|
26
|
-
- statistical computing
|
|
27
|
-
|
|
28
|
-
license: Apache-2.0 AND BSL-1.0
|
|
29
|
-
|
|
30
|
-
date-released: 2016
|