refactor: Rename resourceExists to hasResource

The function was also moved to the smaller interface ResourceSet.
This commit is contained in:
Joachim Van Herwegen
2022-02-23 15:41:31 +01:00
parent 2ae5924dde
commit 4404fa07d9
26 changed files with 73 additions and 64 deletions

View File

@@ -3,6 +3,7 @@ import type { Representation } from '../http/representation/Representation';
import type { RepresentationPreferences } from '../http/representation/RepresentationPreferences';
import type { ResourceIdentifier } from '../http/representation/ResourceIdentifier';
import type { Conditions } from './Conditions';
import type { ResourceSet } from './ResourceSet';
/**
* A ResourceStore represents a collection of resources.
@@ -15,16 +16,7 @@ import type { Conditions } from './Conditions';
* ResourceStores are also responsible for taking auxiliary resources into account
* should those be relevant to the store.
*/
export interface ResourceStore {
/**
* Check if a resource exists.
* @param identifier - Identifier of resource to check.
*
* @returns A promise resolving if the resource already exists
*/
resourceExists: (identifier: ResourceIdentifier, conditions?: Conditions) => Promise<boolean>;
export interface ResourceStore extends ResourceSet {
/**
* Retrieves a representation of a resource.
* @param identifier - Identifier of the resource to read.