qp for quote passable as a quasi-quoted Justin expression.
Both q from @endo/errors and this qp from @endo/marshal can
be used together with Fail, X, etc from @endo/errors to mark
a substitution value to be both
visually quoted in some useful manner
unredacted
Differences:
given a pattern M.and(M.gte(-100), M.lte(100)),
`${q(patt)}`
produces "[match:and]", whereas
`${qp(patt)}`
produces quasi-quotes Justin of what would be passed:
q is lazy, minimizing the cost for using it in an error that's never
logged. Unfortunately, due to layering constraints, qp is not
lazy, always rendering to quasi-quoted Justin immediately.
Since Justin is a subset of HardenedJS, neither the name qp nor the
rendered form need to make clear that the rendered form is in Justin rather
than HardenedJS.
qpfor quote passable as a quasi-quoted Justin expression.Both
qfrom@endo/errorsand thisqpfrom@endo/marshalcan be used together withFail,X, etc from@endo/errorsto mark a substitution value to be bothDifferences:
M.and(M.gte(-100), M.lte(100)), produces"[match:and]", whereas produces quasi-quotes Justin of what would be passed:qis lazy, minimizing the cost for using it in an error that's never logged. Unfortunately, due to layering constraints,qpis not lazy, always rendering to quasi-quoted Justin immediately.Since Justin is a subset of HardenedJS, neither the name
qpnor the rendered form need to make clear that the rendered form is in Justin rather than HardenedJS.