Skip to content

Commit

Permalink
cleanup paths helper
Browse files Browse the repository at this point in the history
  • Loading branch information
jwartofsky-yext committed Sep 7, 2023
1 parent 484387d commit 142aadd
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/pages/src/common/src/template/paths.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import path from "node:path";

const winSep = "\\";

/**
* Function that takes a path to a generated template and returns the
* relative path to the root of the site. Will return the empty string
Expand All @@ -23,12 +21,5 @@ export const getRelativePrefixToRootFromPath = (path: string): string => {
* paths are supported with import.
*/
export const convertToPosixPath = (p: string) => {
return p.split(winSep).join(path.posix.sep);
};

/**
* Convert any path to match the format of the OS. If it already matches no change occurs.
*/
export const convertToOSPath = (p: string) => {
return p.split(path.posix.sep).join(path.sep).split(winSep).join(path.sep);
return p.split(path.sep).join(path.posix.sep);
};

0 comments on commit 142aadd

Please sign in to comment.