Open brendonboshell opened 1 year ago
In this example:
const s = require("superstruct"); const Query = s.object({ url: s.pattern(s.string(), /^example/g), }); const testQuery = { url: "example", }; console.log(s.is(testQuery, Query), s.is(testQuery, Query));
It returns the following output:
% node index.js true false
I would expect each call to is to return the same output. I suspect this is because of the stateful behaviour of regular expressions.
is
In this example:
It returns the following output:
I would expect each call to
is
to return the same output. I suspect this is because of the stateful behaviour of regular expressions.