Skip to content

Commit

Permalink
style(*): format with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
freshgum-bubbles committed Sep 17, 2023
1 parent 7c5ea1a commit 188176f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .changeset/nine-kings-mix.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Container.set({ id: NAME, value: 'Joanna' });

// Ensure we can access the identifier via Container.get(A).
if (Container.has(NAME, false, IdentifierScope.Singular)) {
console.log(Container.get(NAME));
console.log(Container.get(NAME));
}

// This will throw:
Container.getMany(NAME);
```
```
6 changes: 5 additions & 1 deletion src/container-instance.class.mts
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,11 @@ export class ContainerInstance implements Disposable {
/** If Self() is used, do not use recursion. */
const recursive = !isSelf;

const identifierIsPresent = targetContainer.has(identifier, recursive, isMany ? IdentifierScope.Many : IdentifierScope.Singular);
const identifierIsPresent = targetContainer.has(
identifier,
recursive,
isMany ? IdentifierScope.Many : IdentifierScope.Singular
);

/**
* Straight away, check if optional was declared.
Expand Down
18 changes: 9 additions & 9 deletions src/types/identifier-scope.type.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* A specification of how an identifier is implemented inside a container.
*/
export const enum IdentifierScope {
/** The identifier is implemented as a group of values. */
Many = 0b10,
/** The identifier is implemented as a group of values. */
Many = 0b10,

/** The identifier is implemented as a singular item. */
Singular = 0b01,
/** The identifier is implemented as a singular item. */
Singular = 0b01,

/**
* The identifier is either implemented as {@link IdentifierScope.Many | a group of values},
* or {@link IdentifierScope.Singular | a singular value}.
*/
Any = 0b11
/**
* The identifier is either implemented as {@link IdentifierScope.Many | a group of values},
* or {@link IdentifierScope.Singular | a singular value}.
*/
Any = 0b11,
}

0 comments on commit 188176f

Please sign in to comment.