This commit is contained in:
Adria Navarro 2024-02-21 23:01:34 +01:00
parent afe2335ed8
commit 05c8f9b956
3 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ function getContext(thisArg, locals, options) {
return context return context
} }
function initialConfig(str, pattern, options = {}) { function initialConfig(str, pattern, options?) {
if (isOptions(pattern)) { if (isOptions(pattern)) {
options = pattern options = pattern
pattern = null pattern = null
@ -82,7 +82,7 @@ function initialConfig(str, pattern, options = {}) {
return { 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 // if options is null then it'll get updated here
const config = initialConfig(str, pattern, options) const config = initialConfig(str, pattern, options)
const defaults = { lang: "en", date: new Date(config.str) } const defaults = { lang: "en", date: new Date(config.str) }

View File

@ -137,7 +137,7 @@ export function processObjectSync(object, context, opts) {
* @param {object|undefined} [opts] optional - specify some options for processing. * @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. * @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 // Take a copy of input in case of error
const input = string const input = string
if (typeof string !== "string") { if (typeof string !== "string") {

View File

@ -2,7 +2,7 @@ import { FIND_HBS_REGEX } from "../utilities"
import * as preprocessor from "./preprocessor" import * as preprocessor from "./preprocessor"
import * as postprocessor from "./postprocessor" import * as postprocessor from "./postprocessor"
function process(output, processors, opts = {}) { function process(output, processors, opts?) {
for (let processor of processors) { for (let processor of processors) {
// if a literal statement has occurred stop // if a literal statement has occurred stop
if (typeof output !== "string") { if (typeof output !== "string") {