lib/transforms/html.styleTransforms.js
function transformDOMText (opts) {
  return new Promise((resolve, reject) => {
    var file = new VFile({
      path: opts.filePath,
      contents: new Buffer(opts.getText(opts.el$), 'utf8') // eslint-disable-line node/no-deprecated-api
      // TODO: drop Node.js 4.x support, use `Buffer.from()` instead
    });
    var readable = fileToReadable(file);

    utils.pipeTransforms(readable, opts.transforms)
      .on('error', reject)
      .on('end', () => {
        opts.setText(opts.el$, file.contents.toString('utf8'));
        resolve();
      })
      .resume();
  });
}
function transformDOMText (opts) {
  return new Promise((resolve, reject) => {
    var file = new VFile({
      path: opts.filePath,
      contents: new Buffer(opts.getText(opts.el$), 'utf8') // eslint-disable-line node/no-deprecated-api
      // TODO: drop Node.js 4.x support, use `Buffer.from()` instead
    });
    var readable = fileToReadable(file);

    utils.pipeTransforms(readable, opts.transforms)
      .on('error', reject)
      .on('end', () => {
        opts.setText(opts.el$, file.contents.toString('utf8'));
        resolve();
      })
      .resume();
  });
}
interface TransformDOMTextOptions {
filePath: String,
getText: (el$: CheerioElement) => String,
el$: CheerioElement,
setText: (el$: CheerioElement, text: String) => Void
transforms: stream.Transform[]
}
 transformText(opts: TransformTextOptions) => Promise