Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Extraneous spaces not skipped #20

@vitaly-t

Description

@vitaly-t

Is the following an expected result or a bug?

ObjectPath.parse(`[123]['one two']`); //=> [ '123', 'one two' ]

ObjectPath.parse(`[ 123 ][ 'one two' ]`); //=> [ ' 123 ', " 'one two' " ]

I thought the result for the two inputs would be identical, i.e. the second should produce the same output as the first one, because the extra spaces carry no significance, and from JavaScript syntax point of view, the two inputs are the same thing.

I am inclined to think it is a bug, because if we encounter such path, let's say in HTML, we cannot just remove spaces from it, because 'one two' would incorrectly merge into 'onetwo' then.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions