Urara-Blog/node_modules/.pnpm-store/v3/files/38/a0b1b7f771c1a576e45b8eb36baba21784d52081dd37a5baabbcc14c0a379238c43a77945c0d6c6e369dc8d44cb6d31960a500dfe195455b264674b70a7596
2022-08-14 01:14:53 +08:00

24 lines
No EOL
458 B
Text

import { resolve } from 'path';
export default function resolvePathAndOptions ( args ) {
let options;
let pathargs;
if ( typeof args[ args.length - 1 ] === 'object' ) {
options = args[ args.length - 1 ];
let i = args.length - 1;
pathargs = new Array( i );
while ( i-- ) {
pathargs[i] = args[i];
}
} else {
options = {};
pathargs = args;
}
const resolvedPath = resolve.apply( null, pathargs );
return { options, resolvedPath };
}