0.2.2 • Published 5 years ago

@botmock-api/text v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@botmock-api/text

process text from the botmock api

Installation

npm i @botmock-api/text
wrapEntitiesWithChar(text: string, leftReplacement: string): string

Wraps all occurances of entities in text within leftReplacement

import { wrapEntitiesWithChar } from "@botmock-api/text";

wrapEntitiesWithChar("%alaska% in alamo and %almadovar%", "{");
// {alaska} in alamo and {almadovar}
wrapEntitiesWithChar("%alaska% in alamo and %almadovar%", "[[");
// [[alaska]] in alamo and [[almadovar]]