How to use the escodegen.escodegen function in escodegen

To help you get started, we’ve selected a few escodegen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LivelyKernel / lively.next / lively.ast / lib / stringify.js View on Github external
import { obj } from "lively.lang";
import * as escodegen from "escodegen";

var es = escodegen.escodegen || escodegen;

export { es as escodegen }

export default function stringify(node, opts = {}) {
  var optsIndent = (opts && opts.format && opts.format.indent) || {}
  var indent = {
    style: "  ",
    base: 0,
    adjustMultilineComment: false,
    optsIndent
  }

  var optsFormat = (opts && opts.format) || {}
  var format = {
    indent,
    quotes: "double",