pdsl v5.2.10
Predicate Domain Specific Language
An expressive declarative toolkit for composing predicates in TypeScript or JavaScript
import p from "pdsl";
const isSoftwareCreator = p`{
name: string,
age: > 16,
occupation: "Engineer" | "Designer" | "Project Manager"
}`;
isSoftwareCreator(someone); // true | false
- Intuitive
- Expressive
- Lightweight
- No dependencies
- Small bundle size
- Fast
Predicate functions are just easier with PDSL
Creating predicate functions in JavaScript is often verbose, especially for checking the format of complex object types. We need predicate functions all the time when filtering an array, validating input, determining the type of an unknown object or creating guard conditions in TypeScript.
PDSL provides the developer a simple but powerful shorthand based on a combination of template strings and helper functions for defining predicate functions that makes it easy to understand intent. With pdsl
we can easily visualize the expected input's structure and intent using it's intuitive predicate composition language.
Documentation
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago