UNPKG

vue-app-sdk

Version:
16 lines (15 loc) 452 B
import asciiWords from "./_asciiWords.js"; import hasUnicodeWord from "./_hasUnicodeWord.js"; import toString from "./toString.js"; import unicodeWords from "./_unicodeWords.js"; function words(string, pattern, guard) { string = toString(string); pattern = pattern; if (pattern === void 0) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } export { words as default };