(options)
| 10325 | } |
| 10326 | |
| 10327 | function State(options) { |
| 10328 | this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; |
| 10329 | this.indent = Math.max(1, (options['indent'] || 2)); |
| 10330 | this.skipInvalid = options['skipInvalid'] || false; |
| 10331 | this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); |
| 10332 | this.styleMap = compileStyleMap(this.schema, options['styles'] || null); |
| 10333 | this.sortKeys = options['sortKeys'] || false; |
| 10334 | this.lineWidth = options['lineWidth'] || 80; |
| 10335 | this.noRefs = options['noRefs'] || false; |
| 10336 | this.noCompatMode = options['noCompatMode'] || false; |
| 10337 | |
| 10338 | this.implicitTypes = this.schema.compiledImplicit; |
| 10339 | this.explicitTypes = this.schema.compiledExplicit; |
| 10340 | |
| 10341 | this.tag = null; |
| 10342 | this.result = ''; |
| 10343 | |
| 10344 | this.duplicates = []; |
| 10345 | this.usedDuplicates = null; |
| 10346 | } |
| 10347 | |
| 10348 | // Indents every line in a string. Empty lines (\n only) are not indented. |
| 10349 | function indentString(string, spaces) { |
nothing calls this directly
no test coverage detected