Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
location.resolveCatalogEntry = function(options) {
if (!options) {
options = {};
}
if (location.resolvePathPromise && !location.resolvePathPromise.cancelled) {
dataCatalog.applyCancellable(location.resolvePathPromise, options);
return location.resolvePathPromise;
}
if (!location.identifierChain && !location.colRef && !location.colRef.identifierChain) {
if (!location.resolvePathPromise) {
location.resolvePathPromise = $.Deferred()
.reject()
.promise();
}
return location.resolvePathPromise;
}
const promise = sqlUtils.resolveCatalogEntry({
sourceType: sourceType,
namespace: namespace,
compute: compute,
const resolveCatalogEntry = options => {
const cancellablePromises = [];
const deferred = $.Deferred();
const promise = new CancellablePromise(deferred, undefined, cancellablePromises);
dataCatalog.applyCancellable(promise, options);
if (!options.identifierChain) {
deferred.reject();
return promise;
}
const findInTree = (currentEntry, fieldsToGo) => {
if (fieldsToGo.length === 0) {
deferred.reject();
return;
}
let nextField;
if (currentEntry.getType() === 'map') {
nextField = 'value';
} else if (currentEntry.getType() === 'array') {