Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sindresorhus/is

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sindresorhus/is - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

5

dist/index.d.ts

@@ -50,3 +50,4 @@ /// <reference types="node" />

DataView = "DataView",
Promise = "Promise"
Promise = "Promise",
URL = "URL"
}

@@ -68,2 +69,3 @@ declare function is(value: any): TypeName;

const iterable: (value: any) => value is IterableIterator<any>;
const asyncIterable: (value: any) => value is AsyncIterableIterator<any>;
const generator: (value: any) => value is Generator;

@@ -95,2 +97,3 @@ const nativePromise: (value: any) => value is Promise<any>;

const directInstanceOf: <T>(instance: any, klass: Class<T>) => instance is T;
const urlInstance: (value: any) => value is URL;
const truthy: (value: any) => boolean;

@@ -97,0 +100,0 @@ const falsy: (value: any) => boolean;

2

dist/index.js

@@ -76,2 +76,3 @@ "use strict";

is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]);
is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]);
is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);

@@ -107,2 +108,3 @@ is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value);

is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype;
is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value);
is.truthy = (value) => Boolean(value);

@@ -109,0 +111,0 @@ is.falsy = (value) => !value;

{
"name": "@sindresorhus/is",
"version": "0.10.0",
"version": "0.11.0",
"description": "Type check values: `is.string('🦄') //=> true`",

@@ -20,3 +20,3 @@ "license": "MIT",

"test": "npm run lint && npm run build && ava dist/tests",
"prepublish": "npm run build"
"prepublish": "npm run build && del dist/tests"
},

@@ -23,0 +23,0 @@ "files": [

@@ -179,2 +179,13 @@ # is [![Build Status](https://travis-ci.org/sindresorhus/is.svg?branch=master)](https://travis-ci.org/sindresorhus/is)

##### .urlInstance(value)
Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL).
```js
const url = new URL('https://example.com');
is.urlInstance(url);
//=> true
```
##### .truthy(value)

@@ -213,2 +224,3 @@

##### .iterable(value)
##### .asyncIterable(value)
##### .class(value)

@@ -215,0 +227,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc