mframejs
Version:
simple framework
19 lines • 665 B
JavaScript
import { Cache } from '../utils/exported';
export function getCorrectContext(value, ctx) {
const keys = Cache.keyMaps.getCreate(value);
const key = keys[0];
let newCtx = ctx;
let overrideCtx;
if (typeof key === 'string' && key[0] !== '$') {
if (newCtx && newCtx.$overrideContext) {
while (newCtx.$overrideContext) {
newCtx = newCtx.$overrideContext;
if (newCtx && newCtx.$context && key in newCtx.$context) {
overrideCtx = newCtx;
}
}
}
}
return overrideCtx || ctx;
}
//# sourceMappingURL=contextOfObject.js.map