lanan-old/rescue-user/node_modules/loader-utils/lib/getOptions.js
愉快的大福 7dc28dc701 init
2024-07-17 14:16:22 +08:00

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;