https://github.com/angular/angular
Raw File
Tip revision: 98de2176400c86e6bbcb98754811af3f7c65280c authored by Jessica Janiuk on 28 April 2021, 18:58:23 UTC
release: cut the v12.0.0-rc.1 release (#41864)
Tip revision: 98de217
lang_utils.ts
/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

export function getTypeOf(instance: any /** TODO #9100 */) {
  return instance.constructor;
}

export function instantiateType(type: Function, params: any[] = []) {
  return new (<any>type)(...params);
}
back to top