open-index/open-npm huggingface dataset:
npm package: @std-types/assert-type
Description: Assert that a value is the given type
Latest version: 0.1.1

# `@std-types/assert-type`

Assert that a value is the given type

## Installation

```sh
npm install @std-types/assert-type
```

## Usage

```ts
import assertType, { getAssertType } from "@std-types/assert-type";

const assertString = getAssertType("string");

assertString("hello"); // OK
assertString(42); // Error

assertType("hello", isString); // OK
assertType(42, isString); // Error
```
npm package: @std-types/is-all-of
Description: Checks whether an element matches all of the given criteria
Latest version: 1.0.0

# `@std-types/is-all-of`

Checks whether an element matches all of the given criteria

## Installation

```sh
npm install @std-types/is-all-of
```

## Usage

```ts
import isAllOf, { getIsAllOf } from "@std-types/is-all-of";

isAllOf(1, isNumber, isString); // false

interface Identity {
  name: string;
  age: number;
}

const isIdentity = (value: unknown): value is Identity => {
  return isObject(value) && isString(value.name) && isNumber(value.age);
};

interface Position {
  x: number;
  y: number;
}

const isPosition = (value: unknown): value is Position => {
  return isObject(value) && isNumber(value.x) && isNumber(value.y);
};

declare const value: unknown;
if (isAllOf(value, isIdentity, isPosition)) {
  // value is Identity & Position
  value;
}

const isIdentityAndPosition = getIsAllOf(isIdentity, isPosition);
if (isIdentityAndPosition(value)) {
  // value is Identity & Position
  value;
}
```
npm package: @std-types/is-array
Description: Type-checking library for arrays.
Latest version: 1.0.0

# `@std-types/is-array`

Type-checking library for arrays.

## Installation

```sh
npm install @std-types/is-array
```

## Usage

```ts
import isArray, { getIsArray } from "@std-types/is-array";
import isNumber from "@std-types/is-number";

const n = [1, 2, 3];
if (isArray(n)) {
  // n is unknown[]
}

if (isArray(n, isNumber)) {
  // n is number[]
}

const isArrayOfNumbers = getIsArray(isNumber);
if (isArrayOfNumbers(n)) {
  // n is number[]
}

const isArrayOfArrayOfNumbers = getIsArray(isArrayOfNumbers);
if (isArrayOfArrayOfNumbers(n)) {
  // n is number[][]
}
```
npm package: @std-types/is-bigint
Description: Type-checking library for BigInt type.
Latest version: 1.0.0

# `@std-types/is-bigint`

Type-checking library for BigInt type.

## Installation

```sh
npm install @std-types/is-bigint
```

## Usage

```ts
import isBigInt from "@std-types/is-bigint";

isBigInt(0n); // true
isBigInt(0); // false
```
npm package: @std-types/is-boolean
Description: Type-checking library for booleans.
Latest version: 1.0.0

# `@std-types/is-boolean`

Type-checking library for booleans.

## Installation

```sh
npm install @std-types/is-boolean
```

## Usage

```ts
import isBoolean from "@std-types/is-boolean";

declare const someValue: unknown;

if (isBoolean(someValue)) {
  // someValue is a boolean
}
```
npm package: @std-types/is-defined
Description: Check whether values are defined.
Latest version: 1.0.0

# `@std-types/is-defined`

Check whether values are defined.

## Installation

```sh
npm install @std-types/is-defined
```

## Usage

```ts
import isDefined from "@std-types/is-defined";

isDefined(undefined); // false
isDefined(null); // true

declare const value: string | undefined;
if (isDefined(value)) {
  console.log(value); // value is string
}
```
npm package: @std-types/is-enum
Description: Ensure a value is one of an enumerated set
Latest version: 0.1.0

# `@std-types/is-enum`

Ensure a value is one of an enumerated set

## Installation

```sh
npm install @std-types/is-enum
```

## Usage

```ts
import isEnum from "@std-types/is-enum";

enum E {
  A,
  B,
  C,
}

console.log(isEnum(E.A, E)); // true
console.log(isEnum(E.B, E)); // true
console.log(isEnum(E.C, E)); // true
console.log(isEnum(true, E)); // false
```
npm package: @std-types/is-finite-number
Description: TypeScript Guard function for checking finite values.
Latest version: 1.0.0

# `@std-types/is-finite-number`

TypeScript Guard function for checking finite number values.

## Installation

```sh
npm install @std-types/is-finite-number
```

## Usage

```ts
import isFiniteNumber from "@std-types/is-finite-number";

declare const value: unknown;

if (isFiniteNumber(value)) {
  // value is a finite number
}
```
npm package: @std-types/is-function
Description: Check whether a value is a function
Latest version: 1.0.0

# `@std-types/is-function`

Check whether a value is a function

## Installation

```sh
npm install @std-types/is-function
```

## Usage

```ts
import isFunction from "@std-types/is-function";

isFunction(() => {}); // true
isFunction(function () {}); // true
isFunction(async function () {}); // true
isFunction(function* () {}); // true
isFunction(async function* () {}); // true
isFunction(new Function()); // true
```
npm package: @std-types/is-instance-of
Description: Check whether a given value is an instance of some class
Latest version: 0.1.0

# `@std-types/is-instance-of`

Check whether a given value is an instance of some class

## Installation

```sh
npm install @std-types/is-instance-of
```

## Usage

```ts
import isInstanceOf from "@std-types/is-instance-of";

class A {}
class B extends A {}

const a = new A();
const b = new B();

console.log(isInstanceOf(a, A)); // true
console.log(isInstanceOf(b, A)); // true
console.log(isInstanceOf(a, B)); // false
console.log(isInstanceOf(b, B)); // true
```
npm package: @std-types/is-none-of
Description: Check whether a value matches none of the given guards
Latest version: 1.0.0

# `@std-types/is-none-of`

Check whether a value matches none of the given guards

## Installation

```sh
npm install @std-types/is-none-of
```

## Usage

```ts
import isNoneOf from "@std-types/is-none-of";

isNoneOf(1, isNumber, isString); // false
isNoneOf("foo", isNumber, isString); // false
isNoneOf([], isNumber, isString); // true
```
npm package: @std-types/is-number
Description: Type check numbers
Latest version: 1.2.0

# `@std-types/is-number`

Type-checking library for numbers.

## Installation

```sh
npm install @std-types/is-number
```

## Usage

```ts
import isNumber from "@std-types/is-number";

console.log(isNumber(42)); // true
console.log(isNumber("42")); // false
console.log(isNumber(Infinity)); // true
console.log(isNumber(NaN)); // true
```
npm package: @std-types/is-object
Description: Type-checking library for objects.
Latest version: 1.0.0

# `@std-types/is-object`

Type-checking library for objects.

## Installation

```sh
npm install @std-types/is-object
```

## Usage

```ts
import isObject from "@std-types/is-object";

isObject({}); // true
isObject([]); // false
isObject(null); // false
```
npm package: @std-types/is-one-of
Description: Type-checking for type-unions
Latest version: 1.0.0

# `@std-types/is-one-of`

Type-checking for type-unions

## Installation

```sh
npm install @std-types/is-one-of
```

## Usage

```ts
import isOneOf, { getIsOneOf } from "@std-types/is-one-of";
import isString from "@std-types/is-string";
import { getIsArray } from "@std-types/is-array";

declare const value: unknown;
if (isOneOf(value, isString, getIsArray(isString))) {
  // value is either a string or an array of strings
}

const isStringOrStringArray = getIsOneOf(isString, getIsArray(isString));
if (isStringOrStringArray(value)) {
  // value is either a string or an array of strings
}
```
npm package: @std-types/is-shaped-like
Description: Utility type-checker for detecting the shape of an object
Latest version: 2.1.0

# `@std-types/is-shaped-like`

Utility type-checker for detecting the shape of an object

## Installation

```sh
npm install @std-types/is-shaped-like
```

## Usage

```ts
import isBoolean from "@std-types/is-boolean";
import isNumber from "@std-types/is-number";
import isShapedLike, { getIsShapedLike } from "@std-types/is-shaped-like";
import isString from "@std-types/is-string";

const obj = {
  name: "Steve",
  age: 30,
  isDev: true,
};

const shape = {
  name: isString,
  age: isNumber,
  isDev: isBoolean,
};

if (isShapedLike(obj, shape)) {
  console.log("The object is shaped like the shape");
}

const isShapedLikePerson = getIsShapedLike({
  name: isString,
  age: isNumber,
  isDev: isBoolean,
});

if (isShapedLikePerson(obj)) {
  console.log("The object is shaped like a person");
}
```

### Extending a Shape

```ts
import { getIsShapedLike } from "@std-types/is-shaped-like";

const isShapedLikePerson = getIsShapedLike({
  name: isString,
  age: isNumber,
  isDev: isBoolean,
});

const isShapedLikeEmployee = getIsShapedLike({
  ...isShapedLikePerson.shape,
  jobTitle: isString,
});

const obj = {
  name: "Steve",
  age: 30,
  isDev: true,
  jobTitle: "Software Engineer",
};

if (isShapedLikeEmployee(obj)) {
  console.log("The object is shaped like an employee");
}
```

### Extending a shape with the `extend` function

```ts
import { getIsShapedLike } from "@std-types/is-shaped-like";

const isShapedLikePerson = getIsShapedLike({
  name: isString,
  age: isNumber,
  isDev: isBoolean,
});

const isShapedLikeEmployee = isShapedLikePerson.extend({
  jobTitle: isString,
});
```
npm package: @std-types/is-string
Description: Type checking for string primitives
Latest version: 1.0.0

# `@std-types/is-string`

Type-checking library for strings.

## Installation

```sh
npm install @std-types/is-string
```

## Usage

```ts
import isString from "@std-types/is-string";

console.log(isString("Hello, World!")); // true
console.log(isString(42)); // false
```
npm package: @std-types/is-symbol
Description: Type-checking library for symbols
Latest version: 1.0.0

# `@std-types/is-symbol`

Type-checking library for symbols

## Installation

```sh
npm install @std-types/is-symbol
```

## Usage

```ts
import isSymbol from "@std-types/is-symbol";

isSymbol(Symbol("foo")); //=> true
isSymbol("foo"); //=> false
```
npm package: @std-types/is-typed-array
Description: Type-checking library for typed arrays
Latest version: 1.0.0

# `@std-types/is-typed-array`

Type-checking library for typed arrays

## Installation

```sh
npm install @std-types/is-typed-array
```

## Usage

```ts
import isTypedArray from "@std-types/is-typed-array";

console.log(isTypedArray(new Int8Array())); // true
console.log(isTypedArray(new Uint8Array())); // true
```
npm package: @std-types/is-undefined
Description: Check whether values are undefined.
Latest version: 1.0.0

# `@std-types/is-undefined`

Check whether values are undefined.

## Installation

```sh
npm install @std-types/is-undefined
```

## Usage

```ts
import isUndefined from "@std-types/is-undefined";

isUndefined(undefined); // true
```
npm package: @std-types/is-valid-number
Description: TypeScript Guard for a non-NaN value.
Latest version: 1.0.0

# `@std-types/is-valid-number`

TypeScript Guard for a non-NaN number value.

## Installation

```sh
npm install @std-types/is-valid-number
```

## Usage

```ts
import isValidNumber from "@std-types/is-valid-number";

declare const value: unknown;

if (isValidNumber(value)) {
  // value is a non-NaN number
}
```