This minimizes side effects of import/require across the codebase,
and lets the caller be responsible of initializing child processeses,
as well as other async logic, such as restoring saved battles.
As explicitly documented in `CONTRIBUTING.md`, we are against multiline
template strings. While I see the advantages in readability for the
multiline approach, I'd rather not send extraneous whitespace to the
database.
* Refactor Teams.save
Fixes a bug where passwords were changed every time a team was updated.
* Refactor Teams to use lib/database
* Add unit tests
(This found a bug which has also been fixed)
* Test more things
---------
Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
* Fix typo
* Remove unnessecary file
* Use URL API
Clears this warning
```
(node:44968) [DEP0169] DeprecationWarning: `url.parse()`
behavior is not standardized and prone to errors that have
security implications. Use the WHATWG URL API instead. CVEs are
not issued for `url.parse()` vulnerabilities.
```
---------
Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
Co-authored-by: HoeenHero <HoeenCoder@users.noreply.github.com>
Also includes a decent amount of refactoring to bring it in line with Showdown code standards.
---------
Co-authored-by: Slayer95 <ivojulca@hotmail.com>
boolean -> number and number -> string should be explicit. Probably
string -> number should be, too, but I'm not ready to turn on the lint
option yet.
This was supposed to be part of the big ESLint refactor but I forgot
to push it. <_<
ESLint has a whole new config format, so I figure it's a good time to
make the config system saner.
- First, we no longer have separate eslint-no-types configs. Lint
performance shouldn't be enough of a problem to justify the
relevant maintenance complexity.
- Second, our base config should work out-of-the-box now. `npx eslint`
will work as expected, without any CLI flags. You should still use
`npm run lint` which adds the `--cached` flag for performance.
- Third, whatever updates I did fixed style linting, which apparently
has been bugged for quite some time, considering all the obvious
mixed-tabs-and-spaces issues I found in the upgrade.
Also here are some changes to our style rules. In particular:
- Curly brackets (for objects etc) now have spaces inside them. Sorry
for the huge change. ESLint doesn't support our old style, and most
projects use Prettier style, so we might as well match them in this way.
See https://github.com/eslint-stylistic/eslint-stylistic/issues/415
- String + number concatenation is no longer allowed. We now
consistently use template strings for this.
* Sim: Use a CSPRNG
* Add test
* fix test prng
* move prng test to others
* fix slight hack
* tf?
* Fuck this
* fucking lol
* fix crap
* i'm going to kill someone
* i hate state
* fix test
* Good work genius
* typo
* Fix exportinputlog
* Refactor for inputlog backwards compatibility
This is a pretty major refactor which is mostly unrelated to the
feature, but it does make the code a lot simpler.
* Readability pass
* Readability (again)
* Remove sodium-native dependency
* Refactor to serialize seeds in hex strings
(Also removes the Buffer dependency from PRNG, and slightly improves
comments.)
* Apparently << is 32-bit signed
* Readability
---------
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
Previously, this was limited by a depth check that always got hit, meaning it never fully properly cleaned out the module tree (most likely due to the fact the uncacheModuleTree call would loop around to the same module through recursion, meaning mod.children never got deleted, so it never stopped looping). This commit fixes that.
The problem is that we were cleaning up old REPL sockets after
launching new ones. This moves the cleanup step to before Artemis
and Friends processes are launched.
We're hunting ~~wabbits~~ validator bugs.
Honestly, this has been a long time coming, but Object.freeze perf
used to not be good enough for us to use it here. Here's hoping!