Skip to main content

CronReplace

@webda/kubernetes


Function: CronReplace()

CronReplace(template, cron, replacements?): any

Defined in: kubernetes/src/cron.ts:16

Replaces placeholders in a given template string with values from a CronDefinition object and other replacements.

Cron Arguments are rendered in 3 different ways:

  • argsLine: The arguments are rendered as a single string, with each argument wrapped in double quotes and separated by a space.
  • argsLineSingleQuote: The arguments are rendered as a single string, with each argument wrapped in single quotes and separated by a space.
  • argsArray: The arguments are rendered as a single string, with each argument wrapped in double quotes and separated by a comma.

Parameters​

template​

any

The template string to replace placeholders in.

cron​

CronDefinition

The CronDefinition object containing values to replace placeholders with.

replacements?​

any = {}

Optional additional replacements to use in the template string.

Returns​

any

The template string with all placeholders replaced with their corresponding values.