function getResource(context, name, isBlob, isBlobAuto) {
  let res;
  const { id, resCache, resources } = context;
  const key = resources[name];
  if (key) {
    // data URIs aren't cached in bridge, so we'll send them
    const isData = key::slice(0, 5) === 'data:';
    const bucketKey = isBlob == null ? 0 : 1 + (isBlob = isBlobAuto ? !isData : isBlob);
    res = isData && isBlob === false || ensureNestedProp(resCache, bucketKey, key, false);
    if (!res) {
      res = bridge.call('GetResource', { id, isBlob, key, raw: isData && key });
      ensureNestedProp(resCache, bucketKey, key, res);
    }
  }
  return resolveOrReturn(context, res === true ? key : res);
}
@param {GMContext} context
@param name
@param isBlob
@param isBlobAuto