addChange({ addToStart = true, category, description, version, }) {
        if (!category) {
            throw new Error('Category required');
        }
        else if (!constants_1.orderedChangeCategories.includes(category)) {
            throw new Error(`Unrecognized category: '${category}'`);
        }
        else if (!description) {
            throw new Error('Description required');
        }
        else if (version !== undefined && !this._changes[version]) {
            throw new Error(`Specified release version does not exist: '${version}'`);
        }
        const release = version
            ? this._changes[version]
            : this._changes[constants_1.unreleased];
        if (!release[category]) {
            release[category] = [];
        }
        if (addToStart) {
            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
            release[category].unshift(description);
        }
        else {
            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
            release[category].push(description);
        }
    }
/**
     * Add a change to the changelog.
     *
     * @param options
     * @param options.addToStart - Determines whether the change is added to the
     * top or bottom of the list of changes in this category. This defaults to
     * `true` because changes should be in reverse-chronological order. This
     * should be set to `false` when parsing a changelog top-to-bottom.
     * @param options.category - The category of the change.
     * @param options.description - The description of the change.
     * @param options.version - The version this change was released in. If this
     * is not given, the change is assumed to be unreleased.
     */
Add a change to the changelog.
@param options
@param options.addToStart - Determines whether the change is added to the
top or bottom of the list of changes in this category. This defaults to
`true` because changes should be in reverse-chronological order. This
should be set to `false` when parsing a changelog top-to-bottom.
@param options.category - The category of the change.
@param options.description - The description of the change.
@param options.version - The version this change was released in. If this
is not given, the change is assumed to be unreleased.
Add a change to the changelog . @param options @param options . addToStart - Determines whether the change is added to the top or bottom of the list of changes in this category . This defaults to ` true ` because changes should be in reverse - chronological order . This should be set to ` false ` when parsing a changelog top - to - bottom . @param options . category - The category of the change . @param options . description - The description of the change . @param options . version - The version this change was released in . If this is not given the change is assumed to be unreleased .
addChange({ addToStart = true, category, description, version, }) {
        if (!category) {
            throw new Error('Category required');
        }
        else if (!constants_1.orderedChangeCategories.includes(category)) {
            throw new Error(`Unrecognized category: '${category}'`);
        }
        else if (!description) {
            throw new Error('Description required');
        }
        else if (version !== undefined && !this._changes[version]) {
            throw new Error(`Specified release version does not exist: '${version}'`);
        }
        const release = version
            ? this._changes[version]
            : this._changes[constants_1.unreleased];
        if (!release[category]) {
            release[category] = [];
        }
        if (addToStart) {
            release[category].unshift(description);
        }
        else {
            release[category].push(description);
        }
    }
addChange ( { addToStart = true , category , description , version , } ) { if ( ! category ) { throw new Error ( 'Category required' ) ; } else if ( ! constants_1 . orderedChangeCategories . includes ( category ) ) { throw new Error ( ` ${ category } ` ) ; } else if ( ! description ) { throw new Error ( 'Description required' ) ; } else if ( version !== undefined && ! this . _changes [ version ] ) { throw new Error ( ` ${ version } ` ) ; } const release = version ? this . _changes [ version ] : this . _changes [ constants_1 . unreleased ] ; if ( ! release [ category ] ) { release [ category ] = [ ] ; } if ( addToStart ) { release [ category ] . unshift ( description ) ; } else { release [ category ] . push ( description ) ; } }
Add a change to the changelog.
Add a change to the changelog .
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion // eslint-disable-next-line @typescript-eslint/no-non-null-assertion