Closed Jaid closed 9 months ago
Describe the issue When an inline RegEx is defined, using an s in the flags section breaks all the following code until the end of the file.
Screenshot of Current Behavior Without flag: With flag: Sample Code to Reproduce
import adbkit from "@devicefarmer/adbkit" import {matches} from "super-regex" export default class Device extends adbkit.DeviceClient { async getGpsAll() { const regex = /(?<provider>[a-z]+) provider.+?last location=Location.+?(?<lat>[\d.]+).+?(?<lon>[\d.]+).+?alt=(?<alt>[\d.]+)/gs const execution = await this.shell("dumpsys location") const responseBuffer = await adbkit.default.util.readAll(execution) const response = responseBuffer.toString("utf8") return matches(regex, response).map(match => match.namedGroups) } async getGps() { const gps = await this.getGpsAll() return gps[0] } }
TypeScript parser for comparison
The 'd' flag has the same issue..
This should be fixed in 0.0.40
Describe the issue When an inline RegEx is defined, using an s in the flags section breaks all the following code until the end of the file.
Screenshot of Current Behavior Without flag:
With flag:
Sample Code to Reproduce