1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00
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
}
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) }

View file

@ -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") {

View file

@ -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") {