| 337 | return cl; |
| 338 | }, |
| 339 | meta(...args: any[]): any { |
| 340 | // overloaded: meta() returns the registered metadata, meta(data) |
| 341 | // returns a clone with `data` registered. The mapped type picks |
| 342 | // up the second overload, so we accept variadic any-args and |
| 343 | // return `any` to satisfy both at runtime. |
| 344 | if (args.length === 0) return core.globalRegistry.get(this); |
| 345 | const cl = this.clone(); |
| 346 | core.globalRegistry.add(cl, args[0]); |
| 347 | return cl; |
| 348 | }, |
| 349 | isOptional() { |
| 350 | return this.safeParse(undefined).success; |
| 351 | }, |