UNPKG

@hclsoftware/secagent

Version:

IAST agent

39 lines (34 loc) 1.1 kB
//IASTIGNORE /* * **************************************************** * Licensed Materials - Property of HCL. * (c) Copyright HCL Technologies Ltd. 2017, 2025. * Note to U.S. Government Users *Restricted Rights. * **************************************************** */ const BeforeRule = require('./BeforeRule') /** * Used to convert object using rule which extends this class, for specific use cases * @class ConvertThatRule * @see BeforeRule */ module.exports = class ConvertThatRule extends BeforeRule { doRule (hookValues) { const that = hookValues.that hookValues.newThat = this.additionalChecks(that) ? this.convert(that) : that } // abstract-like method. additionalChecks(input) { console.origLog('should not be called. Implement additionalChecks method in each specific convert rule') } /** * @abstract convert * @param input */ convert(input) { console.origLog('should not be called. Implement convert method in each specific convert rule') } runWhenInactive(){ return true; } }