mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 16:35:14 +00:00
21 lines
398 B
JavaScript
21 lines
398 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 {};
|
|
}
|
|
|
|
return query;
|
|
}
|
|
|
|
module.exports = getOptions;
|