| // @flow | |
| export default resolveTokens; | |
| /** | |
| * Replace tokens in a string template with values in an object | |
| * | |
| * @param properties a key/value relationship between tokens and replacements | |
| * @param text the template string | |
| * @returns the template with tokens replaced | |
| * @private | |
| */ | |
| function resolveTokens(properties: {+[string]: mixed}, text: string): string { | |
| return text.replace(/{([^{}]+)}/g, (match, key: string) => { | |
| return key in properties ? String(properties[key]) : ''; | |
| }); | |
| } | |
Xet Storage Details
- Size:
- 505 Bytes
- Xet hash:
- b302087d08e67cc69852007f6eab131097084c54a072c36731c7316ba3a7c6ce
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.