M-Scott-Lassiter/Alphanumeric-Encoder

[Feature Request]: Add ability to set default parameters on initial class creation

M-Scott-Lassiter opened this issue ยท 1 comments

Contact Details

No response

Description

Right now, a new copy of the class has to be instantiated and then the parameters manually set. For example:

// Import into a project
const AlphanumericEncoder = require('alphanumeric-encoder')

const encoder = new AlphanumericEncoder()
encoder.allowLowerCaseDictionary = true
encoder.dictionary = 'abcdEFGH'

I would like the ability to simplify this by allowing the user to pass a configuration object like this:

// Import into a project
const AlphanumericEncoder = require('alphanumeric-encoder')

const encoder = new AlphanumericEncoder({allowLowerCaseDictionary: true, dictionary: "abcdEFGH"})

Both of these should be optional parameters with either one or the other passed. When processing, the allowLowerCaseDictionary term should be checked first followed by setting the dictionary.

Associated tests need to be added as well to keep coverage at 100%.

Are you able/willing to make the change? (It's ok if you're not!)

Yes

Code of Conduct

๐ŸŽ‰ This issue has been resolved in version 1.4.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€