Apply new eslint rules; default to prettier for styling

This commit is contained in:
DaneEveritt 2022-06-26 15:13:52 -04:00
parent f22cce8881
commit dc84af9937
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
218 changed files with 3876 additions and 3564 deletions

View file

@ -2,7 +2,7 @@ export const randomInt = (low: number, high: number) => Math.floor(Math.random()
export const cleanDirectoryPath = (path: string) => path.replace(/(\/(\/*))|(^$)/g, '/');
export function fileBitsToString (mode: string, directory: boolean): string {
export function fileBitsToString(mode: string, directory: boolean): string {
const m = parseInt(mode, 8);
let buf = '';
@ -37,10 +37,13 @@ export function fileBitsToString (mode: string, directory: boolean): string {
* This allows to use the path as part of a URL while preserving the slashes.
* @param path the path to encode
*/
export function encodePathSegments (path: string): string {
return path.split('/').map(s => encodeURIComponent(s)).join('/');
export function encodePathSegments(path: string): string {
return path
.split('/')
.map((s) => encodeURIComponent(s))
.join('/');
}
export function hashToPath (hash: string): string {
export function hashToPath(hash: string): string {
return hash.length > 0 ? decodeURIComponent(hash.substr(1)) : '/';
}