function trustAs(type, trustedValue) {
      var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
      if (!Constructor) {
        throw $sceMinErr('icontext',
            'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',
            type, trustedValue);
      }
      if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {
        return trustedValue;
      }
      // All the current contexts in SCE_CONTEXTS happen to be strings.  In order to avoid trusting
      // mutable objects, we ensure here that the value passed in is actually a string.
      if (typeof trustedValue !== 'string') {
        throw $sceMinErr('itype',
            'Attempted to trust a non-string value in a content requiring a string: Context: {0}',
            type);
      }
      return new Constructor(trustedValue);
    }
@ngdoc method
@name $sceDelegate#trustAs

@description
Returns a trusted representation of the parameter for the specified context. This trusted
object will later on be used as-is, without any security check, by bindings or directives
that require this security context.
For instance, marking a string as trusted for the `$sce.HTML` context will entirely bypass
the potential `$sanitize` call in corresponding `$sce.HTML` bindings or directives, such as
`ng-bind-html`. Note that in most cases you won't need to call this function: if you have the
sanitizer loaded, passing the value itself will render all the HTML that does not pose a
security risk.

See {@link ng.$sceDelegate#getTrusted getTrusted} for the function that will consume those
trusted values, and {@link ng.$sce $sce} for general documentation about strict contextual
escaping.

@param {string} type The context in which this value is safe for use, e.g. `$sce.URL`,
    `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`.

@param {*} value The value that should be considered trusted.
@return {*} A trusted representation of value, that can be used in the given context.