UNPKG

@apidevtools/json-schema-ref-parser

Version:

Parse, Resolve, and Dereference JSON Schema $ref pointers

12 lines (8 loc) 284 B
import path from "path"; export default function convertPathToPosix(filePath: string) { const isExtendedLengthPath = filePath.startsWith("\\\\?\\"); if (isExtendedLengthPath) { return filePath; } return filePath.split(path?.win32?.sep).join(path?.posix?.sep ?? "/"); }