This repository was archived by the owner on Mar 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
packages/language/src/validators
samples/sveltekit/src/routes/api/model/[...path] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ export default class FunctionInvocationValidator implements AstValidator<Express
198198 const versionArg = expr . args [ 0 ] ?. value ;
199199 if ( versionArg ) {
200200 const version = getLiteral < number > ( versionArg ) ;
201- if ( version !== 4 && version !== 7 ) {
201+ if ( version !== undefined && version !== 4 && version !== 7 ) {
202202 accept ( 'error' , 'first argument must be 4 or 7' , {
203203 node : expr . args [ 0 ] ! ,
204204 } ) ;
@@ -212,7 +212,7 @@ export default class FunctionInvocationValidator implements AstValidator<Express
212212 const versionArg = expr . args [ 0 ] ?. value ;
213213 if ( versionArg ) {
214214 const version = getLiteral < number > ( versionArg ) ;
215- if ( version !== 1 && version !== 2 ) {
215+ if ( version !== undefined && version !== 1 && version !== 2 ) {
216216 accept ( 'error' , 'first argument must be 1 or 2' , {
217217 node : expr . args [ 0 ] ! ,
218218 } ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import { schema } from "../../../../zenstack/schema";
55
66const handler = SvelteKitRouteHandler ( {
77 apiHandler : new RPCApiHandler ( { schema } ) ,
8+ // fully open ZenStackClient is used here for demo purposes only, in a real application,
9+ // you should use one with access policies enabled
810 getClient : ( ) => db ,
911} ) ;
1012
You can’t perform that action at this time.
0 commit comments