-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: cleanup review #51
Conversation
names: string[], | ||
options: Omit<Josh.Options, 'name'> = {} | ||
): Instances { | ||
public static multi<Instances extends Record<string, Josh> = Record<string, Josh>>(names: string[], options: Josh.Options = {}): Instances { | ||
const instances: Record<string, Josh> = {}; | ||
|
||
for (const [name, instance] of names.map((name) => [name, new Josh({ ...options, name })]) as [string, Josh][]) instances[name] = instance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a provider test to make sure multiple josh instances doesn't fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So like a test in providers that just boots two with different names and makes sure the same named key with different values does return correctly
Also issues in the unit tests |
Yep, that's why it's in the todo to rewrite those. |
This PR is being closed and then being split into multiple PRs due to it's size and clutter. |
This PR includes a workspace wide review. Many changes were made.
Changes
resolveCommonIdentifiers()
function.Josh#error()
andJoshProvider#error()
to utilizeresolveCommonIdentifiers()
Josh#isPayloadWithData()
method to a separate function.Josh#getKeyPath()
toJosh#resolveKeyPath()
Josh#getPath()
toJosh#resolvePath()
Josh#resolveIdentifier()
JoshProvider
to help ensure all providers behave the same.Josh.CommonIdentifiers
enum to a separate file.Value
generic type fromPayloads.SetMany
since this only added issues when actually using the method forcing all values to be the same.path
property fromPayloads.Update
MapProvider
MapProvider
testsJosh