You can find the documentation here
Installation
You will need an NPM access token to access this repo.
Simply run the following to install:
yarn add @harvest-profit/model-helpers
Usage
To use this package, just give it a try!
import { Contract } from '@harvest-profit/model-helpers';
const contractUrl = Contract.translateContractTypeToName('hedge_to_arrive');
console.log(contractUrl);
Additional Notes
You should NEVER be checking what type the contract is, or setting the contract type without using the module defined types. Example:
if (contract.type_name === 'cashsale') {
}
if (Contract.isCashSaleType(contract.type_name)) {
}
Development
Clone this repo, and begin committing changes. PRs are preferred over committing directly to master.
To run tests locally on your machine, run the following:
yarn run test
To preview documentation locally on your machine, run the following:
yarn run build-docs
After merging your pull request, consider updating the documentation with the following command:
yarn run publish-docs
Publishing
This package is published as a Private NPM Module.
To publish to the private NPM registry, simply run the following, after bumping the package.json
version:
yarn publish
npm publish
License
Copyright 2017-Present Harvest Profit.
This repo contains private code. No copying or external use permitted.