Skip to content

Commit

Permalink
Run format
Browse files Browse the repository at this point in the history
  • Loading branch information
yandeu committed Dec 2, 2024
1 parent 594fb7f commit 690b154
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions client/injected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import { appendPathToUrl } from '../src/helpers'
// manipulates it inside window.addEventListener('load', (...))
let _internalDOMBody

const block = (document.body) ? document.body.hasAttribute('data-server-no-reload') : false;
const block = document.body ? document.body.hasAttribute('data-server-no-reload') : false

if (block) {
console.info('[Five Server] Reload disabled due to \'data-server-no-reload\' attribute on BODY element')
console.info("[Five Server] Reload disabled due to 'data-server-no-reload' attribute on BODY element")
}
if ('WebSocket' in window && !block) {
window.addEventListener('load', () => {
console.log('[Five Server] connecting...')

const script = document.querySelector('[data-id="five-server"]') as HTMLScriptElement
const baseurl = new URL(script.src).pathname.split("/").slice(0,-1).join("/")

const baseurl = new URL(script.src).pathname.split('/').slice(0, -1).join('/')
const protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'
const address = appendPathToUrl(`${protocol}${new URL(script.src).host}${baseurl}`, 'fsws')

Expand Down Expand Up @@ -191,7 +191,7 @@ if ('WebSocket' in window && !block) {
const addDiffDOM = (): Promise<void> => {
_diffDOMStatus = 'loading'
return new Promise(resolve => {
const baseurl = new URL(script.src).pathname.split("/").slice(0,-1).join("/")
const baseurl = new URL(script.src).pathname.split('/').slice(0, -1).join('/')
const url = `//${new URL(script.src).host}${baseurl}/fiveserver/scripts/diffDOM.js`
const s = document.createElement('script')
s.type = 'text/javascript'
Expand Down Expand Up @@ -411,7 +411,7 @@ if ('WebSocket' in window && !block) {
statusChecks++
const p = new URL(script.src).protocol
const h = new URL(script.src).host
const baseurl = new URL(script.src).pathname.split("/").slice(0,-1).join("/")
const baseurl = new URL(script.src).pathname.split('/').slice(0, -1).join('/')

const url = `${p}//${h}${baseurl}/fiveserver/status`

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"build": "npm run extract && tsc && webpack --config webpack.client.cjs",
"clean": "rimraf lib",
"prune": "rimraf .cache coverage lib node_modules package-lock.json",
"format": "prettier --check src/**",
"format:write": "prettier --write src/**",
"format": "prettier --check src/** client/**",
"format:write": "prettier --write src/** client/**",
"lint": "eslint src --ext .ts,.tsx",
"lint:fix": "eslint --fix src --ext .ts,.tsx",
"extract": "extract version name src/const.ts",
Expand Down Expand Up @@ -93,4 +93,4 @@
"funding": {
"url": "https://github.com/sponsors/yandeu"
}
}
}

0 comments on commit 690b154

Please sign in to comment.