{"version":3,"file":"structs.cjs","sourceRoot":"","sources":["../../src/utils/structs.ts"],"names":[],"mappings":";;;AAAA,uDAAwE;AAExE;;;GAGG;AACU,QAAA,gBAAgB,GAAG,IAAA,oBAAM,EAAK,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CACjE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAC9E,CAAC;AAEF;;;;;;;;;GASG;AACU,QAAA,cAAc,GAAG,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,IAAA,oBAAM,EAAC,EAAE,CAAC,EAAE,wBAAgB,CAAC,CAAC,CAAC,CAAC","sourcesContent":["import { define, object, optional, union } from '@metamask/superstruct';\n\n/**\n * Superstruct schema for an empty array [].\n * Validates that the value is an array with zero elements.\n */\nexport const EmptyArrayStruct = define<[]>('EmptyArray', (value) =>\n  Array.isArray(value) && value.length === 0 ? true : 'Expected an empty array',\n);\n\n/**\n * Superstruct schema for JSON-RPC methods that expect no parameters.\n *\n * Different JSON-RPC clients may send \"no params\" in different ways:\n * - Omitted entirely (undefined)\n * - Empty array []\n * - Empty object {}\n *\n * This struct accepts all three forms for maximum compatibility.\n */\nexport const NoParamsStruct = optional(union([object({}), EmptyArrayStruct]));\n"]}