{"version":3,"sources":["jsdelivr-header.js","/npm/node-cron-tz@2.0.4/src/node-cron.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,MAAM,cAAgB,QAAQ,oBACxB,wBAA0B,QAAQ,+BAClC,WAAa,QAAQ,wBACrB,QAAU,QAAQ,aAExB,OAAO,QAuDI,CACH,SAnCJ,SAAkB,EAAY,EAAM,GAChC,IAAI,EAKR,SAAoB,EAAY,EAAM,GAClC,MAAmB,iBAAT,EACC,IAAI,wBAAwB,EAAY,EAAM,GAE9C,IAAI,cAAc,EAAY,EAAM,EAEnD,CAXe,CAAW,EAAY,EAAM,GAExC,OADA,QAAQ,KAAK,GACN,CACX,EAgCI,SAhBJ,SAAkB,GACd,IACI,WAAW,EACf,CAAE,MAAM,GACJ,OAAO,CACX,CAEA,OAAO,CACX,EASI,SAPJ,WACI,OAAO,QAAQ,UACnB","file":"/npm/node-cron-tz@2.0.4/src/node-cron.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/node-cron-tz@2.0.4/src/node-cron.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nconst ScheduledTask = require('./scheduled-task');\nconst BackgroundScheduledTask = require('./background-scheduled-task');\nconst validation = require('./pattern-validation');\nconst storage = require('./storage');\n\nmodule.exports = (() => {\n\n    /**\n   * Creates a new task to execute given function when the cron\n   *  expression ticks.\n   *\n   * @param {string} expression - cron expression.\n   * @param {Function} func - task to be executed.\n   * @param {Object} options - a set of options for the scheduled task:\n   *    - scheduled <boolean>: if a schaduled task is ready and running to be \n   *      performed when the time mach with the cron excpression.\n   *    - timezone <string>: the tiemzone to execute the tasks.\n   * \n   *    Example: \n   *    {\n   *      \"scheduled\": true,\n   *      \"timezone\": \"America/Sao_Paulo\"\n   *    } \n   * \n   * @returns {ScheduledTask} update function.\n   */\n    function schedule(expression, func, options) {\n        let task = createTask(expression, func, options);\n        storage.save(task);\n        return task;\n    }\n\n    function createTask(expression, func, options){\n        if(typeof func === 'string'){\n            return new BackgroundScheduledTask(expression, func, options);\n        } else {\n            return new ScheduledTask(expression, func, options);\n        }\n    }\n\n    /**\n     * Check if a cron expression is valid\n     * @param {string} expression - cron expression.\n     * \n     * @returns {boolean} - returns true if expression is valid\n     */\n    function validate(expression) {\n        try {\n            validation(expression);\n        } catch(e) {\n            return false;\n        }\n\n        return true;\n    }\n\n    function getTasks() {\n        return storage.getTasks();\n    }\n\n    return {\n        schedule: schedule,\n        validate: validate,\n        getTasks: getTasks\n    };\n})();\n"]}