# @unsass/types

> Sass functions to check the type of a value.

Latest version **1.1.0** (published 2026-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @unsass/types
pnpm add @unsass/types
yarn add @unsass/types
bun add @unsass/types
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; recently updated.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2026-09-20 |
| First published | 2022-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=22 |
| Dependencies | 0 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2 |
| Author | Front Factory |
| Maintainers | bdamevin |
| Keywords | sass, scss, types, unsass, front-end |

## Links

- npm: https://www.npmjs.com/package/@unsass/types
- Repository: https://github.com/unsass/unsass
- Homepage: https://github.com/unsass/unsass/tree/main/packages/types#readme
- Issues: https://github.com/unsass/unsass/issues
- npm.io page: https://npm.io/package/@unsass/types

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2026-09-20
- 1.0.3 — 2023-03-21
- 1.0.2 — 2023-03-17
- 1.0.1 — 2022-10-13
- 1.0.0 — 2022-09-26

## README

# Types

[![Version](https://flat.badgen.net/npm/v/@unsass/types)](https://www.npmjs.com/package/@unsass/types)
[![Downloads](https://flat.badgen.net/npm/dt/@unsass/types)](https://www.npmjs.com/package/@unsass/types)
[![License](https://flat.badgen.net/npm/license/@unsass/types)](https://www.npmjs.com/package/@unsass/types)

## Introduction

A small, dependency-free Sass toolkit for checking the type of a value. Each `is-*` function wraps `meta.type-of()` in a
readable predicate, so conditions and input validation stay concise and consistent.

<div align="center">

![Types](.github/banner.svg)

</div>

## Installing

```shell
npm install @unsass/types
```

## Usage

```scss
@use "@unsass/types";

@if types.is-number(12) {
    // ...
}
```

## Functions

Every function takes a single `$value` and returns a boolean.

### `is-number($value)`

Checks whether a value is a number, with or without unit.

```scss
@use "@unsass/types";

$result: types.is-number(12px); // true
```

### `is-string($value)`

Checks whether a value is a string, quoted or not.

```scss
@use "@unsass/types";

$result: types.is-string("foo"); // true
```

### `is-color($value)`

Checks whether a value is a color.

```scss
@use "@unsass/types";

$result: types.is-color(darkcyan); // true
```

### `is-list($value)`

Checks whether a value is a list.

```scss
@use "@unsass/types";

$result: types.is-list((1px, 2px, 3px)); // true
```

### `is-map($value)`

Checks whether a value is a map.

```scss
@use "@unsass/types";

$result: types.is-map(("foo": "bar")); // true
```

### `is-boolean($value)`

Checks whether a value is `true` or `false`.

```scss
@use "@unsass/types";

$result: types.is-boolean(false); // true
```

### `is-null($value)`

Checks whether a value is `null`.

```scss
@use "@unsass/types";

$result: types.is-null(null); // true
```

---
_Source: https://npm.io/package/@unsass/types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
