File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
explorer-v2/build-system/shim Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 11export default {
22 extname,
33 isAbsolute,
4- join
4+ join,
5+ resolve,
6+ dirname,
7+ basename
58} ;
69
710export function extname ( p ) {
811 return / \. [ ^ . ] * $ / . exec ( p ) ?. [ 0 ] ;
912}
10-
1113export function isAbsolute ( ) {
1214 return false ;
1315}
1416export function join ( ...args ) {
1517 return args . join ( '/' ) ;
1618}
19+ export function resolve ( ...args ) {
20+ return join ( ...args ) ;
21+ }
22+ export function parse ( s ) {
23+ const dir = dirname ( s ) ;
24+ const ext = extname ( s ) ;
25+ const base = basename ( s ) ;
26+ return {
27+ root : '' ,
28+ dir,
29+ base,
30+ ext,
31+ name : basename ( base , ext )
32+ } ;
33+ }
34+ export function dirname ( p ) {
35+ return p . split ( '/' ) . slice ( 0 , - 1 ) . join ( '/' ) || p ;
36+ }
37+ export function basename ( p , ext ) {
38+ const base = p . split ( '/' ) . pop ( ) || p ;
39+ return base . endsWith ( ext ) ? base . slice ( 0 , - ext . length ) : base ;
40+ }
You can’t perform that action at this time.
0 commit comments