function userConfigDir() {
switch (process.platform) {
case 'darwin':
return `${os.homedir()}/Library/Application Support`;
case 'win32':
if (process.env['APPDATA']) {
return process.env['APPDATA'];
} else {
throw new Error('%APPDATA% is not set correctly');
}
case 'aix':
case 'freebsd':
case 'openbsd':
case 'sunos':
case 'linux':
return process.env['XDG_CONFIG_HOME'] || `${os.homedir()}/.config`;
default:
throw new Error(`The platform ${process.platform} is currently unsupported.`);
}
}
[1]: https://pkg.go.dev/os#UserConfigDir
There are a bunch on there that I wouldn't consider states, e.g. both UN/EU are exceptionally reserved and have `.un` and `.eu`. Antarctica also has `.aq`.
The Heard Island and McDonald Islands has `.hm`, and it's not a state (since it has no population) but I guess it is controlled by Australia.