Skip to content

Commit

Permalink
cleanup: clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
junlarsen committed Jan 18, 2020
1 parent 8b9a3b1 commit 5e1281e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "league-connect",
"version": "1.1.0",
"version": "2.0.0",
"description": "Tiny package for connecting with the League Client APIs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"scripts": {
"compile": "tsc",
"test": "jest",
"prepare": "tsc"
"prepare": "tsc",
"watch": "tsc --watch"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function auth(): Promise<Credentials> {
const cmd = process.platform === 'win32' ? 'WMIC PROCESS WHERE name=\'LeagueClientUx.exe\' GET CommandLine' : 'ps x -o args | grep \'LeagueClientUx\''

const { stdout } = await exec(cmd)
const [path] = stdout.match(re) || []
const [_, path] = stdout.match(re) || []

try {
const content = await fs.readFile(`${path}/lockfile`, 'utf8')
Expand Down
2 changes: 1 addition & 1 deletion src/actions/websocket.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { auth, Credentials } from '..'
import { LeagueWebSocket } from '..'

export async function connect(credentials: Credentials | null = null): Promise<LeagueWebSocket> {
export async function connect(credentials: Credentials | undefined = undefined): Promise<LeagueWebSocket> {
const creds = credentials || await auth()

const socket = new LeagueWebSocket(`wss://riot:${creds.token}@127.0.0.1:${creds.port}`, {
Expand Down
3 changes: 1 addition & 2 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import WebSocket from 'ws'
import { Response } from 'node-fetch'
import * as Connector from '../src'

Expand Down Expand Up @@ -26,7 +25,7 @@ describe('grabbing and using credentials', () => {
const conn = await Connector.auth()
const ws = await Connector.connect(conn)

expect(ws).toBeInstanceOf(WebSocket)
expect(ws).toBeInstanceOf(Connector.LeagueWebSocket)

ws.on('open', () => {
ws.close()
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"strict": true,
"declaration": true,
Expand Down

0 comments on commit 5e1281e

Please sign in to comment.