Skip to content

Commit d5e9fb9

Browse files
committed
Refactor expand.js
* Gruntfile.js: Uncomment expand.js in "jscs:main"
1 parent ee26341 commit d5e9fb9

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module.exports = function createGruntConfig(grunt) {
5353
src: [
5454
'xpi/chrome/content/overlay/overlay.js',
5555
// 'xpi/chrome/content/library/component.js',
56-
// 'xpi/chrome/content/library/expand.js',
56+
'xpi/chrome/content/library/expand.js',
5757
// 'xpi/chrome/content/library/utility.js',
5858
// 'xpi/chrome/content/library/tabWatcher.js',
5959
'xpi/chrome/content/library/repository.js',

xpi/chrome/content/library/expand.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@
44
'use strict';
55

66
Object.defineProperty(Object, 'expand', {
7-
value : function expand(target, props) {
7+
value: function expand(target, props) {
88
return Object.defineProperties(
99
target,
10-
Object.keys(props).reduce((descriptors, propName) => {
11-
return Object.assign(descriptors, {
10+
Object.keys(props).reduce(
11+
(descriptors, propName) => Object.assign(descriptors, {
1212
[propName] : Object.assign(
13-
Object.getOwnPropertyDescriptor(props, propName),
14-
{enumerable : false}
13+
Object.getOwnPropertyDescriptor(props, propName), {
14+
enumerable: false
15+
}
1516
)
16-
});
17-
}, {})
17+
}),
18+
{}
19+
)
1820
);
1921
},
20-
writable : true,
21-
enumerable : false,
22-
configurable : true
22+
writable: true,
23+
enumerable: false,
24+
configurable: true
2325
});
2426

2527
Object.expand(Array, {
@@ -70,6 +72,7 @@
7072
if (typeof target === 'string') {
7173
return Boolean(target);
7274
}
75+
7376
if (
7477
Object.type(target) === 'String' && Object(target) instanceof String
7578
) {

0 commit comments

Comments
 (0)