Last change
on this file since 8d391a1 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 |
|
---|
3 | const parseQuery = require('./parseQuery');
|
---|
4 |
|
---|
5 | function 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 |
|
---|
20 | module.exports = getOptions;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.