Skip to main content

entityHasVersion

Callable

  • entityHasVersion(directory: string): (id: string, version?: string) => Promise<boolean>

  • Check to see if the catalog has a version for the given entity.

    @example
    import utils from '@eventcatalog/utils';

    const { entityHasVersion } = utils('/path/to/eventcatalog');

    // returns true if version is found for the given entity and version (supports semver)
    await entityHasVersion('User', '0.0.1');
    await entityHasVersion('User', 'latest');
    await entityHasVersion('User', '0.0.x');