Skip to content

The actual result of toRegex dosen't match the document,missing symbol ^$ #130

@EAGzzyCSL

Description

@EAGzzyCSL

document example

link: toRegex

const picomatch = require('picomatch');
// picomatch.toRegex(source[, options]);

const { output } = picomatch.parse('*.js');
console.log(picomatch.toRegex(output));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/

actual result

image

missing symbol ^ & $ and with other differences

- /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+ /(?!\.)(?=.)[^/]*?\.js/

version

both v3 and v4

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