source: trip-planner-front/node_modules/loader-utils/lib/getOptions.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 398 bytes
Line 
1'use strict';
2
3const parseQuery = require('./parseQuery');
4
5function getOptions(loaderContext) {
6 const query = loaderContext.query;
7
8 if (typeof query === 'string' && query !== '') {
9 return parseQuery(loaderContext.query);
10 }
11
12 if (!query || typeof query !== 'object') {
13 // Not object-like queries are not supported.
14 return {};
15 }
16
17 return query;
18}
19
20module.exports = getOptions;
Note: See TracBrowser for help on using the repository browser.