Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
409 B
1
Indexable
Never
String.prototype.externalStringLiterals = async (correspondingStrings) => {let g = () => new Promise((finish) => {
    let templateString = this
    let templates = this.match(/\{.}/g)
    templates.forEach((str,index) => {
        templateString = templateString.replace(str,correspondingStrings[index])
        index >= templates.length-1 ? finish(templateString) : ''
    })
})
let h = await g()
return h
}