@stdlib/error-tools-id2pkg
v0.3.0
Published
Return the package name associated with a specified error identifier prefix.
Downloads
22
Readme
id2pkg
Return the package name associated with a specified error identifier prefix.
Installation
npm install @stdlib/error-tools-id2pkg
Usage
var id2pkg = require( '@stdlib/error-tools-id2pkg' );
id2pkg( id )
Returns the package name associated with a specified error identifier prefix.
var v = id2pkg( '0H5' );
// returns '@stdlib/math/base/special/sin'
If provided an unrecognized error identifier prefix, the function returns null
.
var v = id2pkg( 'unrecognized_alias_beep_boop_bop_bip' );
// returns null
Examples
var id2pkg = require( '@stdlib/error-tools-id2pkg' );
var list;
var len;
var v;
var i;
list = [
'001',
'0A3',
'0Ab'
];
len = list.length;
for ( i = 0; i < len; i++ ) {
v = list[ i ];
console.log( 'id: %s. pkg: %s.', v, id2pkg( v ) );
}
License
The data files (databases) are licensed under an Open Data Commons Public Domain Dedication & License 1.0 and their contents are licensed under Creative Commons Zero v1.0 Universal. The software is licensed under Apache License, Version 2.0.
See Also
@stdlib/error-tools-id2pkg-cli
: CLI package for use as a command-line utility.
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
Copyright
Copyright © 2016-2024. The Stdlib Authors.