| 14402 | return text && text.replace ? text.replace(/<(?:.|\n)*?>/gm, "") : text |
| 14403 | } |
| 14404 | static getUniqueAtomsArray(allAtoms) { |
| 14405 | const atoms = allAtoms.replace(/\n/g, " ").split(" ") |
| 14406 | const index = {} |
| 14407 | atoms.forEach(atom => { |
| 14408 | if (!index[atom]) index[atom] = 0 |
| 14409 | index[atom]++ |
| 14410 | }) |
| 14411 | return Object.keys(index).map(key => { |
| 14412 | return { |
| 14413 | atom: key, |
| 14414 | count: index[key] |
| 14415 | } |
| 14416 | }) |
| 14417 | } |
| 14418 | static getRandomString(length = 30, letters = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""), seed = Date.now()) { |
| 14419 | let str = "" |
| 14420 | const randFn = Utils._getPseudoRandom0to1FloatGenerator(seed) |