chore: apply eslint to all modified files

This commit is contained in:
Corbin Crutchley
2021-11-30 17:20:07 -08:00
parent 63723b6183
commit e8b905a44e
26 changed files with 675 additions and 580 deletions

View File

@@ -1,22 +1,20 @@
import {join} from "path";
import slash from "slash";
/**
* Matches:
* - ftp://
* - https://
* - //
*/
export const absolutePathRegex = /^(?:[a-z]+:)?\/\//;
export const isRelativePath = (str: string) => {
const isAbsolute = absolutePathRegex.exec(str);
if (isAbsolute) return false;
return true;
}
export const getFullRelativePath = (slug: string, srcStr: string) => {
return isRelativePath(srcStr) ?
slash(join('/posts', slug, srcStr))
: srcStr
}
import { join } from "path";
import slash from "slash";
/**
* Matches:
* - ftp://
* - https://
* - //
*/
export const absolutePathRegex = /^(?:[a-z]+:)?\/\//;
export const isRelativePath = (str: string) => {
const isAbsolute = absolutePathRegex.exec(str);
if (isAbsolute) return false;
return true;
};
export const getFullRelativePath = (slug: string, srcStr: string) => {
return isRelativePath(srcStr) ? slash(join("/posts", slug, srcStr)) : srcStr;
};