From 05c8f9b956ea467253f60192b110c22bd928ba7c Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 21 Feb 2024 23:01:34 +0100 Subject: [PATCH] Fix js --- packages/string-templates/src/helpers/date.ts | 4 ++-- packages/string-templates/src/index.ts | 2 +- packages/string-templates/src/processors/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/string-templates/src/helpers/date.ts b/packages/string-templates/src/helpers/date.ts index 70dc0bd617..efcf516dfb 100644 --- a/packages/string-templates/src/helpers/date.ts +++ b/packages/string-templates/src/helpers/date.ts @@ -68,7 +68,7 @@ function getContext(thisArg, locals, options) { return context } -function initialConfig(str, pattern, options = {}) { +function initialConfig(str, pattern, options?) { if (isOptions(pattern)) { options = pattern pattern = null @@ -82,7 +82,7 @@ function initialConfig(str, pattern, options = {}) { return { str, pattern, options } } -function setLocale(str, pattern, options = {}) { +function setLocale(str, pattern, options?) { // if options is null then it'll get updated here const config = initialConfig(str, pattern, options) const defaults = { lang: "en", date: new Date(config.str) } diff --git a/packages/string-templates/src/index.ts b/packages/string-templates/src/index.ts index 354af0f612..5fc9af9573 100644 --- a/packages/string-templates/src/index.ts +++ b/packages/string-templates/src/index.ts @@ -137,7 +137,7 @@ export function processObjectSync(object, context, opts) { * @param {object|undefined} [opts] optional - specify some options for processing. * @returns {string} The enriched string, all templates should have been replaced if they can be. */ -export function processStringSync(string, context, opts) { +export function processStringSync(string, context, opts?) { // Take a copy of input in case of error const input = string if (typeof string !== "string") { diff --git a/packages/string-templates/src/processors/index.ts b/packages/string-templates/src/processors/index.ts index 7187bb6fd8..e1743b2f4c 100644 --- a/packages/string-templates/src/processors/index.ts +++ b/packages/string-templates/src/processors/index.ts @@ -2,7 +2,7 @@ import { FIND_HBS_REGEX } from "../utilities" import * as preprocessor from "./preprocessor" import * as postprocessor from "./postprocessor" -function process(output, processors, opts = {}) { +function process(output, processors, opts?) { for (let processor of processors) { // if a literal statement has occurred stop if (typeof output !== "string") {