Skip to content

Commit cf2ce71

Browse files
👕 refactor: Initial lint.
1 parent 0bc1013 commit cf2ce71

File tree

18 files changed

+177
-178
lines changed

18 files changed

+177
-178
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 = 'arithmetic-type/uint32';
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/arithmetic-type/uint32' ;
24-
testlink.target = '_BLANK' ;
19+
const testlink = document.querySelector('header > a[data-ice="testLink"]');
20+
testlink.href = 'https://coveralls.io/github/arithmetic-type/uint32';
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/add32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/**
22
* Adds to 32-bit signed integers.
33
*/
4-
export const add32 = ( a , b ) => ( a + b ) | 0 ;
4+
export const add32 = (a, b) => (a + b) | 0;

‎src/big32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Construct a 32-bit signed integer from 4 bytes.
33
*/
4-
export function big32 (a, o) {
4+
export function big32(a, o) {
55
return (a[o + 0] << 24) | (a[o + 1] << 16) | (a[o + 2] << 8) | a[o + 3];
66
}

‎src/get32.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
* get32(0xFFFFFFFF); // -1
66
*
77
*/
8-
export function get32 ( w ) {
9-
return w | 0 ;
8+
export function get32(w) {
9+
return w | 0;
1010
}

‎src/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export * from './add32.js' ;
2-
export * from './big32.js' ;
3-
export * from './get32.js' ;
4-
export * from './lil32.js' ;
5-
export * from './limits.js' ;
6-
export * from './rotl32.js' ;
7-
export * from './rotr32.js' ;
8-
export * from './sqrt32.js' ;
9-
export * from './usqrt32.js' ;
1+
export * from './add32.js';
2+
export * from './big32.js';
3+
export * from './get32.js';
4+
export * from './lil32.js';
5+
export * from './limits.js';
6+
export * from './rotl32.js';
7+
export * from './rotr32.js';
8+
export * from './sqrt32.js';
9+
export * from './usqrt32.js';

‎src/lil32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export function lil32 (a, o) {
1+
export function lil32(a, o) {
22
return (a[o + 3] << 24) | (a[o + 2] << 16) | (a[o + 1] << 8) | a[o + 0];
33
}

‎src/limits.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { get32 } from './get32.js' ;
1+
import {get32} from './get32.js';
22

33
/** 0 */
4-
export const min = get32(0x00000000) ;
4+
export const min = get32(0x00_00_00_00);
55

66
/** 2^64 - 1 */
7-
export const max = get32(0xFFFFFFFF) ;
7+
export const max = get32(0xff_ff_ff_ff);

‎src/rotl32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
* - used in md5 and sha1
55
*/
66

7-
export function rotl32 (word, shift) {
7+
export function rotl32(word, shift) {
88
return (word << shift) | (word >>> (32 - shift));
99
}

‎src/rotr32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
* Right rotate for 32-bit unsigned integers
33
*/
44

5-
export function rotr32 (word, shift) {
5+
export function rotr32(word, shift) {
66
return (word << (32 - shift)) | (word >>> shift);
77
}

‎src/sqrt32.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export function sqrt32 ( n ) {
2-
return Math.sqrt( n ) | 0 ;
1+
export function sqrt32(n) {
2+
return Math.sqrt(n) | 0;
33
}

0 commit comments

Comments
 (0)