WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

" compiles to \" which prevent using npm:regex library #7777

@hackwaly

Description

@hackwaly
@unboxed
type interpolation =
  | S(string)
  | R(RegExp.t)

@module("regex") @taggedTemplate
external regex: (array<string>, array<interpolation>) => RegExp.t = "regex"

Console.log(regex`"`) // This compiles to "console.log(regex`\"`)" which causes "Invalid regular expression: invalid escaped character for Unicode pattern: /\"/v"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions