|
4 | 4 | import { initAwsUiVersions } from '@cloudscape-design/component-toolkit/internal';
|
5 | 5 |
|
6 | 6 | import { AnalyticsMetadata } from '../analytics/interfaces';
|
7 |
| -import { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from '../environment'; |
8 |
| -import { isDevelopment } from '../is-development'; |
| 7 | +import { PACKAGE_SOURCE, PACKAGE_VERSION } from '../environment'; |
9 | 8 |
|
10 | 9 | // these styles needed to be imported for every public component
|
11 | 10 | import './styles.css.js';
|
@@ -40,25 +39,6 @@ export function getBaseProps(props: BaseComponentProps) {
|
40 | 39 | return baseProps as BaseComponentProps;
|
41 | 40 | }
|
42 | 41 |
|
43 |
| -export function validateProps( |
44 |
| - componentName: string, |
45 |
| - props: Record<string, any>, |
46 |
| - excludedProps: Array<string>, |
47 |
| - allowedEnums: Record<string, Array<string>> |
48 |
| -) { |
49 |
| - if (!isDevelopment) { |
50 |
| - return; |
51 |
| - } |
52 |
| - for (const [prop, value] of Object.entries(props)) { |
53 |
| - if (excludedProps.includes(prop)) { |
54 |
| - throw new Error(`${componentName} does not support "${prop}" property when used in ${THEME} theme`); |
55 |
| - } |
56 |
| - if (value && allowedEnums[prop] && !allowedEnums[prop].includes(value)) { |
57 |
| - throw new Error(`${componentName} does not support "${prop}" with value "${value}" when used in ${THEME} theme`); |
58 |
| - } |
59 |
| - } |
60 |
| -} |
61 |
| - |
62 | 42 | export interface BasePropsWithAnalyticsMetadata {
|
63 | 43 | analyticsMetadata?: AnalyticsMetadata;
|
64 | 44 | __analyticsMetadata?: AnalyticsMetadata;
|
|
0 commit comments