Skip to content

Commit 4e883a9

Browse files
committed
Release v0.1.0
1 parent b2c20d2 commit 4e883a9

5 files changed

Lines changed: 213 additions & 63 deletions

File tree

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,8 @@ indent_size = 2
179179
[*.gypi]
180180
indent_style = space
181181
indent_size = 2
182+
183+
# Set properties for citation files:
184+
[*.{cff,cff.txt}]
185+
indent_style = space
186+
indent_size = 2

CITATION.cff

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ limitations under the License.
1818
1919
-->
2020

21+
22+
<details>
23+
<summary>
24+
About stdlib...
25+
</summary>
26+
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27+
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28+
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29+
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30+
</details>
31+
2132
# Base String
2233

2334
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -88,6 +99,9 @@ The namespace contains the following functions:
8899
- <span class="signature">[`lowercase( str )`][@stdlib/string/base/lowercase]</span><span class="delimiter">: </span><span class="description">convert a string to lowercase.</span>
89100
- <span class="signature">[`pascalcase( str )`][@stdlib/string/base/pascalcase]</span><span class="delimiter">: </span><span class="description">convert a string to Pascal case.</span>
90101
- <span class="signature">[`percentEncode( str )`][@stdlib/string/base/percent-encode]</span><span class="delimiter">: </span><span class="description">percent-encode a UTF-16 encoded string according to RFC 3986.</span>
102+
- <span class="signature">[`removeFirstCodePoint( str, n )`][@stdlib/string/base/remove-first-code-point]</span><span class="delimiter">: </span><span class="description">remove the first `n` Unicode code points of a string.</span>
103+
- <span class="signature">[`removeFirstGraphemeCluster( str, n )`][@stdlib/string/base/remove-first-grapheme-cluster]</span><span class="delimiter">: </span><span class="description">remove the first `n` grapheme clusters (i.e., user-perceived characters) of a string.</span>
104+
- <span class="signature">[`removeFirst( str, n )`][@stdlib/string/base/remove-first]</span><span class="delimiter">: </span><span class="description">remove the first `n` UTF-16 code units of a string.</span>
91105
- <span class="signature">[`repeat( str, n )`][@stdlib/string/base/repeat]</span><span class="delimiter">: </span><span class="description">repeat a string a specified number of times and return the concatenated result.</span>
92106
- <span class="signature">[`replaceBefore( str, search, replacement )`][@stdlib/string/base/replace-before]</span><span class="delimiter">: </span><span class="description">replace the substring before the first occurrence of a specified search string.</span>
93107
- <span class="signature">[`replace( str, search, newval )`][@stdlib/string/base/replace]</span><span class="delimiter">: </span><span class="description">replace search occurrences with a replacement string.</span>
@@ -206,8 +220,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
206220
[npm-image]: http://img.shields.io/npm/v/@stdlib/string-base.svg
207221
[npm-url]: https://npmjs.org/package/@stdlib/string-base
208222

209-
[test-image]: https://github.com/stdlib-js/string-base/actions/workflows/test.yml/badge.svg?branch=main
210-
[test-url]: https://github.com/stdlib-js/string-base/actions/workflows/test.yml?query=branch:main
223+
[test-image]: https://github.com/stdlib-js/string-base/actions/workflows/test.yml/badge.svg?branch=v0.1.0
224+
[test-url]: https://github.com/stdlib-js/string-base/actions/workflows/test.yml?query=branch:v0.1.0
211225

212226
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-base/main.svg
213227
[coverage-url]: https://codecov.io/github/stdlib-js/string-base?branch=main
@@ -284,6 +298,12 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
284298

285299
[@stdlib/string/base/percent-encode]: https://github.com/stdlib-js/string-base-percent-encode
286300

301+
[@stdlib/string/base/remove-first-code-point]: https://github.com/stdlib-js/string-base-remove-first-code-point
302+
303+
[@stdlib/string/base/remove-first-grapheme-cluster]: https://github.com/stdlib-js/string-base-remove-first-grapheme-cluster
304+
305+
[@stdlib/string/base/remove-first]: https://github.com/stdlib-js/string-base-remove-first
306+
287307
[@stdlib/string/base/repeat]: https://github.com/stdlib-js/string-base-repeat
288308

289309
[@stdlib/string/base/replace-before]: https://github.com/stdlib-js/string-base-replace-before

docs/types/index.d.ts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ import ltrim = require( '@stdlib/string-base-left-trim' );
4444
import lowercase = require( '@stdlib/string-base-lowercase' );
4545
import pascalcase = require( '@stdlib/string-base-pascalcase' );
4646
import percentEncode = require( '@stdlib/string-base-percent-encode' );
47+
import removeFirst = require( '@stdlib/string-base-remove-first' );
48+
import removeFirstCodePoint = require( '@stdlib/string-base-remove-first-code-point' );
49+
import removeFirstGraphemeCluster = require( '@stdlib/string-base-remove-first-grapheme-cluster' );
4750
import repeat = require( '@stdlib/string-base-repeat' );
4851
import replace = require( '@stdlib/string-base-replace' );
4952
import replaceBefore = require( '@stdlib/string-base-replace-before' );
@@ -539,6 +542,97 @@ interface Namespace {
539542
*/
540543
percentEncode: typeof percentEncode;
541544

545+
/**
546+
* Removes the first `n` UTF-16 code units of a string.
547+
*
548+
* @param str - input string
549+
* @param n - number of code units to remove
550+
* @returns output string
551+
*
552+
* @example
553+
* var out = ns.removeFirst( 'last man standing', 1 );
554+
* // returns 'ast man standing'
555+
*
556+
* @example
557+
* var out = ns.removeFirst( 'presidential election', 1 );
558+
* // returns 'residential election'
559+
*
560+
* @example
561+
* var out = ns.removeFirst( 'JavaScript', 1 );
562+
* // returns 'avaScript'
563+
*
564+
* @example
565+
* var out = ns.removeFirst( 'Hidden Treasures', 1 );
566+
* // returns 'idden Treasures'
567+
*
568+
* @example
569+
* var out = ns.removeFirst( 'foo bar', 5 );
570+
* // returns 'ar'
571+
*/
572+
removeFirst: typeof removeFirst;
573+
574+
/**
575+
* Removes the first `n` Unicode code points of a string.
576+
*
577+
* @param str - input string
578+
* @param n - number of code points to remove
579+
* @returns output string
580+
*
581+
* @example
582+
* var out = ns.removeFirstCodePoint( 'last man standing', 1 );
583+
* // returns 'ast man standing'
584+
*
585+
* @example
586+
* var out = ns.removeFirstCodePoint( 'presidential election', 1 );
587+
* // returns 'residential election'
588+
*
589+
* @example
590+
* var out = ns.removeFirstCodePoint( 'JavaScript', 1 );
591+
* // returns 'avaScript'
592+
*
593+
* @example
594+
* var out = ns.removeFirstCodePoint( 'Hidden Treasures', 1 );
595+
* // returns 'idden Treasures'
596+
*
597+
* @example
598+
* var out = ns.removeFirstCodePoint( 'foo bar', 5 );
599+
* // returns 'ar'
600+
*/
601+
removeFirstCodePoint: typeof removeFirstCodePoint;
602+
603+
/**
604+
* Removes the first `n` grapheme clusters (i.e., user-perceived characters) of a string.
605+
*
606+
* @param str - input string
607+
* @param n - number of grapheme clusters to remove
608+
* @returns output string
609+
*
610+
* @example
611+
* var out = ns.removeFirstGraphemeCluster( 'last man standing', 1 );
612+
* // returns 'ast man standing'
613+
*
614+
* @example
615+
* var out = ns.removeFirstGraphemeCluster( 'presidential election', 1 );
616+
* // returns 'residential election'
617+
*
618+
* @example
619+
* var out = ns.removeFirstGraphemeCluster( 'JavaScript', 1 );
620+
* // returns 'avaScript'
621+
*
622+
* @example
623+
* var out = ns.removeFirstGraphemeCluster( 'Hidden Treasures', 1 );
624+
* // returns 'idden Treasures'
625+
*
626+
* @example
627+
* var out = ns.removeFirstGraphemeCluster( '🐶🐮🐷🐰🐸', 2 );
628+
* // returns '🐷🐰🐸'
629+
*
630+
* @example
631+
* var out = ns.removeFirstGraphemeCluster( 'foo bar', 5 );
632+
* // returns 'ar'
633+
*/
634+
removeFirstGraphemeCluster: typeof removeFirstGraphemeCluster;
635+
542636
/**
543637
* Repeats a string `n` times and returns the concatenated result.
544638
*

package.json

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stdlib/string-base",
3-
"version": "0.0.0",
3+
"version": "0.1.0",
44
"description": "Base (i.e., lower-level) string functions.",
55
"license": "Apache-2.0",
66
"author": {
@@ -36,73 +36,74 @@
3636
"url": "https://github.com/stdlib-js/stdlib/issues"
3737
},
3838
"dependencies": {
39-
"@stdlib/string-base-camelcase": "^0.0.2",
40-
"@stdlib/string-base-capitalize": "^0.0.2",
41-
"@stdlib/string-base-code-point-at": "^0.0.2",
42-
"@stdlib/string-base-constantcase": "^0.0.3",
43-
"@stdlib/string-base-distances": "github:stdlib-js/string-base-distances#main",
44-
"@stdlib/string-base-dotcase": "^0.0.1",
45-
"@stdlib/string-base-ends-with": "^0.0.2",
46-
"@stdlib/string-base-first": "^0.0.1",
47-
"@stdlib/string-base-first-code-point": "^0.0.1",
48-
"@stdlib/string-base-first-grapheme-cluster": "^0.0.1",
49-
"@stdlib/string-base-for-each": "^0.0.1",
50-
"@stdlib/string-base-for-each-code-point": "^0.0.1",
51-
"@stdlib/string-base-for-each-grapheme-cluster": "^0.0.1",
52-
"@stdlib/string-base-format-interpolate": "^0.0.4",
53-
"@stdlib/string-base-format-tokenize": "^0.0.4",
54-
"@stdlib/string-base-headercase": "^0.0.2",
55-
"@stdlib/string-base-invcase": "^0.0.3",
56-
"@stdlib/string-base-kebabcase": "^0.0.2",
39+
"@stdlib/string-base-camelcase": "^0.1.0",
40+
"@stdlib/string-base-capitalize": "^0.1.0",
41+
"@stdlib/string-base-code-point-at": "^0.1.0",
42+
"@stdlib/string-base-constantcase": "^0.1.0",
43+
"@stdlib/string-base-distances": "^0.1.0",
44+
"@stdlib/string-base-dotcase": "^0.1.0",
45+
"@stdlib/string-base-ends-with": "^0.1.0",
46+
"@stdlib/string-base-first": "^0.1.0",
47+
"@stdlib/string-base-first-code-point": "^0.1.0",
48+
"@stdlib/string-base-first-grapheme-cluster": "^0.1.0",
49+
"@stdlib/string-base-for-each": "^0.1.0",
50+
"@stdlib/string-base-for-each-code-point": "^0.1.0",
51+
"@stdlib/string-base-for-each-grapheme-cluster": "^0.1.0",
52+
"@stdlib/string-base-format-interpolate": "^0.1.0",
53+
"@stdlib/string-base-format-tokenize": "^0.1.0",
54+
"@stdlib/string-base-headercase": "^0.1.0",
55+
"@stdlib/string-base-invcase": "^0.1.0",
56+
"@stdlib/string-base-kebabcase": "^0.1.0",
5757
"@stdlib/string-base-left-pad": "^0.0.2",
58-
"@stdlib/string-base-left-trim": "^0.0.2",
59-
"@stdlib/string-base-lowercase": "^0.1.1",
60-
"@stdlib/string-base-pascalcase": "^0.0.2",
61-
"@stdlib/string-base-percent-encode": "^0.0.2",
62-
"@stdlib/string-base-remove-first": "^0.0.1",
63-
"@stdlib/string-base-remove-first-code-point": "^0.0.1",
64-
"@stdlib/string-base-remove-first-grapheme-cluster": "^0.0.1",
65-
"@stdlib/string-base-repeat": "^0.0.2",
66-
"@stdlib/string-base-replace": "^0.0.2",
67-
"@stdlib/string-base-replace-before": "github:stdlib-js/string-base-replace-before#main",
68-
"@stdlib/string-base-right-pad": "^0.0.1",
69-
"@stdlib/string-base-right-trim": "^0.0.2",
70-
"@stdlib/string-base-snakecase": "^0.0.2",
71-
"@stdlib/string-base-startcase": "^0.0.2",
72-
"@stdlib/string-base-starts-with": "^0.0.2",
73-
"@stdlib/string-base-trim": "^0.0.2",
74-
"@stdlib/string-base-uncapitalize": "^0.0.2",
75-
"@stdlib/string-base-uppercase": "^0.0.3",
76-
"@stdlib/utils-define-read-only-property": "^0.0.8"
58+
"@stdlib/string-base-left-trim": "^0.1.0",
59+
"@stdlib/string-base-lowercase": "^0.2.0",
60+
"@stdlib/string-base-pascalcase": "^0.1.0",
61+
"@stdlib/string-base-percent-encode": "^0.1.0",
62+
"@stdlib/string-base-remove-first": "^0.1.0",
63+
"@stdlib/string-base-remove-first-code-point": "^0.1.0",
64+
"@stdlib/string-base-remove-first-grapheme-cluster": "^0.1.0",
65+
"@stdlib/string-base-repeat": "^0.1.0",
66+
"@stdlib/string-base-replace": "^0.1.0",
67+
"@stdlib/string-base-replace-before": "^0.1.0",
68+
"@stdlib/string-base-right-pad": "^0.1.0",
69+
"@stdlib/string-base-right-trim": "^0.1.0",
70+
"@stdlib/string-base-snakecase": "^0.1.0",
71+
"@stdlib/string-base-startcase": "^0.1.0",
72+
"@stdlib/string-base-starts-with": "^0.1.0",
73+
"@stdlib/string-base-trim": "^0.1.0",
74+
"@stdlib/string-base-uncapitalize": "^0.1.0",
75+
"@stdlib/string-base-uppercase": "^0.1.0",
76+
"@stdlib/utils-define-read-only-property": "^0.1.0"
7777
},
7878
"devDependencies": {
79-
"@stdlib/assert-is-array": "^0.0.7",
80-
"@stdlib/assert-is-boolean": "^0.0.8",
81-
"@stdlib/assert-is-nonnegative-integer": "^0.0.7",
82-
"@stdlib/assert-is-string": "^0.0.8",
83-
"@stdlib/bench": "^0.0.12",
79+
"@stdlib/assert-is-array": "^0.1.0",
80+
"@stdlib/assert-is-boolean": "^0.1.0",
81+
"@stdlib/assert-is-nonnegative-integer": "^0.1.0",
82+
"@stdlib/assert-is-string": "^0.1.0",
83+
"@stdlib/bench": "^0.1.0",
8484
"@stdlib/console-log-each": "^0.0.2",
85-
"@stdlib/constants-float64-ninf": "^0.0.8",
86-
"@stdlib/constants-float64-pi": "^0.0.8",
87-
"@stdlib/constants-float64-pinf": "^0.0.8",
88-
"@stdlib/constants-unicode-max": "^0.0.7",
89-
"@stdlib/math-base-special-ceil": "^0.0.8",
90-
"@stdlib/math-base-special-min": "^0.0.7",
85+
"@stdlib/constants-float64-ninf": "^0.1.0",
86+
"@stdlib/constants-float64-pi": "^0.1.0",
87+
"@stdlib/constants-float64-pinf": "^0.1.0",
88+
"@stdlib/constants-unicode-max": "^0.1.0",
89+
"@stdlib/math-base-special-ceil": "^0.1.0",
90+
"@stdlib/math-base-special-min": "^0.1.0",
9191
"@stdlib/random-array-discrete-uniform": "^0.0.1",
9292
"@stdlib/random-base-discrete-uniform": "^0.0.6",
93-
"@stdlib/regexp-utf16-surrogate-pair": "^0.0.7",
94-
"@stdlib/regexp-whitespace": "^0.0.7",
95-
"@stdlib/string-base-distances-levenshtein": "^0.0.1",
96-
"@stdlib/string-format": "^0.0.3",
97-
"@stdlib/string-from-code-point": "^0.0.9",
98-
"@stdlib/string-next-grapheme-cluster-break": "^0.0.9",
99-
"@stdlib/string-utf16-to-utf8-array": "^0.0.8",
100-
"@stdlib/utils-keys": "^0.0.7",
93+
"@stdlib/regexp-utf16-surrogate-pair": "^0.1.0",
94+
"@stdlib/regexp-whitespace": "^0.1.0",
95+
"@stdlib/string-base-distances-levenshtein": "^0.1.0",
96+
"@stdlib/string-format": "^0.1.0",
97+
"@stdlib/string-from-code-point": "^0.1.0",
98+
"@stdlib/string-next-grapheme-cluster-break": "^0.1.0",
99+
"@stdlib/string-num-grapheme-clusters": "^0.1.0",
100+
"@stdlib/string-utf16-to-utf8-array": "^0.1.0",
101+
"@stdlib/utils-keys": "^0.1.0",
101102
"@stdlib/utils-map": "^0.0.1",
102-
"@stdlib/utils-nary-function": "^0.0.1",
103-
"@stdlib/utils-noop": "^0.0.14",
104-
"@stdlib/utils-papply": "^0.0.10",
105-
"@stdlib/utils-papply-right": "^0.0.8",
103+
"@stdlib/utils-nary-function": "^0.1.0",
104+
"@stdlib/utils-noop": "^0.1.0",
105+
"@stdlib/utils-papply": "^0.1.0",
106+
"@stdlib/utils-papply-right": "^0.1.0",
106107
"proxyquire": "^2.0.0",
107108
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
108109
"istanbul": "^0.4.1",

0 commit comments

Comments
 (0)