biofriction-wp-theme/node_modules/loader-utils/lib/getOptions.js

18 lines
383 B
JavaScript
Raw Permalink Normal View History

2021-10-26 14:18:09 +02: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 null;
}
return query;
}
module.exports = getOptions;