Test whether a value is a relative URI.
Installations
npm install @stdlib/assert-is-relative-uri
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=0.10.0
Node Version
16.20.2
NPM Version
8.19.4
Score
70.6
Supply Chain
93.4
Quality
82.8
Maintenance
100
Vulnerability
80.8
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
3,116
Last Day
5
Last Week
16
Last Month
77
Last Year
775
GitHub Statistics
1 Stars
60 Commits
3 Watching
6 Branches
11 Contributors
Bundle Size
8.96 kB
Minified
2.86 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
0.2.2
Package Id
@stdlib/assert-is-relative-uri@0.2.2
Unpacked Size
32.04 kB
Size
9.28 kB
File Count
11
NPM Version
8.19.4
Node Version
16.20.2
Publised On
27 Jul 2024
Total Downloads
Cumulative downloads
Total Downloads
3,116
Last day
66.7%
5
Compared to previous day
Last week
-20%
16
Compared to previous week
Last month
148.4%
77
Compared to previous month
Last year
-24.5%
775
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
About stdlib...
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.
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.
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.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
isRelativeURI
Test whether a value is a relative URI.
Installation
1npm install @stdlib/assert-is-relative-uri
Usage
1var isRelativeURI = require( '@stdlib/assert-is-relative-uri' );
isRelativeURI( value )
Tests whether a value is a relative URI.
1var bool = isRelativeURI( 'foo/bar' ); 2// returns true 3 4bool = isRelativeURI( 'https://example.com/' ); 5// returns false
Notes
- For more information regarding the URI scheme, see RFC 3986 and Wikipedia.
- On the distinction between URI, URL, and URN, see The Difference Between URLs and URIs.
Examples
1var isRelativeURI = require( '@stdlib/assert-is-relative-uri' ); 2 3var bool = isRelativeURI( './foo.js' ); 4// returns true 5 6bool = isRelativeURI( '/dashboard/admin' ); 7// returns true 8 9bool = isRelativeURI( 'image.png' ); 10// returns true 11 12bool = isRelativeURI( 'http://www.example.com/' ); 13// returns false 14 15bool = isRelativeURI( 'https://www.example.com/' ); 16// returns false 17 18bool = isRelativeURI( 'ftp://ftp.is.co.za/rfc/rfc1808.txt' ); 19// returns false 20 21bool = isRelativeURI( 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D' ); 22// returns false 23 24bool = isRelativeURI( 'mailto:beep@boop.com' ); 25// returns false 26 27bool = isRelativeURI( null ); 28// returns false
See Also
@stdlib/assert-is-relative-uri-cli
: CLI package for use as a command-line utility.@stdlib/assert-is-uri
: test if a value is a URI.
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
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.
No vulnerabilities found.
No security vulnerabilities found.