Fix regression for d1, p1, p(n) (#1227)

* fix for `d1` and `.p(1)`
This commit is contained in:
Alex McLean 2024-12-22 20:04:45 +00:00 committed by GitHub
parent 0531369613
commit 04eac3e7c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,7 +92,7 @@ export function repl({
// set pattern methods that use this repl via closure
const injectPatternMethods = () => {
Pattern.prototype.p = function (id) {
if (id.startsWith('_') || id.endsWith('_')) {
if (typeof id === 'string' && (id.startsWith('_') || id.endsWith('_'))) {
// allows muting a pattern x with x_ or _x
return silence;
}