feat(regexp): add index and match indicator
All checks were successful
/ deploy_site (push) Successful in 23s
All checks were successful
/ deploy_site (push) Successful in 23s
This commit is contained in:
parent
68fa9f64d7
commit
b01a3696a0
@ -8,7 +8,10 @@ export const RegexpTransform: Transform = {
|
||||
|
||||
const parsedSamples = samples
|
||||
.split('\n')
|
||||
.map((sample) => JSON.stringify(regexp.exec(sample)?.groups))
|
||||
.map((sample) => regexp.exec(sample))
|
||||
.map((sample, i) =>
|
||||
`${i + 3}(${sample === null ? 'x' : 'o'}) ${JSON.stringify(sample?.groups) ?? ''}`.trimEnd()
|
||||
)
|
||||
.join('\n')
|
||||
|
||||
return [expression, samples, parsedSamples].join('\n\n')
|
||||
|
Loading…
Reference in New Issue
Block a user