UNPKG

823 BJavaScriptView Raw
1import { assertValidationError } from '../errors/utils/assertValidationError.mjs';
2import { StorageValidationErrorCode } from '../errors/types/validation.mjs';
3
4// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5// SPDX-License-Identifier: Apache-2.0
6const resolvePrefix = ({ accessLevel, targetIdentityId, }) => {
7 if (accessLevel === 'private') {
8 assertValidationError(!!targetIdentityId, StorageValidationErrorCode.NoIdentityId);
9 return `private/${targetIdentityId}/`;
10 }
11 else if (accessLevel === 'protected') {
12 assertValidationError(!!targetIdentityId, StorageValidationErrorCode.NoIdentityId);
13 return `protected/${targetIdentityId}/`;
14 }
15 else {
16 return 'public/';
17 }
18};
19
20export { resolvePrefix };
21//# sourceMappingURL=resolvePrefix.mjs.map