'use strict' ; import { Handler , Context , Callback } from 'aws-lambda' ; import 'source-map-support/register' ; interface Response { statusCode : number ; body : string ; } const handler = ( event , context , callback ) => { const payload = JSON . parse ( event . body ) ; const modified = [ ] ; try { payload . commits . forEach ( ( commit ) => { [ 'added' , 'removed' , 'modified' ] . forEach ( ( changeType ) => { commit [ changeType ] . forEach ( ( path ) => { if ( ! modified . includes ( path ) ) { modified . push ( path ) ; } } ) ; } ) ; } ) ; } catch ( e ) { console . log ( e ) ; } const response = { statusCode : 200 , body : JSON . stringify ( modified ) } ; console . log ( modified ) ; callback ( undefined , response ) ; } ; export { handler } ;