- clone repo and cd into project
- run
yarn
to install dependencies
- add to the root of your project a
.npmrc
file - to that new
.npmrc
file add the line@BrownUniversity:registry=https://npm.pkg.github.com/
- install the library with
yarn add @BrownUniversity/[email protected]
(update the version number to the latest in the repo)
- Open a PR with your addition (please one function per PR). Be sure that:
- New function is in TypeScript
- New function are added to the appropriate file or follow the structure convention of
catagory_name/index.ts
IEstring_formmaters/index.ts
- Exhaustive unit tests are made for the function.
README.md
is updated with the relevant information for the function
requirements: you will need to have a GitHub PAT set to access repo
, write:packages
& delete: packages
selected (at least). Add a line to your .bashrc file
as export GITHUB_TOKEN={the new token}
- Test and verify the new utility and/or changes
- run
yarn build
to compile the code - run
yarn publish
- increment the version number - Good work, enjoy a nice cup of coffee.
Function | Param(s) | Result |
---|---|---|
adjustColor |
string, number | takes a color hex value and a number by how much to adjust it, up to 100 (including negative numbers) |
Function | Param(s) | Result |
---|---|---|
toKebabCase |
string | string in kebab case |
toCamelCase |
string | string in camel case |
capitalize |
string | capitalized string |
Function | Param(s) | Result |
---|---|---|
settingsDateFormat |
date : string, type : "us" or "eu" or "int" |
sets date to specified format |
Function | Param(s) | Result |
---|---|---|
formatTime |
time : string or RegExpMatchArray, militaryTime : boolean |
sets time to 24 hour format when militaryTime is true |
formatTimesWithinString |
string : string, militaryTime : boolean |
sets time from within a string to 24 hour format when militaryTime is true |