the-forest/client/node_modules/loader-utils/lib/getOptions.js

21 lines
398 B
JavaScript
Raw Normal View History

2024-09-17 20:35:18 -04:00
'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;