Skip to content

Commit

Permalink
Release v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Sep 21, 2023
1 parent 1fda33a commit 6dc839d
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 37 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,25 @@ v = s.step;
// returns -1
```

The function returns an error object if provided in invalid subsequence string.
The function returns an error object if provided an invalid subsequence string.

```javascript
var s = seq2slice( '1:2:3:4', 10, false );
// returns { 'code': 'ERR_INVALID_SUBSEQUENCE' }
// returns { 'code': 'ERR_SLICE_INVALID_SUBSEQUENCE' }
```

When `strict` is `true`, the function returns an error object if a subsequence string resolves to a slice exceeding index bounds.

```javascript
var s = seq2slice( '10:20', 10, true );
// returns { 'code': 'ERR_OUT_OF_BOUNDS' }
// returns { 'code': 'ERR_SLICE_OUT_OF_BOUNDS' }
```

A returned error object may have one of the following error codes:

- **ERR_INVALID_SUBSEQUENCE**: a subsequence string is invalid.
- **ERR_INVALID_INCREMENT**: a subsequence string must have a non-zero increment.
- **ERR_OUT_OF_BOUNDS**: a subsequence string resolves to a slice exceeding index bounds.
- **ERR_SLICE_INVALID_SUBSEQUENCE**: a subsequence string is invalid.
- **ERR_SLICE_INVALID_INCREMENT**: a subsequence string must have a non-zero increment.
- **ERR_SLICE_OUT_OF_BOUNDS**: a subsequence string resolves to a slice exceeding index bounds.

</section>

Expand Down Expand Up @@ -337,8 +337,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/slice-base-seq2slice.svg
[npm-url]: https://npmjs.org/package/@stdlib/slice-base-seq2slice

[test-image]: https://github.com/stdlib-js/slice-base-seq2slice/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/slice-base-seq2slice/actions/workflows/test.yml?query=branch:main
[test-image]: https://github.com/stdlib-js/slice-base-seq2slice/actions/workflows/test.yml/badge.svg?branch=v0.0.1
[test-url]: https://github.com/stdlib-js/slice-base-seq2slice/actions/workflows/test.yml?query=branch:v0.0.1

[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/slice-base-seq2slice/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/slice-base-seq2slice?branch=main
Expand Down
22 changes: 11 additions & 11 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/index.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
When the provided length is zero, the function always returns a slice object
equivalent to '0:0:<increment>'.

The function returns an error object if provided in invalid subsequence
The function returns an error object if provided an invalid subsequence
string.

In strict mode, the function returns an error object if provided a
Expand All @@ -59,11 +59,11 @@

A returned error object may have one of the following error codes:

- ERR_INVALID_SUBSEQUENCE: a subsequence string is invalid.
- ERR_INVALID_INCREMENT: a subsequence string must have a non-zero
- ERR_SLICE_INVALID_SUBSEQUENCE: a subsequence string is invalid.
- ERR_SLICE_INVALID_INCREMENT: a subsequence string must have a non-zero
increment.
- ERR_OUT_OF_BOUNDS: a subsequence string resolves to a slice exceeding
index bounds.
- ERR_SLICE_OUT_OF_BOUNDS: a subsequence string resolves to a slice
exceeding index bounds.

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface ErrorObject {
/**
* Error code.
*/
code: 'ERR_INVALID_SUBSEQUENCE' | 'ERR_INVALID_INCREMENT' | 'ERR_OUT_OF_BOUNDS';
code: 'ERR_SLICE_INVALID_SUBSEQUENCE' | 'ERR_SLICE_INVALID_INCREMENT' | 'ERR_SLICE_OUT_OF_BOUNDS';
}

/**
Expand Down Expand Up @@ -68,7 +68,7 @@ type SliceResult = Slice<number, number | null, number> | ErrorObject;
*
* - When `len` is zero, the function always returns a Slice object equivalent to `0:0:<increment>`.
*
* - The function returns an error object if provided in invalid subsequence string.
* - The function returns an error object if provided an invalid subsequence string.
*
* - If `strict` is `true`, the function returns an error object if provided a subsequence string which exceeds index bounds.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/error_invalid_increment.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
function error() {
return {
'code': 'ERR_INVALID_INCREMENT'
'code': 'ERR_SLICE_INVALID_INCREMENT'
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/error_invalid_subsequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
function error() {
return {
'code': 'ERR_INVALID_SUBSEQUENCE'
'code': 'ERR_SLICE_INVALID_SUBSEQUENCE'
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/error_out_of_bounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
function error() {
return {
'code': 'ERR_OUT_OF_BOUNDS'
'code': 'ERR_SLICE_OUT_OF_BOUNDS'
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var eInvalidIncrement = require( './error_invalid_increment.js' );
*
* - When `len` is zero, the function always returns a Slice object equivalent to `0:0:<increment>`.
*
* - The function returns an error object if provided in invalid subsequence string.
* - The function returns an error object if provided an invalid subsequence string.
*
* - If `strict` is `true`, the function returns an error object if provided a subsequence string which exceeds index bounds.
*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stdlib/slice-base-seq2slice",
"version": "0.0.0",
"version": "0.0.1",
"description": "Convert a subsequence string to a Slice object.",
"license": "Apache-2.0",
"author": {
Expand Down
8 changes: 4 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ tape( 'the function returns an error object if provided a first argument which i
':end/1s'
];
expected = {
'code': 'ERR_INVALID_SUBSEQUENCE'
'code': 'ERR_SLICE_INVALID_SUBSEQUENCE'
};
for ( i = 0; i < values.length; i++ ) {
t.deepEqual( seq2slice( values[ i ], 10, false ), expected, 'returns expected value when provided ' + values[ i ] );
Expand All @@ -119,7 +119,7 @@ tape( 'the function returns an error object if provided a first argument which i
':end/0.5:'
];
expected = {
'code': 'ERR_INVALID_SUBSEQUENCE'
'code': 'ERR_SLICE_INVALID_SUBSEQUENCE'
};
for ( i = 0; i < values.length; i++ ) {
t.deepEqual( seq2slice( values[ i ], 10, false ), expected, 'returns expected value when provided ' + values[ i ] );
Expand Down Expand Up @@ -159,7 +159,7 @@ tape( 'the function returns an error object if provided a first argument which i
':end-20:5'
];
expected = {
'code': 'ERR_OUT_OF_BOUNDS'
'code': 'ERR_SLICE_OUT_OF_BOUNDS'
};
for ( i = 0; i < values.length; i++ ) {
t.deepEqual( seq2slice( values[ i ], 10, true ), expected, 'returns expected value when provided ' + values[ i ] );
Expand All @@ -182,7 +182,7 @@ tape( 'the function returns an error object if provided a first argument which i
'end:end:0'
];
expected = {
'code': 'ERR_INVALID_INCREMENT'
'code': 'ERR_SLICE_INVALID_INCREMENT'
};
for ( i = 0; i < values.length; i++ ) {
t.deepEqual( seq2slice( values[ i ], 10, false ), expected, 'returns expected value when provided ' + values[ i ] );
Expand Down

0 comments on commit 6dc839d

Please sign in to comment.