UNPKG

ipfs-unixfs-importer

Version:

JavaScript implementation of the UnixFs importer used by IPFS

8 lines (7 loc) 192 B
export const toPathComponents = (path: string = ''): string[] => { // split on / unless escaped with \ return (path .trim() .match(/([^\\/]|\\\/)+/g) ?? []) .filter(Boolean) }