summaryrefslogtreecommitdiffstats
path: root/llparse-builder/src/transform/creator.ts
blob: eaf3d5c2ba3cbe071dada664d6baf1f67ac0f590 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Transform } from './base';
import { ToLower } from './to-lower';
import { ToLowerUnsafe } from './to-lower-unsafe';

/**
 * API for creating character transformations.
 *
 * The results of methods of this class can be used as an argument to:
 * `p.node().transform(...)`.
 */
export class Creator {
  /**
   * Unsafe transform to lowercase.
   *
   * The operation of this transformation is equivalent to:
   * `String.fromCharCode(input.charCodeAt(0) | 0x20)`.
   */
  public toLowerUnsafe(): Transform {
    return new ToLowerUnsafe();
  }

  /**
   * Safe transform to lowercase.
   */
  public toLower(): Transform {
    return new ToLower();
  }
}