Add is.urlString (#73)
This commit is contained in:
parent
2ee148f5a1
commit
566f363632
3 changed files with 40 additions and 1 deletions
|
|
@ -576,13 +576,22 @@ test('is.directInstanceOf', t => {
|
|||
});
|
||||
|
||||
test('is.urlInstance', t => {
|
||||
const url = new URL('https://www.example.com');
|
||||
const url = new URL('https://example.com');
|
||||
t.true(is.urlInstance(url));
|
||||
t.false(is.urlInstance({}));
|
||||
t.false(is.urlInstance(undefined));
|
||||
t.false(is.urlInstance(null));
|
||||
});
|
||||
|
||||
test('is.urlString', t => {
|
||||
const url = 'https://example.com';
|
||||
t.true(is.urlString(url));
|
||||
t.false(is.urlString(new URL(url)));
|
||||
t.false(is.urlString({}));
|
||||
t.false(is.urlString(undefined));
|
||||
t.false(is.urlString(null));
|
||||
});
|
||||
|
||||
test('is.truthy', t => {
|
||||
t.true(is.truthy('unicorn'));
|
||||
t.true(is.truthy('🦄'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue