@@ -192,77 +192,4 @@ export interface AvroLocalTimestampMicrosLogicalType extends AvroLongSchema {
192192export interface AvroDurationLogicalType extends AvroFixedSchema {
193193 logicalType : 'duration' ;
194194 size : 12 ;
195- }
196-
197- // Type guard functions for schema type checking
198- export function isAvroNullSchema ( schema : AvroSchema ) : schema is AvroNullSchema {
199- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'null' ;
200- }
201-
202- export function isAvroBooleanSchema ( schema : AvroSchema ) : schema is AvroBooleanSchema {
203- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'boolean' ;
204- }
205-
206- export function isAvroIntSchema ( schema : AvroSchema ) : schema is AvroIntSchema {
207- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'int' ;
208- }
209-
210- export function isAvroLongSchema ( schema : AvroSchema ) : schema is AvroLongSchema {
211- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'long' ;
212- }
213-
214- export function isAvroFloatSchema ( schema : AvroSchema ) : schema is AvroFloatSchema {
215- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'float' ;
216- }
217-
218- export function isAvroDoubleSchema ( schema : AvroSchema ) : schema is AvroDoubleSchema {
219- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'double' ;
220- }
221-
222- export function isAvroBytesSchema ( schema : AvroSchema ) : schema is AvroBytesSchema {
223- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'bytes' ;
224- }
225-
226- export function isAvroStringSchema ( schema : AvroSchema ) : schema is AvroStringSchema {
227- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'string' ;
228- }
229-
230- export function isAvroRecordSchema ( schema : AvroSchema ) : schema is AvroRecordSchema {
231- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'record' ;
232- }
233-
234- export function isAvroEnumSchema ( schema : AvroSchema ) : schema is AvroEnumSchema {
235- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'enum' ;
236- }
237-
238- export function isAvroArraySchema ( schema : AvroSchema ) : schema is AvroArraySchema {
239- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'array' ;
240- }
241-
242- export function isAvroMapSchema ( schema : AvroSchema ) : schema is AvroMapSchema {
243- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'map' ;
244- }
245-
246- export function isAvroUnionSchema ( schema : AvroSchema ) : schema is AvroUnionSchema {
247- return Array . isArray ( schema ) ;
248- }
249-
250- export function isAvroFixedSchema ( schema : AvroSchema ) : schema is AvroFixedSchema {
251- return typeof schema === 'object' && ! Array . isArray ( schema ) && schema . type === 'fixed' ;
252- }
253-
254- export function isAvroPrimitiveSchema ( schema : AvroSchema ) : schema is AvroPrimitiveSchema {
255- if ( typeof schema === 'string' ) return true ;
256- if ( typeof schema !== 'object' || Array . isArray ( schema ) ) return false ;
257- return [ 'null' , 'boolean' , 'int' , 'long' , 'float' , 'double' , 'bytes' , 'string' ] . includes ( schema . type ) ;
258- }
259-
260- export function isAvroComplexSchema ( schema : AvroSchema ) : schema is AvroComplexSchema {
261- if ( Array . isArray ( schema ) ) return true ;
262- if ( typeof schema !== 'object' ) return false ;
263- return [ 'record' , 'enum' , 'array' , 'map' , 'fixed' ] . includes ( schema . type ) ;
264- }
265-
266- export function isAvroNamedSchema ( schema : AvroSchema ) : schema is AvroNamedSchema {
267- return typeof schema === 'object' && ! Array . isArray ( schema ) && [ 'record' , 'enum' , 'fixed' ] . includes ( schema . type ) ;
268195}
0 commit comments