mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Adjust _.camelCase, _.kebabCase and _.snakeCase doc examples and tests.
This commit is contained in:
@@ -6921,10 +6921,10 @@
|
|||||||
* _.camelCase('Hello world');
|
* _.camelCase('Hello world');
|
||||||
* // => 'helloWorld'
|
* // => 'helloWorld'
|
||||||
*
|
*
|
||||||
* _.camelCase('hello-world');
|
* _.camelCase('--hello-world');
|
||||||
* // => 'helloWorld'
|
* // => 'helloWorld'
|
||||||
*
|
*
|
||||||
* _.camelCase('hello_world');
|
* _.camelCase('__hello_world__');
|
||||||
* // => 'helloWorld'
|
* // => 'helloWorld'
|
||||||
*/
|
*/
|
||||||
var camelCase = createCompounder(function(result, word, index) {
|
var camelCase = createCompounder(function(result, word, index) {
|
||||||
@@ -7044,7 +7044,7 @@
|
|||||||
* _.kebabCase('helloWorld');
|
* _.kebabCase('helloWorld');
|
||||||
* // => 'hello-world'
|
* // => 'hello-world'
|
||||||
*
|
*
|
||||||
* _.kebabCase('hello_world');
|
* _.kebabCase('__hello_world__');
|
||||||
* // => 'hello-world'
|
* // => 'hello-world'
|
||||||
*/
|
*/
|
||||||
var kebabCase = createCompounder(function(result, word, index) {
|
var kebabCase = createCompounder(function(result, word, index) {
|
||||||
@@ -7198,7 +7198,7 @@
|
|||||||
* _.snakeCase('Hello world');
|
* _.snakeCase('Hello world');
|
||||||
* // => 'hello_world'
|
* // => 'hello_world'
|
||||||
*
|
*
|
||||||
* _.snakeCase('hello-world');
|
* _.snakeCase('--hello-world');
|
||||||
* // => 'hello_world'
|
* // => 'hello_world'
|
||||||
*
|
*
|
||||||
* _.snakeCase('helloWorld');
|
* _.snakeCase('helloWorld');
|
||||||
|
|||||||
@@ -1019,11 +1019,9 @@
|
|||||||
'd', 'n', 'o', 'o', 'o', 'o', 'o', '', 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y'
|
'd', 'n', 'o', 'o', 'o', 'o', 'o', '', 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y'
|
||||||
];
|
];
|
||||||
|
|
||||||
test('`_.' + methodName + '` should convert `string` to ' + caseName + ' case', 3, function() {
|
test('`_.' + methodName + '` should convert `string` to ' + caseName + ' case', 4, function() {
|
||||||
_.forEach(['Hello world', 'helloWorld', 'hello-world', 'hello_world'], function(string) {
|
_.forEach(['Hello world', 'helloWorld', '--hello-world', '__hello_world__'], function(string) {
|
||||||
if (string != expected) {
|
|
||||||
equal(func(string), expected);
|
equal(func(string), expected);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user