Skip to content

The scan method returns empty parts for pattern with only a forward slash #58

Open
@mrmlnc

Description

@mrmlnc

Environment

  • Windows 10
  • Node.js 12.13
  • picomatch@master

Code sample

const pm = require('.');

const a = pm.scan('/', { parts: true }).parts;

console.dir(a, { colors: true });

const b = pm.isMatch('/', '/');

console.dir(b, { colors: true });

Expected behaviour

['', '']

I expect to see a representation of the pattern with each of its segments. Without empty parts of the pattern, we will not be able to apply it correctly.

For example, the current pattern must be matched only for / (left side — <empty>, right side — <empty>).

Actual behaviour

[]

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