mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-05 10:59:31 +08:00
24 lines
No EOL
458 B
Text
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 };
|
|
} |