0.0.8 • Published 8 months ago

fluxus v0.0.8

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

Fluxus

Is this library for you?

Do you care about performance and bundle size and don't mind a bit steeper learning curve?

If you need more information then check out our Comparison section.

Example

import type { Output } from "fluxus";
import { and, email, gt, tap, length, object, string_type, parse } from "fluxus"; // 0.47 kB

// Create login schema with email and password
const login_schema = object({
  email: and(string_type, email),
  password: and(string_type, tap(and(length, gt(8)))),
});

// Infer output TypeScript type of login schema
// { email: string; password: string }
type LoginData = Output<typeof login_schema>;

// Throws error saying email does not match email regex
parse(login_schema, { email: '', password: '' });

// Returns data as { email: string; password: string }
parse(login_schema, { email: 'yamiteru@icloud.com', password: 'helloworld' });
0.0.8

8 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago

0.0.0

10 years ago