Sha256: 59640b25bc7675c7ae716175e5a69e2e5388a903f84fd935c7bd51cd231e9628

Contents?: true

Size: 705 Bytes

Versions: 8

Compression:

Stored size: 705 Bytes

Contents

const embed = require("./embed");
const nodes = {
  comment: require("./nodes/comment"),
  doctype: require("./nodes/doctype"),
  filter: require("./nodes/filter"),
  haml_comment: require("./nodes/hamlComment"),
  plain: require("./nodes/plain"),
  root: require("./nodes/root"),
  script: require("./nodes/script"),
  silent_script: require("./nodes/silentScript"),
  tag: require("./nodes/tag")
};

const genericPrint = (path, opts, print) => {
  const { type } = path.getValue();

  /* istanbul ignore next */
  if (!(type in nodes)) {
    throw new Error(`Unsupported node encountered: ${type}`);
  }

  return nodes[type](path, opts, print);
};

module.exports = {
  embed,
  print: genericPrint
};

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
prettier-1.5.5 src/haml/printer.js
prettier-1.5.4 src/haml/printer.js
prettier-1.5.3 src/haml/printer.js
prettier-1.5.2 src/haml/printer.js
prettier-1.5.1 src/haml/printer.js
prettier-1.5.0 src/haml/printer.js
prettier-1.4.0 src/haml/printer.js
prettier-1.3.0 src/haml/printer.js