Skip to content

Commit 2fb3ab8

Browse files
🤖 chore: Lint source files.
These changes were automatically generated by a transform whose code can be found at: - https://github.com/aureooms/rejuvenate/blob/17001e676fa44361155baf8a8e44894908dd6c6d/src/transforms/sources:initial-lint.js Please contact the author of the transform if you believe there was an error.
1 parent e804ead commit 2fb3ab8

File tree

8 files changed

+75
-79
lines changed

8 files changed

+75
-79
lines changed

doc/scripts/header.js

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
1-
var domReady = function(callback) {
2-
var state = document.readyState ;
3-
if ( state === 'interactive' || state === 'complete' ) {
4-
callback() ;
5-
}
6-
else {
1+
const domReady = function (callback) {
2+
const state = document.readyState;
3+
if (state === 'interactive' || state === 'complete') {
4+
callback();
5+
} else {
76
document.addEventListener('DOMContentLoaded', callback);
87
}
9-
} ;
10-
8+
};
119

12-
domReady(function(){
13-
14-
var projectname = document.createElement('a');
10+
domReady(() => {
11+
const projectname = document.createElement('a');
1512
projectname.classList.add('project-name');
1613
projectname.text = 'aureooms/js-mapping';
17-
projectname.href = './index.html' ;
14+
projectname.href = './index.html';
1815

19-
var header = document.getElementsByTagName('header')[0] ;
20-
header.insertBefore(projectname,header.firstChild);
16+
const header = document.querySelectorAll('header')[0];
17+
header.insertBefore(projectname, header.firstChild);
2118

22-
var testlink = document.querySelector('header > a[data-ice="testLink"]') ;
23-
testlink.href = 'https://coveralls.io/github/aureooms/js-mapping' ;
24-
testlink.target = '_BLANK' ;
19+
const testlink = document.querySelector('header > a[data-ice="testLink"]');
20+
testlink.href = 'https://coveralls.io/github/aureooms/js-mapping';
21+
testlink.target = '_BLANK';
2522

26-
var searchBox = document.querySelector('.search-box');
27-
var input = document.querySelector('.search-input');
23+
const searchBox = document.querySelector('.search-box');
24+
const input = document.querySelector('.search-input');
2825

29-
// active search box when focus on searchBox.
30-
input.addEventListener('focus', function(){
26+
// Active search box when focus on searchBox.
27+
input.addEventListener('focus', () => {
3128
searchBox.classList.add('active');
3229
});
33-
3430
});

src/fromkeys.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
export default function* fromkeys ( seq , value ) {
3-
4-
for ( let key of seq ) yield [ key , value ] ;
5-
1+
export default function* fromkeys(seq, value) {
2+
for (const key of seq) yield [key, value];
63
}

src/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,4 @@ export default {
99
reflect,
1010
};
1111

12-
export {
13-
fromkeys,
14-
object,
15-
reflect,
16-
};
12+
export {fromkeys, object, reflect};

src/object.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
export default function object ( mapping ) {
1+
export default function object(mapping) {
2+
const object_ = {};
23

3-
const obj = {} ;
4-
5-
for ( const [ key , value ] of mapping ) obj[key] = value ;
6-
7-
return obj ;
4+
for (const [key, value] of mapping) object_[key] = value;
85

6+
return object_;
97
}

src/reflect.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
export default function* reflect ( mapping ) {
3-
4-
for ( const [ key , value ] of mapping ) yield [ value , key ] ;
5-
1+
export default function* reflect(mapping) {
2+
for (const [key, value] of mapping) yield [value, key];
63
}

test/src/fromkeys.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
import test from 'ava' ;
1+
import test from 'ava';
22

3-
import mapping from "../../src/index.js" ;
3+
import mapping, {fromkeys} from '../../src/index.js';
44

5-
import { fromkeys } from "../../src/index.js" ;
5+
test('fromkeys', (t) => {
6+
t.is(fromkeys, mapping.fromkeys, 'exports are working');
67

7-
test( 'fromkeys' , t => {
8+
t.deepEqual([...fromkeys('', 1)], []);
89

9-
t.is( fromkeys , mapping.fromkeys , 'exports are working' ) ;
10-
11-
t.deepEqual( [...fromkeys( '' , 1 )] , []) ;
12-
13-
t.deepEqual( [...fromkeys( 'abcde' , 1 )] , [['a',1],['b',1],['c',1],['d',1],['e',1]]) ;
14-
15-
} ) ;
10+
t.deepEqual(
11+
[...fromkeys('abcde', 1)],
12+
[
13+
['a', 1],
14+
['b', 1],
15+
['c', 1],
16+
['d', 1],
17+
['e', 1],
18+
],
19+
);
20+
});

test/src/object.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
import test from 'ava' ;
1+
import test from 'ava';
22

3-
import mapping from "../../src/index.js" ;
3+
import mapping, {object} from '../../src/index.js';
44

5-
import { object } from "../../src/index.js" ;
5+
test('object', (t) => {
6+
t.is(object, mapping.object, 'exports are working');
67

7-
test( 'object' , t => {
8-
9-
t.is( object , mapping.object , 'exports are working' ) ;
10-
11-
t.deepEqual( object( [] ) , {} ) ;
8+
t.deepEqual(object([]), {});
129

1310
t.deepEqual(
14-
object( [ ['a', 0], ['b', 1], ['c', 2], ['d', 3], ['e', 4]] ) ,
15-
{ 'a': 0 , 'b': 1 , 'c': 2 , 'd': 3 , 'e': 4 }
16-
) ;
17-
18-
} ) ;
11+
object([
12+
['a', 0],
13+
['b', 1],
14+
['c', 2],
15+
['d', 3],
16+
['e', 4],
17+
]),
18+
{a: 0, b: 1, c: 2, d: 3, e: 4},
19+
);
20+
});

test/src/reflect.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
import test from 'ava' ;
1+
import test from 'ava';
22

3-
import { enumerate } from '@aureooms/js-itertools' ;
3+
import {enumerate} from '@aureooms/js-itertools';
44

5-
import mapping from "../../src/index.js" ;
5+
import mapping, {reflect} from '../../src/index.js';
66

7-
import { reflect } from "../../src/index.js" ;
7+
test('reflect', (t) => {
8+
t.is(reflect, mapping.reflect, 'exports are working');
89

9-
test( 'reflect' , t => {
10+
t.deepEqual([...reflect(enumerate(''))], []);
1011

11-
t.is( reflect , mapping.reflect , 'exports are working' ) ;
12-
13-
t.deepEqual( [...reflect( enumerate( '' ) )] , []) ;
14-
15-
t.deepEqual( [...reflect( enumerate( 'abcde' ) )] , [['a',0],['b',1],['c',2],['d',3],['e',4]]) ;
16-
17-
} ) ;
12+
t.deepEqual(
13+
[...reflect(enumerate('abcde'))],
14+
[
15+
['a', 0],
16+
['b', 1],
17+
['c', 2],
18+
['d', 3],
19+
['e', 4],
20+
],
21+
);
22+
});

0 commit comments

Comments
 (0)