Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return async (addSearchableTransformer, storageConfig) => {
const transformerList = [
// TODO: Removing until further discussion. `getTransformerOptions(project, '@model')`
new DynamoDBModelTransformer(),
new VersionedModelTransformer(),
new FunctionTransformer(),
new HttpTransformer(),
new KeyTransformer(),
new ModelConnectionTransformer(),
new PredictionsTransformer(storageConfig),
];
if (addSearchableTransformer) {
transformerList.push(new SearchableModelTransformer());
}
const customTransformersConfig = await readTransformerConfiguration(resourceDir);
const customTransformers = (customTransformersConfig && customTransformersConfig.transformers
? customTransformersConfig.transformers
: []
)
.map(transformer => {
const fileUrlMatch = /^file:\/\/(.*)\s*$/m.exec(transformer);
const modulePath = fileUrlMatch ? fileUrlMatch[1] : transformer;
if (!modulePath) {