-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Add option to disable the platform locale #92
Conversation
} else { | ||
input = input.toLocaleLowerCase(); | ||
input = toLowerCase(input); |
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.
I think this fixes a bug "by accident" where the locale hasn't been applied previously.
Object.defineProperty(String.prototype, 'toLocaleLowerCase', toLocaleLowerCase); | ||
} | ||
}; | ||
/* eslint-enable no-extend-native */ |
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.
I tried to separate this mocking setup from the rest of the test. I'm not sure if you agree with this style of mocking String.prototype functions. Another solution would be to spin up a separate Node process with tr-TR
as locale but I thought that would be a bigger change.
readme.md
Outdated
//=> 'loremİpsum' | ||
|
||
camelCase('lorem-ipsum', {locale: false}); // ignore platform locale | ||
//=> 'loremIpsum' |
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.
I don't think these additions are needed. It's enough to document it at the API docs for the option.
You also need to update index.d.ts |
I've updated the PR, ready to be reviewed again :) |
As discussed in sindresorhus/camelcase-keys#81