Converted code to class-style so it can accept custom abbreviations. #3

Merged
merged 1 commit into from Feb 7, 2014

Projects

None yet

2 participants

@bostrt
Contributor
bostrt commented Feb 7, 2014

Okay, sorry about that last attempt at a pull request; this one is good.

Changes include converting code to use a class instead of a function which allows for a custom list of abbreviations (e.g. "GB", "MB", "grand", etc).

@domharrington domharrington merged commit f5b79fc into domharrington:master Feb 7, 2014

1 check failed

default The Travis CI build could not complete due to an error
Details
@domharrington
Owner

Thanks again for this. I think our editors must be vastly different in configuration. Running npm test in the repo will ensure that the travis build passes and the coding style is adhered to.

This could have also been done without using prototypal inheritance but im happy with either.

I also added the ability to be able to instantiate without the new keyword. See:
https://github.com/domharrington/js-number-abbreviate/blob/master/index.js#L5
https://github.com/domharrington/js-number-abbreviate/blob/master/test.js#L35-L41

This has been published as version 0.0.3

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment