parseImageKey(event, requestType) {
        if (requestType === "Default") {
            // Decode the image request and return the image key
            const decoded = this.decodeRequest(event);
            return decoded.key;
        }

        if (requestType === "Thumbor" || requestType === "Custom") {
            return decodeURIComponent(event["path"].replace(/\d+x\d+\/|filters[:-][^/]+|\/fit-in\/+|^\/+/g,'').replace(/^\/+/,''));
        }

        // Return an error for all other conditions
        throw ({
            status: 404,
            code: 'ImageEdits::CannotFindImage',
            message: 'The image you specified could not be found. Please check your request syntax as well as the bucket you specified to ensure it exists.'
        });
    }
/**
     * Parses the name of the appropriate Amazon S3 key corresponding to the
     * original image.
     * @param {String} event - Lambda request body.
     * @param {String} requestType - Type, either "Default", "Thumbor", or "Custom".
     */
Parses the name of the appropriate Amazon S3 key corresponding to the
original image.
@param {String} event - Lambda request body.
Parses the name of the appropriate Amazon S3 key corresponding to the original image . @param { String } event - Lambda request body .
parseImageKey(event, requestType) {
        if (requestType === "Default") {
            const decoded = this.decodeRequest(event);
            return decoded.key;
        }
        if (requestType === "Thumbor" || requestType === "Custom") {
            return decodeURIComponent(event["path"].replace(/\d+x\d+\/|filters[:-][^/]+|\/fit-in\/+|^\/+/g,'').replace(/^\/+/,''));
        }
        throw ({
            status: 404,
            code: 'ImageEdits::CannotFindImage',
            message: 'The image you specified could not be found. Please check your request syntax as well as the bucket you specified to ensure it exists.'
        });
    }
parseImageKey ( event , requestType ) { if ( requestType === "Default" ) { const decoded = this . decodeRequest ( event ) ; return decoded . key ; } if ( requestType === "Thumbor" || requestType === "Custom" ) { return decodeURIComponent ( event [ "path" ] . replace ( / \d+x\d+\/|filters[:-][^/]+|\/fit-in\/+|^\/+ / g , '' ) . replace ( / ^\/+ / , '' ) ) ; } throw ( { status : 404 , code : 'ImageEdits::CannotFindImage' , message : 'The image you specified could not be found. Please check your request syntax as well as the bucket you specified to ensure it exists.' } ) ; }
Parses the name of the appropriate Amazon S3 key corresponding to the
 original image.
Parses the name of the appropriate Amazon S3 key corresponding to the original image .
// Decode the image request and return the image key // Return an error for all other conditions