Skip to content

Commit 85c1c02

Browse files
👕 refactor: Lint sources.
1 parent 323295a commit 85c1c02

File tree

5 files changed

+479
-1184
lines changed

5 files changed

+479
-1184
lines changed

doc/scripts/header.js

+19-22
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
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 = 'compression-algorithm/lempel-ziv';
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/compression-algorithm/lempel-ziv' ;
24-
testlink.target = '_BLANK' ;
19+
const testlink = document.querySelector('header > a[data-ice="testLink"]');
20+
testlink.href =
21+
'https://coveralls.io/github/compression-algorithm/lempel-ziv';
22+
testlink.target = '_BLANK';
2523

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

29-
// active search box when focus on searchBox.
30-
input.addEventListener('focus', function(){
27+
// Active search box when focus on searchBox.
28+
input.addEventListener('focus', () => {
3129
searchBox.classList.add('active');
3230
});
33-
3431
});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"pinst": "3.0.0",
9494
"power-assert": "1.6.1",
9595
"regenerator-runtime": "0.13.7",
96-
"xo": "0.36.1"
96+
"xo": "0.52.3"
9797
},
9898
"ava": {
9999
"files": [

test/src/lz78.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import test from 'ava';
33
import {mul} from '@aureooms/js-string';
44

55
import {lz78} from '../../src/index.js';
6+
67
const {dict, encode, decode} = lz78;
78

89
const alphabetaL = 'abcdefghijklmnopqrstuvwxyz';
@@ -22,7 +23,8 @@ const macro = (t, init, input) => {
2223
const repr = (string) =>
2324
string.length >= 20 ? string.slice(0, 9) + '..' + string.slice(-9) : string;
2425

25-
macro.title = (title, init, input) => title ?? `lz78 <${init.name}>: ${repr(input)}`;
26+
macro.title = (title, init, input) =>
27+
title ?? `lz78 <${init.name}>: ${repr(input)}`;
2628

2729
for (const init of [initEmpty, initAlphabet]) {
2830
test(macro, init, '');

test/src/readme.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import test from 'ava';
22

33
import {lz78} from '../../src/index.js';
4+
45
const {dict, encode, decode} = lz78;
56

67
test('README', (t) => {

0 commit comments

Comments
 (0)