Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const applyProviderMutations = (
schema: ResolvedSchema,
yamlDocument: YAMLDocument
): ResolvedSchema => {
const jsonSchema = schema.schema
if (
yamlDocument.documentType === DocumentType.SERVERLESS_FRAMEWORK &&
yamlDocument.root
) {
const clonedSchema = cloneDeep(jsonSchema)
const runtimeNode = yamlDocument.root.get(["provider", "runtime"])
if (runtimeNode) {
try {
updateFunctionProperties(
clonedSchema.properties.functions.oneOf[0]
.patternProperties["^[a-zA-Z0-9]+$"]
)
updateFunctionProperties(
clonedSchema.properties.functions.oneOf[1].items
.patternProperties["^[a-zA-Z0-9]+$"]
)
} catch (err) {