Initial
This commit is contained in:
16
resources/app/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js
generated
vendored
Normal file
16
resources/app/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { EndpointError } from "../types";
|
||||
import { callFunction } from "./callFunction";
|
||||
import { evaluateTemplate } from "./evaluateTemplate";
|
||||
import { getReferenceValue } from "./getReferenceValue";
|
||||
export const evaluateExpression = (obj, keyName, options) => {
|
||||
if (typeof obj === "string") {
|
||||
return evaluateTemplate(obj, options);
|
||||
}
|
||||
else if (obj["fn"]) {
|
||||
return callFunction(obj, options);
|
||||
}
|
||||
else if (obj["ref"]) {
|
||||
return getReferenceValue(obj, options);
|
||||
}
|
||||
throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
|
||||
};
|
||||
Reference in New Issue
Block a user