addRelease({ addToStart = true, date, status, version }) {
        if (!version) {
            throw new Error('Version required');
        }
        else if (semver_1.default.valid(version) === null) {
            throw new Error(`Not a valid semver version: '${version}'`);
        }
        else if (this._changes[version]) {
            throw new Error(`Release already exists: '${version}'`);
        }
        this._changes[version] = {};
        const newRelease = { version, date, status };
        if (addToStart) {
            this._releases.unshift(newRelease);
        }
        else {
            this._releases.push(newRelease);
        }
    }
/**
     * Add a release 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.date - An ISO-8601 formatted date, representing the release
     * date.
     * @param options.status - The status of the release (e.g. 'WITHDRAWN',
     * 'DEPRECATED')
     * @param options.version - The version of the current release, which should
     * be a [SemVer](https://semver.org/spec/v2.0.0.html)-compatible version.
     */
Add a release 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.date - An ISO-8601 formatted date, representing the release
date.
@param options.status - The status of the release
@param options.version - The version of the current release, which should
be a [SemVer]-compatible version.
Add a release 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 . date - An ISO - 8601 formatted date representing the release date . @param options . status - The status of the release @param options . version - The version of the current release which should be a [ SemVer ] - compatible version .
addRelease({ addToStart = true, date, status, version }) {
        if (!version) {
            throw new Error('Version required');
        }
        else if (semver_1.default.valid(version) === null) {
            throw new Error(`Not a valid semver version: '${version}'`);
        }
        else if (this._changes[version]) {
            throw new Error(`Release already exists: '${version}'`);
        }
        this._changes[version] = {};
        const newRelease = { version, date, status };
        if (addToStart) {
            this._releases.unshift(newRelease);
        }
        else {
            this._releases.push(newRelease);
        }
    }
addRelease ( { addToStart = true , date , status , version } ) { if ( ! version ) { throw new Error ( 'Version required' ) ; } else if ( semver_1 . default . valid ( version ) === null ) { throw new Error ( ` ${ version } ` ) ; } else if ( this . _changes [ version ] ) { throw new Error ( ` ${ version } ` ) ; } this . _changes [ version ] = { } ; const newRelease = { version , date , status } ; if ( addToStart ) { this . _releases . unshift ( newRelease ) ; } else { this . _releases . push ( newRelease ) ; } }
Add a release to the changelog.
Add a release to the changelog .