Rebase branch
This commit is contained in:
parent
19c5359b28
commit
e50162b58e
2 changed files with 1 additions and 14 deletions
|
|
@ -48,8 +48,7 @@ export const enum TypeName {
|
|||
ArrayBuffer = 'ArrayBuffer',
|
||||
SharedArrayBuffer = 'SharedArrayBuffer',
|
||||
DataView = 'DataView',
|
||||
Promise = 'Promise',
|
||||
URL = 'URL'
|
||||
Promise = 'Promise'
|
||||
}
|
||||
|
||||
const toString = Object.prototype.toString;
|
||||
|
|
@ -178,7 +177,6 @@ namespace is { // tslint:disable-line:no-namespace
|
|||
export const dataView = isObjectOfType<DataView>(TypeName.DataView);
|
||||
|
||||
export const directInstanceOf = <T>(instance: any, klass: Class<T>): instance is T => Object.getPrototypeOf(instance) === klass.prototype;
|
||||
export const urlInstance = (value: any): value is URL => isObjectOfType<URL>(TypeName.URL)(value);
|
||||
|
||||
export const truthy = (value: any) => Boolean(value);
|
||||
export const falsy = (value: any) => !value;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import net from 'net';
|
|||
import Stream from 'stream';
|
||||
import util from 'util';
|
||||
import tempy from 'tempy';
|
||||
import {URL} from 'url';
|
||||
import test, {TestContext, Context} from 'ava';
|
||||
import {JSDOM} from 'jsdom';
|
||||
import {Subject, Observable} from 'rxjs';
|
||||
|
|
@ -535,16 +534,6 @@ test('is.directInstanceOf', t => {
|
|||
t.false(m.directInstanceOf(errorSubclass, Error));
|
||||
});
|
||||
|
||||
test('is.urlInstance', t => {
|
||||
const url = new URL('https://google.com');
|
||||
|
||||
t.true(m.urlInstance(url));
|
||||
|
||||
t.false(m.urlInstance({}));
|
||||
t.false(m.urlInstance(undefined));
|
||||
t.false(m.urlInstance(null));
|
||||
});
|
||||
|
||||
test('is.truthy', t => {
|
||||
t.true(m.truthy('unicorn'));
|
||||
t.true(m.truthy('🦄'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue