Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 120f346

Browse files
authoredMay 12, 2024··
Update libraries (#846)
* Update libraries * Format files
1 parent b2745bb commit 120f346

21 files changed

+1258
-959
lines changed
 

‎.eslintrc.json

-26
This file was deleted.

‎docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ services:
1515
working_dir: /app
1616

1717
server:
18-
image: nginx:1.22.1-alpine
18+
image: nginx:1.25.5-alpine
1919
volumes:
2020
- .:/usr/share/nginx/html

‎eslint.config.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import globals from 'globals'
2+
import js from '@eslint/js'
3+
import eslintConfigPrettier from 'eslint-config-prettier'
4+
import jsdoc from 'eslint-plugin-jsdoc'
5+
import jest from 'eslint-plugin-jest'
6+
7+
export default [
8+
js.configs.recommended,
9+
jsdoc.configs['flat/recommended'],
10+
{
11+
languageOptions: {
12+
ecmaVersion: 13,
13+
sourceType: 'module',
14+
globals: {
15+
...globals.browser,
16+
...globals.node,
17+
},
18+
parserOptions: {
19+
ecmaVersion: 'latest',
20+
},
21+
},
22+
rules: {
23+
'no-constant-condition': ['error', { checkLoops: false }],
24+
},
25+
},
26+
{
27+
files: ['tests/**'],
28+
...jest.configs['flat/recommended'],
29+
},
30+
eslintConfigPrettier,
31+
{
32+
ignores: ['**/onnx_pb.js'],
33+
},
34+
]

‎index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png" />
2424
<link rel="stylesheet" type="text/css" href="/css/main.css?ver=0.2" />
2525
<script src="https://d3js.org/d3.v7.min.js"></script>
26-
<script src="https://unpkg.com/vue@3.2.31"></script>
26+
<script src="https://unpkg.com/vue@3.4.27"></script>
2727
<script>
2828
MathJax = {
2929
tex: {

‎js/data/loader/document.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import 'https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.min.js'
2-
import 'https://cdnjs.cloudflare.com/ajax/libs/encoding-japanese/2.0.0/encoding.min.js'
1+
import * as pdfjs from 'https://cdn.jsdelivr.net/npm/pdfjs-dist@4.2.67/build/pdf.min.mjs'
2+
import 'https://cdnjs.cloudflare.com/ajax/libs/encoding-japanese/2.1.0/encoding.min.js'
33

4-
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.worker.min.js'
4+
pdfjs.GlobalWorkerOptions.workerSrc = 'https://cdn.jsdelivr.net/npm/pdfjs-dist@4.2.67/build/pdf.worker.min.mjs'
55

66
export default class DocumentLoader {
77
/**
@@ -15,10 +15,10 @@ export default class DocumentLoader {
1515
reader.readAsArrayBuffer(data)
1616
reader.onload = () => {
1717
if (data.type === 'application/pdf') {
18-
pdfjsLib
18+
pdfjs
1919
.getDocument({
2020
data: reader.result,
21-
cMapUrl: 'https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/cmaps/',
21+
cMapUrl: 'https://cdn.jsdelivr.net/npm/pdfjs-dist@4.2.67/cmaps/',
2222
cMapPacked: true,
2323
})
2424
.promise.then(async pdf => {

‎js/renderer/image.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default class ImageRenderer extends BaseRenderer {
5555
this._manager.platform._color_space,
5656
this._manager.platform._normalize,
5757
this._manager.platform._binary_threshold
58-
)
58+
)
5959
: data
6060
const d = x[0][0].length
6161

‎js/renderer/rl/gomoku.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ class Gomoku extends Game {
117117
winner === GomokuRLEnvironment.BLACK
118118
? 'BLACK WIN'
119119
: winner === GomokuRLEnvironment.WHITE
120-
? 'WHITE WIN'
121-
: 'DRAW'
120+
? 'WHITE WIN'
121+
: 'DRAW'
122122
}
123123
}
124124

‎js/view/autoencoder.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ var dispAE = function (elm, platform) {
112112
mode === 'AD'
113113
? dispAEad(elm, model, platform)
114114
: mode === 'CT'
115-
? dispAEClt(elm, model, platform)
116-
: dispAEdr(elm, model, platform)
115+
? dispAEClt(elm, model, platform)
116+
: dispAEdr(elm, model, platform)
117117

118118
let rdim = null
119119
if (mode !== 'DR') {

‎lib/model/nns/graph.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ export default class ComputationalGraph {
213213
typeof p.subscript === 'number'
214214
? o[p.index][p.subscript]
215215
: p.subscript !== null
216-
? this._nodes[p.index].layer[p.subscript]
217-
: o[p.index]
216+
? this._nodes[p.index].layer[p.subscript]
217+
: o[p.index]
218218
)
219219
)
220220
l.outputValue = o[i]

‎lib/model/nns/layer/isigmoid.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export default class ImprovedSigmoidLayer extends Layer {
2424
-this._a < v && v < this._a
2525
? 1 / (1 + Math.exp(-v))
2626
: v >= this._a
27-
? sigmap + this._alpha * (v - this._a)
28-
: sigmam + this._alpha * (v + this._a)
27+
? sigmap + this._alpha * (v - this._a)
28+
: sigmam + this._alpha * (v + this._a)
2929
)
3030
return this._o
3131
}

0 commit comments

Comments
 (0)
Please sign in to comment.