MCPcopy Create free account
hub / github.com/breck7/scroll / format

Method format

external/.scrollLibs.js:21003–21016  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21001 return new Particle.ParserPool(catchAllJavascriptCodeLineParser, undefined, undefined)
21002 }
21003 format() {
21004 if (this.isNodeJs()) {
21005 const template = `class FOO{ ${this.subparticlesToString()}}`
21006 this.setSubparticles(
21007 require("prettier")
21008 .format(template, { semi: false, useTabs: true, parser: "babel", printWidth: 240 })
21009 .replace(/class FOO \{\s+/, "")
21010 .replace(/\s+\}\s+$/, "")
21011 .replace(/\n\t/g, "\n") // drop one level of indent
21012 .replace(/\t/g, " ") // we used tabs instead of spaces to be able to dedent without breaking literals.
21013 )
21014 }
21015 return this
21016 }
21017 }
21018
21019 class abstractParseRuleParser extends abstractParserRuleParser {}

Callers

nothing calls this directly

Calls 5

subparticlesToStringMethod · 0.80
setSubparticlesMethod · 0.80
replaceMethod · 0.80
isNodeJsMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected