@unional/assert-order
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

@unional/assert-order

Build Status

...sometimes we do need to assert code are executed in certain order.

This is the library for that.

import AssertOrder form '@unional/assert-order'

let a = new AssertOrder()
a.once(0)
a.once(1)
a.some(2)
a.some(2)
a.all(3, 2)
a.all(3, 2)
a.once(4)

Using global build

To use this library in the global namespace environment, copy and reference the dist/unional-assert-order.js file in script tag.

To aid development, you can add the typings to your project by:

Install this package:

npm install -D @unional/assert-order

Create custom-typings/unional-assert-order.d.ts:

export * from '@unional/assert-order'
export as namesapce UnionalAssertOrder

Reference that file in your tsconfig.json:

// tsconfig.json
{
  "compilerOptions": {
    "allowJs": true, // if you write in JavaScript
    "includes": [
      "custom-typings/*.d.ts"
    ]
  }
}

Contribute

# right after clone
npm install

# begin making changes
git checkout -b <branch>
npm run watch

# edit `webpack.config.dev.js` to exclude dependencies for the global build.

# after making change(s)
git commit -m "<commit message>"
git push

# create PR

Npm Commands

There are a few useful commands you can use during development.

# Run tests (and lint) automatically whenever you save a file.
npm run watch

# Run tests with coverage stats (but won't fail you if coverage does not meet criteria)
npm run test

# Manually verify the project.
# This will be ran during 'npm preversion' so you normally don't need to run this yourself.
npm run verify

# Build the project.
# You normally don't need to do this.
npm run build

# Run tslint
# You normally don't need to do this as `npm run watch` and `npm version` will automatically run lint for you.
npm run lint

Generated by generator-unional@0.0.1

Readme

Keywords

none

Package Sidebar

Install

npm i @unional/assert-order

Weekly Downloads

0

Version

1.1.1

License

MIT

Last publish

Collaborators

  • unional