This is a code example of flexible nominal typing in typescript as shown by Atomic Object and also contains their Strongly-Typed Date String.
-
Flavoring: flexible nominal types
-
Branding: strict nominal types
-
Node 18
-
Use [nvm](https://github.com/nvm-sh/nvm) to
nvm use 18
-
-
Install packages
npm ci
-
node --version > .nvmrc-
npm init -y-
configure npm by setting
"private": trueand engines to same node version as in the nvmrc
-
-
npm i -D typescript @types/node ts-node -
npx tsc --initand configureoutdir: "dist","target": "es2017"and other things by preference-
Add
"build": "tsc"to package.json.
-
-
Add
npm install -D mocha @types/mocha earljs-
Add "build": "mocha"` to package.json
-
Add
.mocharc.jsoncontaining"require": ["ts-node/register"], "spec": ["test/*/.spec.ts"] -
Add
"types": ["mocha"]to tsconfig.json -
Wrap EarlJs Getting Started example in a mocha
test/foo.spec.tsfile
-
-