()
| 780 | // returns the regular expression if there's magic, or the unescaped |
| 781 | // string if not. |
| 782 | toMMPattern() { |
| 783 | if (this !== this.#root) |
| 784 | return this.#root.toMMPattern(); |
| 785 | const glob = this.toString(); |
| 786 | const [re, body, hasMagic, uflag] = this.toRegExpSource(); |
| 787 | const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase(); |
| 788 | if (!anyMagic) { |
| 789 | return body; |
| 790 | } |
| 791 | const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : ""); |
| 792 | return Object.assign(new RegExp(`^${re}$`, flags), { |
| 793 | _src: re, |
| 794 | _glob: glob |
| 795 | }); |
| 796 | } |
| 797 | get options() { |
| 798 | return this.#options; |
| 799 | } |
no test coverage detected