csgo-gamestate-client
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -6,2 +6,10 @@ module.exports = { | ||
testPathIgnorePatterns: ['/node_modules/'], | ||
coverageThreshold: { | ||
global: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: 100, | ||
}, | ||
}, | ||
} |
{ | ||
"name": "csgo-gamestate-client", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"scripts": { | ||
"build": "rimraf ./build && tsc", | ||
"prepublish": "yarn build", | ||
"test": "jest" | ||
"prepare": "yarn build", | ||
"test": "jest --coverage", | ||
"lint": "eslint . --ext .ts", | ||
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write" | ||
}, | ||
"homepage": "https://github.com/Zeikko/csgo-gamestate-client", | ||
"bugs": { | ||
"url": "https://github.com/Zeikko/csgo-gamestate-client/issues" | ||
}, | ||
"keywords": [], | ||
@@ -15,4 +22,11 @@ "author": "Jaakko Ojalehto", | ||
"devDependencies": { | ||
"@types/jest": "^26.0.20", | ||
"@types/node": "^14.14.25", | ||
"@typescript-eslint/eslint-plugin": "^4.15.0", | ||
"@typescript-eslint/parser": "^4.15.0", | ||
"eslint": "^7.19.0", | ||
"eslint-config-prettier": "^7.2.0", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"jest": "^26.6.3", | ||
"prettier": "^2.2.1", | ||
"rimraf": "^3.0.2", | ||
@@ -22,6 +36,3 @@ "ts-jest": "^26.5.1", | ||
"typescript": "^4.1.4" | ||
}, | ||
"dependencies": { | ||
"@types/jest": "^26.0.20" | ||
} | ||
} |
@@ -1,8 +0,8 @@ | ||
import { getGamestate, setGamestate } from './index' | ||
import { parseGameState } from './index' | ||
import { playingGameState } from './fixtures/gamestate' | ||
describe('index.ts', () => { | ||
it('sets gamestate and gets gamestate', () => { | ||
setGamestate('test') | ||
expect(getGamestate()).toEqual('test') | ||
describe('parseGameState', () => { | ||
it('parses gamestate and gets gamestate', () => { | ||
expect(parseGameState(playingGameState)).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
@@ -1,16 +0,7 @@ | ||
interface Gamestate { | ||
export interface GameState { | ||
round: number | ||
} | ||
let gamestate: Gamestate | null = null | ||
export const setGamestate = (newGamestate: string) => { | ||
gamestate = newGamestate | ||
export const parseGameState = (newGameState: string): GameState => { | ||
return JSON.parse(newGameState) as GameState | ||
} | ||
export const getGamestate = (): Gamestate => { | ||
if (gamestate === null) { | ||
throw new Error('Gamestate has not been set yet. Please call "setGamestate" before "getGamestate"') | ||
} | ||
return gamestate | ||
} |
@@ -11,7 +11,10 @@ { | ||
"resolveJsonModule": true, | ||
"rootDir": ".", | ||
"rootDir": "src/", | ||
"strict": true, | ||
"target": "ES2019" | ||
"target": "ES2019", | ||
"declaration": true, | ||
"composite": false, | ||
"declarationMap": true | ||
}, | ||
"exclude": ["node_modules", "**/*.test.ts", "build"] | ||
"exclude": ["node_modules", "**/*.test.ts", "build", "*.js", "coverage/**", "src/fixtures/**"] | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
23747
0
15
513
0
1
1
27
13
1
- Removed@types/jest@^26.0.20
- Removed@jest/types@26.6.2(transitive)
- Removed@types/istanbul-lib-coverage@2.0.6(transitive)
- Removed@types/istanbul-lib-report@3.0.3(transitive)
- Removed@types/istanbul-reports@3.0.4(transitive)
- Removed@types/jest@26.0.24(transitive)
- Removed@types/node@22.10.6(transitive)
- Removed@types/yargs@15.0.19(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removeddiff-sequences@26.6.2(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedjest-diff@26.6.2(transitive)
- Removedjest-get-type@26.3.0(transitive)
- Removedpretty-format@26.6.2(transitive)
- Removedreact-is@17.0.2(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedundici-types@6.20.0(transitive)