<commit_before>
import {State, TextWriter} from "./IonTextWriter";
import {Writeable} from "./IonWriteable";
import {TypeCodes} from "./IonBinary";
import {CharCodes} from "./IonText";
import {isNullOrUndefined} from "./IonUtilities";
type Serializer<T> = (value: T) => void;
/*
 * This class and functionality carry no guarantees of correctness or support.
 * Do not rely on this functionality for more than front end formatting.
 */
export class PrettyWriter extends TextWriter {
    private indentCount : number = 0;
    constructor(writeable: Writeable, private readonly indentSize : number = 0) { super(writeable);}

    private writePrettyValue() : void {
        if(!this.isTopLevel && this.currentContainer.containerType && this.currentContainer.containerType !== TypeCodes.STRUCT){
            this.writePrettyIndent(0);
        }
    }
    private writePrettyNewLine(incrementValue: number) : void {
        this.indentCount = this.indentCount + incrementValue;
        if(this.indentSize && this.indentSize > 0){
            this.writeable.writeByte(CharCodes.LINE_FEED);
        }
    }
    private writePrettyIndent(incrementValue: number) : void {
        this.indentCount = this.indentCount + incrementValue;
        if(this.indentSize && this.indentSize > 0){
            for(var i = 0; i < (this.indentCount*this.indentSize); i++ ){
                this.writeable.writeByte(CharCodes.SPACE);
            }
        }
    }

    writeFieldName(fieldName: string) : void {
        if (this.currentContainer.containerType !== TypeCodes.STRUCT) {
            throw new Error("Cannot write field name outside of a struct");
        }
        if (this.currentContainer.state !== State.STRUCT_FIELD) {
            throw new Error("Expecting a struct value");
        }
<commit_msg>updated default indent for pretty printing.<commit_after>
import {State, TextWriter} from "./IonTextWriter";
import {Writeable} from "./IonWriteable";
import {TypeCodes} from "./IonBinary";
import {CharCodes} from "./IonText";
import {isNullOrUndefined} from "./IonUtilities";
type Serializer<T> = (value: T) => void;
/*
 * This class and functionality carry no guarantees of correctness or support.
 * Do not rely on this functionality for more than front end formatting.
 */
export class PrettyWriter extends TextWriter {
    private indentCount : number = 0;
    constructor(writeable: Writeable, private readonly indentSize : number = 2) { super(writeable);}

    private writePrettyValue() : void {
        if(!this.isTopLevel && this.currentContainer.containerType && this.currentContainer.containerType !== TypeCodes.STRUCT){
            this.writePrettyIndent(0);
        }
    }
    private writePrettyNewLine(incrementValue: number) : void {
        this.indentCount = this.indentCount + incrementValue;
        if(this.indentSize && this.indentSize > 0){
            this.writeable.writeByte(CharCodes.LINE_FEED);
        }
    }
    private writePrettyIndent(incrementValue: number) : void {
        this.indentCount = this.indentCount + incrementValue;
        if(this.indentSize && this.indentSize > 0){
            for(var i = 0; i < (this.indentCount*this.indentSize); i++ ){
                this.writeable.writeByte(CharCodes.SPACE);
            }
        }
    }

    writeFieldName(fieldName: string) : void {
        if (this.currentContainer.containerType !== TypeCodes.STRUCT) {
            throw new Error("Cannot write field name outside of a struct");
        }
        if (this.currentContainer.state !== State.STRUCT_FIELD) {
            throw new Error("Expecting a struct value");
        }

{'fraction_non_alphanumeric': 0.1110803324099723, 'fraction_numerical': 0.0033240997229916896, 'mean_word_length': 3.0436730123180293, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3270300', 'n_tokens_mistral': 996, 'n_tokens_neox': 987, 'n_words': 261}