-
Notifications
You must be signed in to change notification settings - Fork 0
API: Postprocessors
API › "@mkacct/cdif/postprocessors"
"@mkacct/cdif/postprocessors" contains included parser postprocessors to make advanced configuration of the parser more convenient. Note that the exported functions are not postprocessor functions themselves; rather, they return postprocessor functions. (See the documentation on postprocessors for more information.)
function postprocessType(
type: string,
fn: CDIFParserPostprocessorFunction
): CDIFParserPostprocessorFunctionReturns a postprocessor that applies the given postprocessor function (fn) if the parsed value has the given type name (type). (Otherwise it returns void, continuing to the next postprocessor as usual.)
(Note: fn's declared type is more specific than CDIFParserPostprocessorFunction to ensure TypeScript's automatic type narrowing behaves as expected, but it is more meaningfully described simply as CDIFParserPostprocessorFunction.)
Parameters:
-
type:string– the type identifier to postprocess -
fn:CDIFParserPostprocessorFunction– the postprocessor function to apply if the type matches
Returns:
-
CDIFParserPostprocessorFunction– the postprocessor function