Skip to content

[feature-request] Parsing a number in query #173

@cdoublev

Description

@cdoublev

Hello,

I would like to sugget parsing a Number in the value of a query parameter used to set options of a loader.

 if (specialValues.hasOwnProperty(value)) {
     value = specialValues[value];
- }
+ } else if (/^\d$/.test(value) {
+     value = Number(value)
+ }

if (specialValues.hasOwnProperty(value)) {

Is there a reason to parse a Boolean but not a Number? Performances?

Eg. css-loader?importLoaders=true works but not css-loader?importLoaders=1.

Note that having css-loader?importLoaders=true not throwing an error is also confusing, since the css-loader doc states that only a Number is expected. Please feel free to ask me to create a new issue in the related repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions