is-data-url
v1.0.1
Published
Check if the given value is a Data URL.
Downloads
34
Readme
is-data-url
Check if the given value is a Data URL.
Main
dist/
├── is-data-url.js (UMD)
├── is-data-url.min.js (UMD, compressed)
├── is-data-url.common.js (CommonJS, default)
└── is-data-url.esm.js (ES Module)
Install
npm install is-data-url
Usage
Syntax
isDataURL(value);
value
- Type:
*
- The value to check.
- Type:
(return value)
- Type:
Boolean
- Returns
true
if the given value is a Data URL, elsefalse
.
- Type:
Examples
import isDataURL from 'is-data-url';
isDataURL('data:text/plain;base64,SGVsbG8sIFdvcmxkIQo=');
// => true
isDataURL('data:foo');
// => false