forked from zhurui/management
21 lines
400 B
JavaScript
21 lines
400 B
JavaScript
'use strict';
|
|
|
|
const parseQuery = require('./parseQuery');
|
|
|
|
function getOptions(loaderContext) {
|
|
const query = loaderContext.query;
|
|
|
|
if (typeof query === 'string' && query !== '') {
|
|
return parseQuery(loaderContext.query);
|
|
}
|
|
|
|
if (!query || typeof query !== 'object') {
|
|
// Not object-like queries are not supported.
|
|
return null;
|
|
}
|
|
|
|
return query;
|
|
}
|
|
|
|
module.exports = getOptions;
|