Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ryardley/pdsl

The expressive declarative toolkit for composing predicates in TypeScript or JavaScript
https://github.com/ryardley/pdsl

boolean-function guard predicate-functions property-truthiness typescript

Last synced: 13 days ago
JSON representation

The expressive declarative toolkit for composing predicates in TypeScript or JavaScript

Awesome Lists containing this project

README

        







Predicate Domain Specific Language



Read the docs!        





[![Build Status](https://travis-ci.com/ryardley/pdsl.svg?branch=master)](https://travis-ci.com/ryardley/pdsl)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/pdsl.svg)
![npm](https://img.shields.io/npm/v/pdsl.svg)
[![codecov](https://codecov.io/gh/ryardley/pdsl/branch/master/graph/badge.svg)](https://codecov.io/gh/ryardley/pdsl)

#### An expressive declarative toolkit for composing predicates in TypeScript or JavaScript

```js
import p from "pdsl";

const isSoftwareCreator = p`{
name: string,
age: > 16,
occupation: "Engineer" | "Designer" | "Project Manager"
}`;

isSoftwareCreator(someone); // true | false
```

- [x] Intuitive
- [x] Expressive
- [x] Lightweight - under 6k!
- [x] No dependencies
- [x] Small bundle size
- [x] Fast


## Documentation

[PDSL Documentation](https://pdsl.site)