# Report a bug ### π Search Terms `instanceOf` ### π§© Context - ArkType version: 2.2.0 - TypeScript version (5.1+): 5.9.3 ### π§βπ» Repro <!-- 1. Update the playground link below with the simplest code you can that reproduces the issue. 2. Click the link icon in the top right corner of the playground editor to copy the URL for your repro. 3. Replace the URL below with your repro link. If your repro requires dependencies besides arktype, it's probably either not a minimal repro or not an arktype bug. You can still describe it here, but is likely to be closed. --> Playground Link: https://arktype.io/playground?code=import%2520%257B%2520type%2520%257D%2520from%2520%2522arktype%2522%250A%250Aconst%2520Thing%2520%253D%2520type%28%257B%250A%2509tags%253A%2520type%250A%2509%2509.Record%28%2522string%2522%252C%2520%2522boolean%2522%29%250A%2509%2509.pipe%28%28tags%29%2520%253D%253E%2520Object.keys%28tags%29%29%250A%2509%2509.pipe%28%28tags%29%2520%253D%253E%2520tags.map%28%28tag%29%2520%253D%253E%2520tag.slice%281%29.replaceAll%28%2522_%2522%252C%2520%2522-%2522%29%29%29%250A%2509%252F%252F%2520.to%28%2522string.uuid%255B%255D%2520%253E%25200%2522%29%2520%252F%252F%2520Doesn%27t%2520work.%250A%2509%252F%252F%2520.pipe%28type%28%2522string.uuid%255B%255D%2520%253E%25200%2522%29%29%2520%252F%252F%2520Works.%250A%257D%29%250A%250Aconst%2520out%2520%253D%2520Thing%28%257B%250A%2509tags%253A%2520%257B%250A%2509%2509_6baf599f_8a93_478c_9a3b_51cc01451628%253A%2520true%250A%2509%257D%250A%257D%29%250A ```ts import { type } from "arktype" const Thing = type({ tags: type .Record("string", "boolean") .pipe((tags) => Object.keys(tags)) .pipe((tags) => tags.map((tag) => tag.slice(1).replaceAll("_", "-"))) .to("string.uuid[] > 0") // Doesn't work. // .pipe(type("string.uuid[] > 0")) // Works. }) const out = Thing({ tags: { _6baf599f_8a93_478c_9a3b_51cc01451628: true } }) ``` The above code causes a `ParseError` to be thrown with the following message: `instanceOf operand must be a function (was undefined)`. Interestingly, using `.pipe(type("string.uuid[] > 0"))` works.
Report a bug
π Search Terms
instanceOfπ§© Context
π§βπ» Repro
Playground Link: https://arktype.io/playground?code=import%2520%257B%2520type%2520%257D%2520from%2520%2522arktype%2522%250A%250Aconst%2520Thing%2520%253D%2520type%28%257B%250A%2509tags%253A%2520type%250A%2509%2509.Record%28%2522string%2522%252C%2520%2522boolean%2522%29%250A%2509%2509.pipe%28%28tags%29%2520%253D%253E%2520Object.keys%28tags%29%29%250A%2509%2509.pipe%28%28tags%29%2520%253D%253E%2520tags.map%28%28tag%29%2520%253D%253E%2520tag.slice%281%29.replaceAll%28%2522_%2522%252C%2520%2522-%2522%29%29%29%250A%2509%252F%252F%2520.to%28%2522string.uuid%255B%255D%2520%253E%25200%2522%29%2520%252F%252F%2520Doesn%27t%2520work.%250A%2509%252F%252F%2520.pipe%28type%28%2522string.uuid%255B%255D%2520%253E%25200%2522%29%29%2520%252F%252F%2520Works.%250A%257D%29%250A%250Aconst%2520out%2520%253D%2520Thing%28%257B%250A%2509tags%253A%2520%257B%250A%2509%2509_6baf599f_8a93_478c_9a3b_51cc01451628%253A%2520true%250A%2509%257D%250A%257D%29%250A
The above code causes a
ParseErrorto be thrown with the following message:instanceOf operand must be a function (was undefined).Interestingly, using
.pipe(type("string.uuid[] > 0"))works.