23 karma · joined Jul 25, 2015 (11y ago) · 7 submissions
comment 2y ago · link · parent
type NonEmpty<T> = [T, ...T[]]
const head = <T>(list: NonEmpty<T>) => list[0]
function getConfigurationDirectories(): NonEmpty<string> {
const configDirsString = process.env["CONFIG_DIRS"]
const [firstDir, ...restDirs] = configDirsString.split(',')
if (firstDir === undefined) throw Error("CONFIG_DIRS cannot be empty");
return [firstDir, ...restDirs];
}
function main() {
const configDirs = getConfigurationDirectories();
initializeCache(head(configDirs))
}comment 2y ago · link · parent
Take a look at https://docs.boardzilla.io/game/flow to see how it looks.
comment 2y ago · link · parent
No, we haven't done much to secure the online playing experience for strangers other than simply enforcing the rules of the game. We've been so far more focused on the API side of building game than the service side of having customers, but these are all on our radar as table stakes to make this an nice experience for random players.