mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 21:07:49 +00:00
chore: apply eslint to all modified files
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user