Sha256: ed65bc5b682c81b742ffc82aec815271e3b9864a5fba936c49a73f9a0cfbd771

Contents?: true

Size: 411 Bytes

Versions: 8

Compression:

Stored size: 411 Bytes

Contents

const { spawnSync } = require("child_process");
const path = require("path");

const parse = (text, _parsers, _opts) => {
  const child = spawnSync("ruby", [path.join(__dirname, "./parse.rb")], {
    input: text
  });

  const error = child.stderr.toString();
  if (error) {
    throw new Error(error);
  }

  const response = child.stdout.toString();
  return JSON.parse(response);
};

module.exports = parse;

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
prettier-0.20.0 src/haml/parse.js
prettier-0.19.1 src/haml/parse.js
prettier-0.19.0 src/haml/parse.js
prettier-0.18.2 src/haml/parse.js
prettier-0.18.1 src/haml/parse.js
prettier-0.18.0 src/haml/parse.js
prettier-0.17.0 src/haml/parse.js
prettier-0.16.0 src/haml/parse.js