Skip to content

Commit

Permalink
👕 refactor: Lint all JavaScript files.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Mar 25, 2021
1 parent 502c19f commit 0ce53f1
Show file tree
Hide file tree
Showing 143 changed files with 1,061 additions and 1,202 deletions.
40 changes: 18 additions & 22 deletions doc/scripts/header.js
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-number';
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-number' ;
testlink.target = '_BLANK' ;
const testlink = document.querySelector('header > a[data-ice="testLink"]');
testlink.href = 'https://coveralls.io/github/aureooms/js-number';
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');
});

});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@
"no-constant-condition": "off",
"unicorn/prefer-math-trunc": "off",
"unicorn/no-new-array": "off",
"prefer-exponentiation-operator": "off",
"no-return-assign": "off",
"no-negated-condition": "off"
},
"overrides": [
Expand Down
2 changes: 1 addition & 1 deletion src/arithmetic/add.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const add = ( a , b ) => a + b ;
export const add = (a, b) => a + b;
2 changes: 1 addition & 1 deletion src/arithmetic/constants/add1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const add1 = n => n + 1 ;
export const add1 = (n) => n + 1;
2 changes: 1 addition & 1 deletion src/arithmetic/constants/div2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const div2 = n => n / 2 ;
export const div2 = (n) => n / 2;
2 changes: 1 addition & 1 deletion src/arithmetic/constants/iadd1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const iadd1 = n => n += 1 ;
export const iadd1 = (n) => (n += 1);
2 changes: 1 addition & 1 deletion src/arithmetic/constants/idiv2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const idiv2 = n => n /= 2 ;
export const idiv2 = (n) => (n /= 2);
2 changes: 1 addition & 1 deletion src/arithmetic/constants/imul2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const imul2 = a => a *= 2 ;
export const imul2 = (a) => (a *= 2);
2 changes: 1 addition & 1 deletion src/arithmetic/constants/imul5.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const imul5 = a => a *= 5 ;
export const imul5 = (a) => (a *= 5);
20 changes: 10 additions & 10 deletions src/arithmetic/constants/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export * from "./add1.js" ;
export * from "./div2.js" ;
export * from "./iadd1.js" ;
export * from "./idiv2.js" ;
export * from "./imul2.js" ;
export * from "./imul5.js" ;
export * from "./isub1.js" ;
export * from "./mul2.js" ;
export * from "./mul5.js" ;
export * from "./sub1.js" ;
export * from './add1.js';
export * from './div2.js';
export * from './iadd1.js';
export * from './idiv2.js';
export * from './imul2.js';
export * from './imul5.js';
export * from './isub1.js';
export * from './mul2.js';
export * from './mul5.js';
export * from './sub1.js';
2 changes: 1 addition & 1 deletion src/arithmetic/constants/isub1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const isub1 = n => n -= 1 ;
export const isub1 = (n) => (n -= 1);
2 changes: 1 addition & 1 deletion src/arithmetic/constants/mul2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const mul2 = a => a * 2 ;
export const mul2 = (a) => a * 2;
2 changes: 1 addition & 1 deletion src/arithmetic/constants/mul5.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const mul5 = a => a * 5 ;
export const mul5 = (a) => a * 5;
2 changes: 1 addition & 1 deletion src/arithmetic/constants/sub1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const sub1 = n => n - 1 ;
export const sub1 = (n) => n - 1;
2 changes: 1 addition & 1 deletion src/arithmetic/div.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const div = ( a , b ) => a / b ;
export const div = (a, b) => a / b;
2 changes: 1 addition & 1 deletion src/arithmetic/divmod.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const divmod = ( a, b ) => [ a / b | 0, a % b ] ;
export const divmod = (a, b) => [(a / b) | 0, a % b];
2 changes: 1 addition & 1 deletion src/arithmetic/iadd.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const iadd = ( a , b ) => a += b ;
export const iadd = (a, b) => (a += b);
2 changes: 1 addition & 1 deletion src/arithmetic/idiv.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const idiv = ( a , b ) => a /= b ;
export const idiv = (a, b) => (a /= b);
8 changes: 3 additions & 5 deletions src/arithmetic/idivmod.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export function idivmod ( a , b ) {

const q = a / b | 0 ;

return [ q , a %= b ] ;
export function idivmod(a, b) {
const q = (a / b) | 0;

return [q, (a %= b)];
}
2 changes: 1 addition & 1 deletion src/arithmetic/imod.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const imod = ( a , b ) => a %= b ;
export const imod = (a, b) => (a %= b);
2 changes: 1 addition & 1 deletion src/arithmetic/imul.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const imul = ( a , b ) => a *= b ;
export const imul = (a, b) => (a *= b);
42 changes: 21 additions & 21 deletions src/arithmetic/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
export * from "./add.js" ;
export * from "./constants/index.js" ;
export * from "./div.js" ;
export * from "./divmod.js" ;
export * from "./iadd.js" ;
export * from "./idiv.js" ;
export * from "./idivmod.js" ;
export * from "./imod.js" ;
export * from "./imul.js" ;
export * from "./ishl.js" ;
export * from "./ishr.js" ;
export * from "./ishu.js" ;
export * from "./isub.js" ;
export * from "./mod.js" ;
export * from "./mul.js" ;
export * from "./neg.js" ;
export * from "./shl.js" ;
export * from "./shr.js" ;
export * from "./shu.js" ;
export * from "./special/index.js" ;
export * from "./sub.js" ;
export * from './add.js';
export * from './constants/index.js';
export * from './div.js';
export * from './divmod.js';
export * from './iadd.js';
export * from './idiv.js';
export * from './idivmod.js';
export * from './imod.js';
export * from './imul.js';
export * from './ishl.js';
export * from './ishr.js';
export * from './ishu.js';
export * from './isub.js';
export * from './mod.js';
export * from './mul.js';
export * from './neg.js';
export * from './shl.js';
export * from './shr.js';
export * from './shu.js';
export * from './special/index.js';
export * from './sub.js';
2 changes: 1 addition & 1 deletion src/arithmetic/ishl.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ishl = ( a , n ) => a <<= n ;
export const ishl = (a, n) => (a <<= n);
2 changes: 1 addition & 1 deletion src/arithmetic/ishr.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ishr = ( a , n ) => a >>= n ;
export const ishr = (a, n) => (a >>= n);
2 changes: 1 addition & 1 deletion src/arithmetic/ishu.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ishu = ( a , n ) => a >>>= n ;
export const ishu = (a, n) => (a >>>= n);
2 changes: 1 addition & 1 deletion src/arithmetic/isub.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const isub = ( a , b ) => a -= b ;
export const isub = (a, b) => (a -= b);
2 changes: 1 addition & 1 deletion src/arithmetic/mod.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const mod = ( a , b ) => a % b ;
export const mod = (a, b) => a % b;
2 changes: 1 addition & 1 deletion src/arithmetic/mul.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const mul = ( a , b ) => a * b ;
export const mul = (a, b) => a * b;
2 changes: 1 addition & 1 deletion src/arithmetic/neg.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const neg = n => -n ;
export const neg = (n) => -n;
2 changes: 1 addition & 1 deletion src/arithmetic/shl.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const shl = ( a , n ) => a << n ;
export const shl = (a, n) => a << n;
2 changes: 1 addition & 1 deletion src/arithmetic/shr.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const shr = ( a , n ) => a >> n ;
export const shr = (a, n) => a >> n;
2 changes: 1 addition & 1 deletion src/arithmetic/shu.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const shu = ( a , n ) => a >>> n ;
export const shu = (a, n) => a >>> n;
2 changes: 1 addition & 1 deletion src/arithmetic/special/div2n.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const div2n = ( a , n ) => a / Math.pow( 2 , n ) ;
export const div2n = (a, n) => a / 2 ** n;
2 changes: 1 addition & 1 deletion src/arithmetic/special/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./div2n.js" ;
export * from './div2n.js';
2 changes: 1 addition & 1 deletion src/arithmetic/sub.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const sub = ( a , b ) => a - b ;
export const sub = (a, b) => a - b;
2 changes: 1 addition & 1 deletion src/compare/decreasing.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const decreasing = ( a , b ) => ( a > b ) ? -1 : ( ( a === b ) ? 0 : 1 ) ;
export const decreasing = (a, b) => (a > b ? -1 : a === b ? 0 : 1);
2 changes: 1 addition & 1 deletion src/compare/increasing.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const increasing = ( a , b ) => ( a < b ) ? -1 : ( ( a === b ) ? 0 : 1 ) ;
export const increasing = (a, b) => (a < b ? -1 : a === b ? 0 : 1);
4 changes: 2 additions & 2 deletions src/compare/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./decreasing.js" ;
export * from "./increasing.js" ;
export * from './decreasing.js';
export * from './increasing.js';
2 changes: 1 addition & 1 deletion src/constants/$0.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const $0 = ( ) => 0 ;
export const $0 = () => 0;
2 changes: 1 addition & 1 deletion src/constants/$1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const $1 = ( ) => 1 ;
export const $1 = () => 1;
2 changes: 1 addition & 1 deletion src/constants/$2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const $2 = ( ) => 2 ;
export const $2 = () => 2;
2 changes: 1 addition & 1 deletion src/constants/$5.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const $5 = ( ) => 5 ;
export const $5 = () => 5;
2 changes: 1 addition & 1 deletion src/constants/$_1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const $_1 = ( ) => -1 ;
export const $_1 = () => -1;
10 changes: 5 additions & 5 deletions src/constants/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from "./$0.js" ;
export * from "./$1.js" ;
export * from "./$2.js" ;
export * from "./$5.js" ;
export * from "./$_1.js" ;
export * from './$0.js';
export * from './$1.js';
export * from './$2.js';
export * from './$5.js';
export * from './$_1.js';
4 changes: 2 additions & 2 deletions src/exponential/constants/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./ipow2.js" ;
export * from "./pow2.js" ;
export * from './ipow2.js';
export * from './pow2.js';
2 changes: 1 addition & 1 deletion src/exponential/constants/ipow2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ipow2 = a => a *= a ;
export const ipow2 = (a) => (a *= a);
2 changes: 1 addition & 1 deletion src/exponential/constants/pow2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const pow2 = a => a * a ;
export const pow2 = (a) => a * a;
2 changes: 1 addition & 1 deletion src/exponential/exp.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const exp = Math.exp ;
export const exp = Math.exp;
8 changes: 4 additions & 4 deletions src/exponential/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./constants/index.js" ;
export * from "./pow.js" ;
export * from "./exp.js" ;
export * from "./sqrt.js" ;
export * from './constants/index.js';
export * from './pow.js';
export * from './exp.js';
export * from './sqrt.js';
2 changes: 1 addition & 1 deletion src/exponential/pow.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const pow = Math.pow ;
export const pow = Math.pow;
2 changes: 1 addition & 1 deletion src/exponential/sqrt.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const sqrt = Math.sqrt ;
export const sqrt = Math.sqrt;
18 changes: 9 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export * from "./arithmetic/index.js" ;
export * from "./compare/index.js" ;
export * from "./constants/index.js" ;
export * from "./exponential/index.js" ;
export * from "./io/index.js" ;
export * from "./logarithmic/index.js" ;
export * from "./memory/index.js" ;
export * from "./predicate/index.js" ;
export * from "./trigonometry/index.js" ;
export * from './arithmetic/index.js';
export * from './compare/index.js';
export * from './constants/index.js';
export * from './exponential/index.js';
export * from './io/index.js';
export * from './logarithmic/index.js';
export * from './memory/index.js';
export * from './predicate/index.js';
export * from './trigonometry/index.js';
4 changes: 2 additions & 2 deletions src/io/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./parse.js" ;
export * from "./stringify.js" ;
export * from './parse.js';
export * from './stringify.js';
2 changes: 1 addition & 1 deletion src/io/parse.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const parse = n => +n ;
export const parse = (n) => Number(n);
2 changes: 1 addition & 1 deletion src/io/stringify.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const stringify = n => n.toString( ) ;
export const stringify = (n) => n.toString();
12 changes: 6 additions & 6 deletions src/logarithmic/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from "./log.js" ;
export * from "./log2.js" ;
export * from "./loge.js" ;
export * from "./loglog.js" ;
export * from "./loglog2.js" ;
export * from "./logloge.js" ;
export * from './log.js';
export * from './log2.js';
export * from './loge.js';
export * from './loglog.js';
export * from './loglog2.js';
export * from './logloge.js';
2 changes: 1 addition & 1 deletion src/logarithmic/log.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const log = ( a , b ) => Math.log( b ) / Math.log( a ) ;
export const log = (a, b) => Math.log(b) / Math.log(a);
2 changes: 1 addition & 1 deletion src/logarithmic/log2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const log2 = n => Math.log2( n ) ;
export const log2 = (n) => Math.log2(n);
2 changes: 1 addition & 1 deletion src/logarithmic/loge.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const loge = n => Math.log( n ) ;
export const loge = (n) => Math.log(n);
3 changes: 2 additions & 1 deletion src/logarithmic/loglog.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const loglog = ( a , b ) => Math.log( Math.log( b ) / Math.log( a ) ) / Math.log( a ) ;
export const loglog = (a, b) =>
Math.log(Math.log(b) / Math.log(a)) / Math.log(a);
2 changes: 1 addition & 1 deletion src/logarithmic/loglog2.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const loglog2 = n => Math.log( Math.log( n ) / Math.log( 2 ) ) / Math.log( 2 ) ;
export const loglog2 = (n) => Math.log(Math.log(n) / Math.log(2)) / Math.log(2);
2 changes: 1 addition & 1 deletion src/logarithmic/logloge.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const logloge = n => Math.log( Math.log( n ) ) ;
export const logloge = (n) => Math.log(Math.log(n));
2 changes: 1 addition & 1 deletion src/memory/copy.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const copy = a => a ;
export const copy = (a) => a;
2 changes: 1 addition & 1 deletion src/memory/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./copy.js" ;
export * from './copy.js';
2 changes: 1 addition & 1 deletion src/predicate/constants/eq0.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const eq0 = n => n === 0 ;
export const eq0 = (n) => n === 0;
2 changes: 1 addition & 1 deletion src/predicate/constants/eq1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const eq1 = n => n === 1 ;
export const eq1 = (n) => n === 1;
2 changes: 1 addition & 1 deletion src/predicate/constants/eq_1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const eq_1 = n => n === -1 ;
export const eq_1 = (n) => n === -1;
2 changes: 1 addition & 1 deletion src/predicate/constants/ge1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ge1 = n => n >= 1 ;
export const ge1 = (n) => n >= 1;
2 changes: 1 addition & 1 deletion src/predicate/constants/gt0.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const gt0 = n => n > 0 ;
export const gt0 = (n) => n > 0;
2 changes: 1 addition & 1 deletion src/predicate/constants/gt1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const gt1 = n => n > 1 ;
export const gt1 = (n) => n > 1;
16 changes: 8 additions & 8 deletions src/predicate/constants/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export * from "./eq0.js" ;
export * from "./eq1.js" ;
export * from "./eq_1.js" ;
export * from "./ge1.js" ;
export * from "./gt0.js" ;
export * from "./gt1.js" ;
export * from "./le1.js" ;
export * from "./lt1.js" ;
export * from './eq0.js';
export * from './eq1.js';
export * from './eq_1.js';
export * from './ge1.js';
export * from './gt0.js';
export * from './gt1.js';
export * from './le1.js';
export * from './lt1.js';
2 changes: 1 addition & 1 deletion src/predicate/constants/le1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const le1 = n => n <= 1 ;
export const le1 = (n) => n <= 1;
Loading

0 comments on commit 0ce53f1

Please sign in to comment.