Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
e804ead
commit 2fb3ab8
Showing
8 changed files
with
75 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
var domReady = function(callback) { | ||
var state = document.readyState ; | ||
if ( state === 'interactive' || state === 'complete' ) { | ||
callback() ; | ||
} | ||
else { | ||
const domReady = function (callback) { | ||
const state = document.readyState; | ||
if (state === 'interactive' || state === 'complete') { | ||
callback(); | ||
} else { | ||
document.addEventListener('DOMContentLoaded', callback); | ||
} | ||
} ; | ||
|
||
}; | ||
|
||
domReady(function(){ | ||
|
||
var projectname = document.createElement('a'); | ||
domReady(() => { | ||
const projectname = document.createElement('a'); | ||
projectname.classList.add('project-name'); | ||
projectname.text = 'aureooms/js-mapping'; | ||
projectname.href = './index.html' ; | ||
projectname.href = './index.html'; | ||
|
||
var header = document.getElementsByTagName('header')[0] ; | ||
header.insertBefore(projectname,header.firstChild); | ||
const header = document.querySelectorAll('header')[0]; | ||
header.insertBefore(projectname, header.firstChild); | ||
|
||
var testlink = document.querySelector('header > a[data-ice="testLink"]') ; | ||
testlink.href = 'https://coveralls.io/github/aureooms/js-mapping' ; | ||
testlink.target = '_BLANK' ; | ||
const testlink = document.querySelector('header > a[data-ice="testLink"]'); | ||
testlink.href = 'https://coveralls.io/github/aureooms/js-mapping'; | ||
testlink.target = '_BLANK'; | ||
|
||
var searchBox = document.querySelector('.search-box'); | ||
var input = document.querySelector('.search-input'); | ||
const searchBox = document.querySelector('.search-box'); | ||
const input = document.querySelector('.search-input'); | ||
|
||
// active search box when focus on searchBox. | ||
input.addEventListener('focus', function(){ | ||
// Active search box when focus on searchBox. | ||
input.addEventListener('focus', () => { | ||
searchBox.classList.add('active'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
|
||
export default function* fromkeys ( seq , value ) { | ||
|
||
for ( let key of seq ) yield [ key , value ] ; | ||
|
||
export default function* fromkeys(seq, value) { | ||
for (const key of seq) yield [key, value]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,4 @@ export default { | |
reflect, | ||
}; | ||
|
||
export { | ||
fromkeys, | ||
object, | ||
reflect, | ||
}; | ||
export {fromkeys, object, reflect}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
export default function object ( mapping ) { | ||
export default function object(mapping) { | ||
const object_ = {}; | ||
|
||
const obj = {} ; | ||
|
||
for ( const [ key , value ] of mapping ) obj[key] = value ; | ||
|
||
return obj ; | ||
for (const [key, value] of mapping) object_[key] = value; | ||
|
||
return object_; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
|
||
export default function* reflect ( mapping ) { | ||
|
||
for ( const [ key , value ] of mapping ) yield [ value , key ] ; | ||
|
||
export default function* reflect(mapping) { | ||
for (const [key, value] of mapping) yield [value, key]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
import test from 'ava' ; | ||
import test from 'ava'; | ||
|
||
import mapping from "../../src/index.js" ; | ||
import mapping, {fromkeys} from '../../src/index.js'; | ||
|
||
import { fromkeys } from "../../src/index.js" ; | ||
test('fromkeys', (t) => { | ||
t.is(fromkeys, mapping.fromkeys, 'exports are working'); | ||
|
||
test( 'fromkeys' , t => { | ||
t.deepEqual([...fromkeys('', 1)], []); | ||
|
||
t.is( fromkeys , mapping.fromkeys , 'exports are working' ) ; | ||
|
||
t.deepEqual( [...fromkeys( '' , 1 )] , []) ; | ||
|
||
t.deepEqual( [...fromkeys( 'abcde' , 1 )] , [['a',1],['b',1],['c',1],['d',1],['e',1]]) ; | ||
|
||
} ) ; | ||
t.deepEqual( | ||
[...fromkeys('abcde', 1)], | ||
[ | ||
['a', 1], | ||
['b', 1], | ||
['c', 1], | ||
['d', 1], | ||
['e', 1], | ||
], | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import test from 'ava' ; | ||
import test from 'ava'; | ||
|
||
import mapping from "../../src/index.js" ; | ||
import mapping, {object} from '../../src/index.js'; | ||
|
||
import { object } from "../../src/index.js" ; | ||
test('object', (t) => { | ||
t.is(object, mapping.object, 'exports are working'); | ||
|
||
test( 'object' , t => { | ||
|
||
t.is( object , mapping.object , 'exports are working' ) ; | ||
|
||
t.deepEqual( object( [] ) , {} ) ; | ||
t.deepEqual(object([]), {}); | ||
|
||
t.deepEqual( | ||
object( [ ['a', 0], ['b', 1], ['c', 2], ['d', 3], ['e', 4]] ) , | ||
{ 'a': 0 , 'b': 1 , 'c': 2 , 'd': 3 , 'e': 4 } | ||
) ; | ||
|
||
} ) ; | ||
object([ | ||
['a', 0], | ||
['b', 1], | ||
['c', 2], | ||
['d', 3], | ||
['e', 4], | ||
]), | ||
{a: 0, b: 1, c: 2, d: 3, e: 4}, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
import test from 'ava' ; | ||
import test from 'ava'; | ||
|
||
import { enumerate } from '@aureooms/js-itertools' ; | ||
import {enumerate} from '@aureooms/js-itertools'; | ||
|
||
import mapping from "../../src/index.js" ; | ||
import mapping, {reflect} from '../../src/index.js'; | ||
|
||
import { reflect } from "../../src/index.js" ; | ||
test('reflect', (t) => { | ||
t.is(reflect, mapping.reflect, 'exports are working'); | ||
|
||
test( 'reflect' , t => { | ||
t.deepEqual([...reflect(enumerate(''))], []); | ||
|
||
t.is( reflect , mapping.reflect , 'exports are working' ) ; | ||
|
||
t.deepEqual( [...reflect( enumerate( '' ) )] , []) ; | ||
|
||
t.deepEqual( [...reflect( enumerate( 'abcde' ) )] , [['a',0],['b',1],['c',2],['d',3],['e',4]]) ; | ||
|
||
} ) ; | ||
t.deepEqual( | ||
[...reflect(enumerate('abcde'))], | ||
[ | ||
['a', 0], | ||
['b', 1], | ||
['c', 2], | ||
['d', 3], | ||
['e', 4], | ||
], | ||
); | ||
}); |