-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from WatWowMap/make-browser-friendly
Enable Browser Compatibility
- Loading branch information
Showing
15 changed files
with
636 additions
and
527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as fs from 'fs' | ||
import { generate, invasions } from './src/index' | ||
import baseStats from './static/baseStats.json' | ||
import tempEvos from './static/tempEvos.json' | ||
import types from './static/types.json' | ||
|
||
const main = async () => { | ||
const start: number = Date.now() | ||
|
||
const data = await generate({ | ||
raw: process.argv.includes('--raw'), | ||
test: process.argv.includes('--test'), | ||
pokeApi: process.argv.includes('--pokeapi') | ||
|| { baseStats, tempEvos, types }, | ||
}) | ||
|
||
if (process.argv.includes('--test')) { | ||
if (process.argv.includes('--invasions')) { | ||
fs.writeFile('./invasions.json', JSON.stringify(await invasions(), null, 2), 'utf8', () => { }) | ||
} | ||
if (data?.AllPokeApi) { | ||
const { baseStats, tempEvos, types } = data.AllPokeApi | ||
fs.writeFile('./static/baseStats.json', JSON.stringify(baseStats, null, 2), 'utf8', () => { }) | ||
fs.writeFile('./static/tempEvos.json', JSON.stringify(tempEvos, null, 2), 'utf8', () => { }) | ||
fs.writeFile('./static/types.json', JSON.stringify(types, null, 2), 'utf8', () => { }) | ||
delete data.AllPokeApi | ||
} | ||
if (data) { | ||
fs.writeFile('./masterfile.json', JSON.stringify(data, null, 2), 'utf8', () => { }) | ||
} | ||
} | ||
return Date.now() - start | ||
} | ||
|
||
main() | ||
.catch((e) => console.log(e)) | ||
.then((time) => console.log('Generated in ', time, 'ms')) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.