@@ -33,6 +33,7 @@ import ReidentifyTextRequest from "../../vault/model/request/reidentify-text";
3333import ReidentifyTextOptions from "../../vault/model/options/reidentify-text" ;
3434import DeidentifyFileOptions from "../../vault/model/options/deidentify-file" ;
3535import DeidentifyFileRequest from "../../vault/model/request/deidentify-file" ;
36+ import { Bleep } from "../../vault/model/options/deidentify-file/bleep-audio" ;
3637
3738export function isEnv ( value ?: string ) : boolean {
3839 return value !== undefined && Object . values ( Env ) . includes ( value as Env ) ;
@@ -1058,12 +1059,12 @@ export const validateDeidentifyFileOptions = (deidentifyFileOptions: DeidentifyF
10581059 }
10591060
10601061 // Validate tokenFormat
1061- if ( deidentifyFileOptions . getTokenFormat ( ) && typeof deidentifyFileOptions . getTokenFormat !== 'object' ) {
1062+ if ( deidentifyFileOptions . getTokenFormat ( ) && ! ( deidentifyFileOptions . getTokenFormat ( ) instanceof TokenFormat ) ) {
10621063 throw new SkyflowError ( SKYFLOW_ERROR_CODE . INVALID_TOKEN_FORMAT ) ;
10631064 }
10641065
10651066 // Validate transformations
1066- if ( deidentifyFileOptions . getTransformations ( ) && typeof deidentifyFileOptions . getTransformations ( ) !== 'object' ) {
1067+ if ( deidentifyFileOptions . getTransformations ( ) && ! ( deidentifyFileOptions . getTransformations ( ) instanceof Transformations ) ) {
10671068 throw new SkyflowError ( SKYFLOW_ERROR_CODE . INVALID_TRANSFORMATIONS ) ;
10681069 }
10691070
@@ -1098,7 +1099,7 @@ export const validateDeidentifyFileOptions = (deidentifyFileOptions: DeidentifyF
10981099 throw new SkyflowError ( SKYFLOW_ERROR_CODE . INVALID_OUTPUT_TRANSCRIPTION ) ;
10991100 }
11001101
1101- if ( deidentifyFileOptions . getBleep ( ) !== undefined && typeof deidentifyFileOptions . getBleep ( ) !== 'object' ) {
1102+ if ( deidentifyFileOptions . getBleep ( ) && ! ( deidentifyFileOptions . getBleep ( ) instanceof Bleep ) ) {
11021103 throw new SkyflowError ( SKYFLOW_ERROR_CODE . INVALID_BLEEP ) ;
11031104 }
11041105} ;
0 commit comments