Skip to content

Commit

Permalink
🤖 chore: Lint source files.
Browse files Browse the repository at this point in the history
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
a-flying-potato authored and make-github-pseudonymous-again committed Mar 18, 2021
1 parent e804ead commit 2fb3ab8
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 79 deletions.
40 changes: 18 additions & 22 deletions doc/scripts/header.js
@@ -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');
});

});
7 changes: 2 additions & 5 deletions src/fromkeys.js
@@ -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];
}
6 changes: 1 addition & 5 deletions src/index.js
Expand Up @@ -9,8 +9,4 @@ export default {
reflect,
};

export {
fromkeys,
object,
reflect,
};
export {fromkeys, object, reflect};
10 changes: 4 additions & 6 deletions src/object.js
@@ -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_;
}
7 changes: 2 additions & 5 deletions src/reflect.js
@@ -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];
}
27 changes: 16 additions & 11 deletions test/src/fromkeys.js
@@ -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],
],
);
});
28 changes: 15 additions & 13 deletions test/src/object.js
@@ -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},
);
});
29 changes: 17 additions & 12 deletions test/src/reflect.js
@@ -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],
],
);
});

0 comments on commit 2fb3ab8

Please sign in to comment.