coder-spirit / nominal Goto Github PK
View Code? Open in Web Editor NEWPowerful nominal types for your Typescript project
License: MIT License
Powerful nominal types for your Typescript project
License: MIT License
Introduce new tests to assert this property. Might be the case that it does not hold in the current situation (at least before we implement the issue #2 ).
WithTag<WithoutTag<WithTag>> === WithTag
// We want to test this because WithoutTag
is relatively complexAt build step, generate ESM files as well, and export them property through package.json.
For more info (follow links in document): https://docs.skypack.dev/package-authors/package-checks
Right now, we use the properties __baseType
and __typeTags
to hold the typing information. Using symbol
entries instead of strings would be safer.
__baseType
and __typeTags
.readonly
.The installation instructions in the nominal README state to use npm install or yarn add --dev. The npm install instructions will add nominal as a production dependency whereas the yarn install instructions will add nominal as a dev dependency. This seems inconsistent. How should we install nominal? regular dependency or dev dependency specifically when the nominal branded types will be added to a library that will then be re-used by multiple downstream dependencies?
Thanks and appreciate the great work on this incredibly useful library.
Introduce BaseType
helper to extract the base type of branded/tagged types.
Make it compatible with Deno, and publish it wherever Deno users pick their libraries from.
More info here: https://dev.to/craigmorten/how-to-publish-deno-modules-2cg6
In order to improve composability, WithoutTag
should be split into two types, one keeping the old name, but without the "tag negation" effect, and a new one that explicitly negates the tag.
Stick to a fixed terminology. Right now we use the terms "tag", "type" and "brand", we should clarify how we use them and simplify as much as possible the terminology.
Ensure that tests & linters are executed on pull requests.
Separate type definitions into multiple files to improve readability
CONTRIBUTING.md
: We should have a document explaining the workflow of this project and how to contribute.badges
: add badges to README.md
to signal project quality.funding
: unlikely that will be useful, but it would be nice that people can be thankful for the effort.Add inline documentation for types, to be shown by intellisense in IDEs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.