Apply new eslint rules; default to prettier for styling
This commit is contained in:
parent
f22cce8881
commit
dc84af9937
218 changed files with 3876 additions and 3564 deletions
|
@ -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)) : '/';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue