Skip to content

Commit

Permalink
fix for d1 and .p(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaxu committed Dec 22, 2024
1 parent 8f3cc76 commit cb0f6d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/repl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cb0f6d2

Please sign in to comment.