Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Sep 26, 2023
1 parent c7d2102 commit de88884
Show file tree
Hide file tree
Showing 14 changed files with 217 additions and 492 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
[npm-image]: http://img.shields.io/npm/v/@stdlib/ndarray-fancy.svg
[npm-url]: https://npmjs.org/package/@stdlib/ndarray-fancy

[test-image]: https://github.com/stdlib-js/ndarray-fancy/actions/workflows/test.yml/badge.svg?branch=v0.1.0
[test-url]: https://github.com/stdlib-js/ndarray-fancy/actions/workflows/test.yml?query=branch:v0.1.0
[test-image]: https://github.com/stdlib-js/ndarray-fancy/actions/workflows/test.yml/badge.svg?branch=main
[test-url]: https://github.com/stdlib-js/ndarray-fancy/actions/workflows/test.yml?query=branch:main

[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-fancy/main.svg
[coverage-url]: https://codecov.io/github/stdlib-js/ndarray-fancy?branch=main
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

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

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

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions examples/0d.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@ console.log( y2.get() );
var y3 = x[ '' ];
console.log( y3.get() );
// => 10

// Use alternative syntax:
var y4 = x[ '...' ];
console.log( y4.get() );
// => 10
56 changes: 0 additions & 56 deletions lib/empty.js

This file was deleted.

53 changes: 53 additions & 0 deletions lib/error_constructor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2023 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var isRangeError = require( '@stdlib/assert-is-range-error' );
var isTypeError = require( '@stdlib/assert-is-type-error' );
var isSyntaxError = require( '@stdlib/assert-is-syntax-error' );


// MAIN //

/**
* Returns the error constructor for a provided error object.
*
* @private
* @param {Error} err - error object
* @returns {Function} error constructor
*/
function errConstructor( err ) {
if ( isRangeError( err ) ) {
return RangeError;
}
if ( isTypeError( err ) ) {
return TypeError;
}
if ( isSyntaxError( err ) ) {
return SyntaxError;
}
return Error;
}


// EXPORTS //

module.exports = errConstructor;
Loading

0 comments on commit de88884

Please sign in to comment.