GithubHelp home page GithubHelp logo

milesj / optimal Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 1.0 4.17 MB

Build, validate, and transform values with immutable typed schemas.

Home Page: https://optimallib.dev

License: MIT License

TypeScript 97.95% JavaScript 1.13% CSS 0.92%
blueprint options schemas immutable validation

optimal's Introduction

Optimal

Build Status npm version npm deps

Optimal is a system for building and validating any value with typed schemas, and first-class support for defined object structures, like options objects, configuration files, validation fields, and many more. Optimal aims to provide a powerful API, with high performance, the lowest possible filesize, and TypeScript-first support.

Requirements

  • Node v12.17 (server)
  • Edge, Chrome, Firefox, Safari (browser)

Documentation

https://optimallib.dev

optimal's People

Contributors

dependabot[bot] avatar milesj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bryansucks

optimal's Issues

Use generics for method types

Do this:

oneOf<T: string>(list: T[]): this;

Instead of:

oneOf(list: string[]): this;

The latter breaks when a list is passed with aliases.

OR

Add generics to the top layer.

Union: show class name for instance of

When an error occurs with an instance, we should show the class name.

This:

Invalid option "data". Type must be one of: object, string, FormData.

Instead of:

Invalid option "data". Type must be one of: object, string, instance.

Support mapped types

Currently errors.

Type 'Required<{ colors: ObjectOf<string | ColorConfig>; palettes: { danger: ...; info: ...; muted: ...; neutral: ...; primary: ...; secondary: ...; success: ...; tertiary: ...; warning: ...; }; scheme: ColorScheme; }>' is not assignable to type 'ThemeConfig<ColorNames>'.
  Types of property 'colors' are incompatible.
    Type 'ObjectOf<string | ColorConfig>' is not assignable to type '{ [K in ColorNames]: string | ColorConfig; }'.ts(2322)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.