mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 12:27:49 +00:00
Fix style nits.
This commit is contained in:
1
.jscsrc
1
.jscsrc
@@ -77,7 +77,6 @@
|
|||||||
"disallowKeywords": ["with"],
|
"disallowKeywords": ["with"],
|
||||||
"disallowMixedSpacesAndTabs": true,
|
"disallowMixedSpacesAndTabs": true,
|
||||||
"disallowMultipleLineBreaks": true,
|
"disallowMultipleLineBreaks": true,
|
||||||
"disallowMultipleLineStrings": true,
|
|
||||||
"disallowNewlineBeforeBlockStatements": true,
|
"disallowNewlineBeforeBlockStatements": true,
|
||||||
"disallowSpaceAfterObjectKeys": true,
|
"disallowSpaceAfterObjectKeys": true,
|
||||||
"disallowSpaceAfterPrefixUnaryOperators": true,
|
"disallowSpaceAfterPrefixUnaryOperators": true,
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ function build(target) {
|
|||||||
var actions = modulePaths.map(function(modulePath) {
|
var actions = modulePaths.map(function(modulePath) {
|
||||||
var moduleName = path.basename(modulePath, '.js');
|
var moduleName = path.basename(modulePath, '.js');
|
||||||
return _.partial(fs.writeFile, path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
|
return _.partial(fs.writeFile, path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
|
||||||
})
|
});
|
||||||
|
|
||||||
actions.unshift(_.partial(fs.copy, path.join(__dirname, '../../fp'), fpPath));
|
actions.unshift(_.partial(fs.copy, path.join(__dirname, '../../fp'), fpPath));
|
||||||
actions.push(_.partial(fs.writeFile, path.join(target, 'fp.js'), template.fp()));
|
actions.push(_.partial(fs.writeFile, path.join(target, 'fp.js'), template.fp()));
|
||||||
|
|||||||
18
test/test.js
18
test/test.js
@@ -543,11 +543,11 @@
|
|||||||
' };',
|
' };',
|
||||||
'',
|
'',
|
||||||
" ['" + typedArrays.join("', '") + "'].forEach(function(type) {",
|
" ['" + typedArrays.join("', '") + "'].forEach(function(type) {",
|
||||||
" var Ctor = root[type]",
|
' var Ctor = root[type]',
|
||||||
' if (Ctor) {',
|
' if (Ctor) {',
|
||||||
" object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));",
|
' object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));',
|
||||||
' }',
|
' }',
|
||||||
" });",
|
' });',
|
||||||
'',
|
'',
|
||||||
' return object;',
|
' return object;',
|
||||||
'}())'
|
'}())'
|
||||||
@@ -593,7 +593,7 @@
|
|||||||
"_.each(['" + typedArrays.join("', '") + "'], function(type) {",
|
"_.each(['" + typedArrays.join("', '") + "'], function(type) {",
|
||||||
' var Ctor = root[type];',
|
' var Ctor = root[type];',
|
||||||
' if (Ctor) {',
|
' if (Ctor) {',
|
||||||
" object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));",
|
' object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));',
|
||||||
' }',
|
' }',
|
||||||
'});',
|
'});',
|
||||||
'',
|
'',
|
||||||
@@ -2367,7 +2367,7 @@
|
|||||||
'undefined values': undefined
|
'undefined values': undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
objects['arrays'].length = 3;
|
objects.arrays.length = 3;
|
||||||
|
|
||||||
var uncloneable = {
|
var uncloneable = {
|
||||||
'DOM elements': body,
|
'DOM elements': body,
|
||||||
@@ -2642,7 +2642,9 @@
|
|||||||
var props = [];
|
var props = [];
|
||||||
|
|
||||||
var objects = lodashStable.transform(_, function(result, value, key) {
|
var objects = lodashStable.transform(_, function(result, value, key) {
|
||||||
if (lodashStable.startsWith(key, '_') && lodashStable.isObject(value) && !lodashStable.isArguments(value) && !lodashStable.isElement(value) && !lodashStable.isFunction(value)) {
|
if (lodashStable.startsWith(key, '_') && lodashStable.isObject(value) &&
|
||||||
|
!lodashStable.isArguments(value) && !lodashStable.isElement(value) &&
|
||||||
|
!lodashStable.isFunction(value)) {
|
||||||
props.push(lodashStable.capitalize(lodashStable.camelCase(key)));
|
props.push(lodashStable.capitalize(lodashStable.camelCase(key)));
|
||||||
result.push(value);
|
result.push(value);
|
||||||
}
|
}
|
||||||
@@ -2664,7 +2666,7 @@
|
|||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var object = objects['objects'],
|
var object = objects.objects,
|
||||||
actual = _(object)[methodName]();
|
actual = _(object)[methodName]();
|
||||||
|
|
||||||
assert.deepEqual(actual, object);
|
assert.deepEqual(actual, object);
|
||||||
@@ -21747,7 +21749,7 @@
|
|||||||
|
|
||||||
lodashStable.each(['uniq', 'uniqBy', 'uniqWith', 'sortedUniq', 'sortedUniqBy'], function(methodName) {
|
lodashStable.each(['uniq', 'uniqBy', 'uniqWith', 'sortedUniq', 'sortedUniqBy'], function(methodName) {
|
||||||
var func = _[methodName],
|
var func = _[methodName],
|
||||||
isSorted = /^sorted/.test(methodName);
|
isSorted = /^sorted/.test(methodName),
|
||||||
objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }, { 'a': 2 }, { 'a': 3 }, { 'a': 1 }];
|
objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }, { 'a': 2 }, { 'a': 3 }, { 'a': 1 }];
|
||||||
|
|
||||||
if (isSorted) {
|
if (isSorted) {
|
||||||
|
|||||||
Reference in New Issue
Block a user