style(lint): re-format modules/@angular
This commit is contained in:
@ -1,14 +1,17 @@
|
||||
import {isString, isPresent} from '../../src/facade/lang';
|
||||
import {isPresent, isString} from '../../src/facade/lang';
|
||||
|
||||
const SVG_PREFIX = ':svg:';
|
||||
|
||||
var document = typeof (global as any /** TODO #???? */)['document'] == 'object' ? (global as any /** TODO #???? */)['document'] : null;
|
||||
var document = typeof(global as any /** TODO #???? */)['document'] == 'object' ?
|
||||
(global as any /** TODO #???? */)['document'] :
|
||||
null;
|
||||
|
||||
export function extractSchema(): Map<string, string[]> {
|
||||
var SVGGraphicsElement = (global as any /** TODO #???? */)['SVGGraphicsElement'];
|
||||
var SVGAnimationElement = (global as any /** TODO #???? */)['SVGAnimationElement'];
|
||||
var SVGGeometryElement = (global as any /** TODO #???? */)['SVGGeometryElement'];
|
||||
var SVGComponentTransferFunctionElement = (global as any /** TODO #???? */)['SVGComponentTransferFunctionElement'];
|
||||
var SVGComponentTransferFunctionElement =
|
||||
(global as any /** TODO #???? */)['SVGComponentTransferFunctionElement'];
|
||||
var SVGGradientElement = (global as any /** TODO #???? */)['SVGGradientElement'];
|
||||
var SVGTextContentElement = (global as any /** TODO #???? */)['SVGTextContentElement'];
|
||||
var SVGTextPositioningElement = (global as any /** TODO #???? */)['SVGTextPositioningElement'];
|
||||
@ -27,44 +30,47 @@ export function extractSchema(): Map<string, string[]> {
|
||||
extractProperties(HTMLElement, element, visited, descMap, '', '*');
|
||||
extractProperties(HTMLMediaElement, element, visited, descMap, 'media', '');
|
||||
extractProperties(SVGElement, svgText, visited, descMap, SVG_PREFIX, '*');
|
||||
extractProperties(SVGGraphicsElement, svgText, visited, descMap, SVG_PREFIX + 'graphics',
|
||||
SVG_PREFIX);
|
||||
extractProperties(SVGAnimationElement, svgAnimation, visited, descMap,
|
||||
SVG_PREFIX + 'animation', SVG_PREFIX);
|
||||
extractProperties(SVGGeometryElement, svgPath, visited, descMap, SVG_PREFIX + 'geometry',
|
||||
SVG_PREFIX);
|
||||
extractProperties(SVGComponentTransferFunctionElement, svgFeFuncA, visited, descMap,
|
||||
SVG_PREFIX + 'componentTransferFunction', SVG_PREFIX);
|
||||
extractProperties(SVGGradientElement, svgGradient, visited, descMap, SVG_PREFIX + 'gradient',
|
||||
SVG_PREFIX);
|
||||
extractProperties(SVGTextContentElement, svgText, visited, descMap,
|
||||
SVG_PREFIX + 'textContent', SVG_PREFIX + 'graphics');
|
||||
extractProperties(SVGTextPositioningElement, svgText, visited, descMap,
|
||||
SVG_PREFIX + 'textPositioning', SVG_PREFIX + 'textContent');
|
||||
extractProperties(
|
||||
SVGGraphicsElement, svgText, visited, descMap, SVG_PREFIX + 'graphics', SVG_PREFIX);
|
||||
extractProperties(
|
||||
SVGAnimationElement, svgAnimation, visited, descMap, SVG_PREFIX + 'animation', SVG_PREFIX);
|
||||
extractProperties(
|
||||
SVGGeometryElement, svgPath, visited, descMap, SVG_PREFIX + 'geometry', SVG_PREFIX);
|
||||
extractProperties(
|
||||
SVGComponentTransferFunctionElement, svgFeFuncA, visited, descMap,
|
||||
SVG_PREFIX + 'componentTransferFunction', SVG_PREFIX);
|
||||
extractProperties(
|
||||
SVGGradientElement, svgGradient, visited, descMap, SVG_PREFIX + 'gradient', SVG_PREFIX);
|
||||
extractProperties(
|
||||
SVGTextContentElement, svgText, visited, descMap, SVG_PREFIX + 'textContent',
|
||||
SVG_PREFIX + 'graphics');
|
||||
extractProperties(
|
||||
SVGTextPositioningElement, svgText, visited, descMap, SVG_PREFIX + 'textPositioning',
|
||||
SVG_PREFIX + 'textContent');
|
||||
var keys = Object.getOwnPropertyNames(window).filter(
|
||||
k => k.endsWith('Element') && (k.startsWith('HTML') || k.startsWith('SVG')));
|
||||
keys.sort();
|
||||
keys.forEach(name => extractRecursiveProperties(visited, descMap, (window as any /** TODO #???? */)[name]));
|
||||
keys.forEach(
|
||||
name =>
|
||||
extractRecursiveProperties(visited, descMap, (window as any /** TODO #???? */)[name]));
|
||||
|
||||
return descMap;
|
||||
}
|
||||
|
||||
function extractRecursiveProperties(visited: {[name: string]: boolean}, descMap: Map<string, string[]>,
|
||||
type: Function): string {
|
||||
function extractRecursiveProperties(
|
||||
visited: {[name: string]: boolean}, descMap: Map<string, string[]>, type: Function): string {
|
||||
var name = extractName(type);
|
||||
if (visited[name]) return name; // already been here
|
||||
var superName = '';
|
||||
if (name != '*') {
|
||||
superName =
|
||||
extractRecursiveProperties(visited, descMap, type.prototype.__proto__.constructor);
|
||||
superName = extractRecursiveProperties(visited, descMap, type.prototype.__proto__.constructor);
|
||||
}
|
||||
|
||||
var instance: HTMLElement = null;
|
||||
name.split(',').forEach(tagName => {
|
||||
instance = isSVG(type) ?
|
||||
document.createElementNS('http://www.w3.org/2000/svg',
|
||||
tagName.replace(SVG_PREFIX, '')) :
|
||||
document.createElement(tagName);
|
||||
document.createElementNS('http://www.w3.org/2000/svg', tagName.replace(SVG_PREFIX, '')) :
|
||||
document.createElement(tagName);
|
||||
var htmlType = type;
|
||||
if (tagName == 'cite') htmlType = HTMLElement;
|
||||
if (!(instance instanceof htmlType)) {
|
||||
@ -75,8 +81,9 @@ function extractRecursiveProperties(visited: {[name: string]: boolean}, descMap:
|
||||
return name;
|
||||
}
|
||||
|
||||
function extractProperties(type: Function, instance: any, visited: {[name: string]: boolean},
|
||||
descMap: Map<string, string[]>, name: string, superName: string) {
|
||||
function extractProperties(
|
||||
type: Function, instance: any, visited: {[name: string]: boolean},
|
||||
descMap: Map<string, string[]>, name: string, superName: string) {
|
||||
if (!type) return;
|
||||
visited[name] = true;
|
||||
const fullName = name + (superName ? '^' + superName : '');
|
||||
|
Reference in New Issue
Block a user