INNER CODE UNIT · JavaScript

TextExtraction

taskrabbit/react-native-parsed-text · src/lib/TextExtraction.js:16

class TextExtraction {
  /**
   * @param {String} text - Text to be parsed
   * @param {CustomParseShape[]} patterns - Patterns to be used when parsed,
   *                                 any extra attributes, will be returned from parse()
   */
  constructor(text, patterns) {
    this.text = text;
    this.patterns = patterns || [];
  }

  /**
   * Returns parts of the text with their own props
   * @public
   * @return {Object[]} - props for all the parts of the text
   */
  parse() {
    let parsedTexts = [{ children: this.text }];

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…