refactor: remove dead code
This commit is contained in:
parent
58605cf350
commit
425c1e6042
|
@ -12,7 +12,6 @@ export const isDefaultChangeDetectionStrategy: typeof r.isDefaultChangeDetection
|
||||||
r.isDefaultChangeDetectionStrategy;
|
r.isDefaultChangeDetectionStrategy;
|
||||||
export type ChangeDetectorStatus = typeof r._ChangeDetectorStatus;
|
export type ChangeDetectorStatus = typeof r._ChangeDetectorStatus;
|
||||||
export const ChangeDetectorStatus: typeof r.ChangeDetectorStatus = r.ChangeDetectorStatus;
|
export const ChangeDetectorStatus: typeof r.ChangeDetectorStatus = r.ChangeDetectorStatus;
|
||||||
r.CHANGE_DETECTION_STRATEGY_VALUES;
|
|
||||||
export type LifecycleHooks = typeof r._LifecycleHooks;
|
export type LifecycleHooks = typeof r._LifecycleHooks;
|
||||||
export const LifecycleHooks: typeof r.LifecycleHooks = r.LifecycleHooks;
|
export const LifecycleHooks: typeof r.LifecycleHooks = r.LifecycleHooks;
|
||||||
export const LIFECYCLE_HOOKS_VALUES: typeof r.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;
|
export const LIFECYCLE_HOOKS_VALUES: typeof r.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs
|
||||||
export {SimpleChanges} from '../metadata/lifecycle_hooks';
|
export {SimpleChanges} from '../metadata/lifecycle_hooks';
|
||||||
export {SimpleChange, UNINITIALIZED, ValueUnwrapper, WrappedValue, devModeEqual, looseIdentical} from './change_detection_util';
|
export {SimpleChange, UNINITIALIZED, ValueUnwrapper, WrappedValue, devModeEqual, looseIdentical} from './change_detection_util';
|
||||||
export {ChangeDetectorRef} from './change_detector_ref';
|
export {ChangeDetectorRef} from './change_detector_ref';
|
||||||
export {CHANGE_DETECTION_STRATEGY_VALUES, ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionStrategy} from './constants';
|
export {ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionStrategy} from './constants';
|
||||||
export {CollectionChangeRecord, DefaultIterableDifferFactory} from './differs/default_iterable_differ';
|
export {CollectionChangeRecord, DefaultIterableDifferFactory} from './differs/default_iterable_differ';
|
||||||
export {DefaultIterableDiffer} from './differs/default_iterable_differ';
|
export {DefaultIterableDiffer} from './differs/default_iterable_differ';
|
||||||
export {DefaultKeyValueDifferFactory, KeyValueChangeRecord} from './differs/default_keyvalue_differ';
|
export {DefaultKeyValueDifferFactory, KeyValueChangeRecord} from './differs/default_keyvalue_differ';
|
||||||
|
|
|
@ -66,25 +66,6 @@ export enum ChangeDetectorStatus {
|
||||||
Destroyed,
|
Destroyed,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* List of possible {@link ChangeDetectionStrategy} values.
|
|
||||||
*/
|
|
||||||
export var CHANGE_DETECTION_STRATEGY_VALUES = [
|
|
||||||
ChangeDetectionStrategy.OnPush,
|
|
||||||
ChangeDetectionStrategy.Default,
|
|
||||||
];
|
|
||||||
/**
|
|
||||||
* List of possible {@link ChangeDetectorStatus} values.
|
|
||||||
*/
|
|
||||||
export var CHANGE_DETECTOR_STATUS_VALUES = [
|
|
||||||
ChangeDetectorStatus.CheckOnce,
|
|
||||||
ChangeDetectorStatus.Checked,
|
|
||||||
ChangeDetectorStatus.CheckAlways,
|
|
||||||
ChangeDetectorStatus.Detached,
|
|
||||||
ChangeDetectorStatus.Errored,
|
|
||||||
ChangeDetectorStatus.Destroyed,
|
|
||||||
];
|
|
||||||
|
|
||||||
export function isDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy):
|
export function isDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy):
|
||||||
boolean {
|
boolean {
|
||||||
return isBlank(changeDetectionStrategy) ||
|
return isBlank(changeDetectionStrategy) ||
|
||||||
|
|
|
@ -44,7 +44,6 @@ export var __core_private__: {
|
||||||
isDefaultChangeDetectionStrategy: typeof constants.isDefaultChangeDetectionStrategy,
|
isDefaultChangeDetectionStrategy: typeof constants.isDefaultChangeDetectionStrategy,
|
||||||
ChangeDetectorStatus: typeof constants.ChangeDetectorStatus,
|
ChangeDetectorStatus: typeof constants.ChangeDetectorStatus,
|
||||||
_ChangeDetectorStatus?: constants.ChangeDetectorStatus,
|
_ChangeDetectorStatus?: constants.ChangeDetectorStatus,
|
||||||
CHANGE_DETECTION_STRATEGY_VALUES: typeof constants.CHANGE_DETECTION_STRATEGY_VALUES,
|
|
||||||
constructDependencies: typeof reflective_provider.constructDependencies,
|
constructDependencies: typeof reflective_provider.constructDependencies,
|
||||||
LifecycleHooks: typeof lifecycle_hooks.LifecycleHooks,
|
LifecycleHooks: typeof lifecycle_hooks.LifecycleHooks,
|
||||||
_LifecycleHooks?: lifecycle_hooks.LifecycleHooks,
|
_LifecycleHooks?: lifecycle_hooks.LifecycleHooks,
|
||||||
|
@ -69,7 +68,6 @@ export var __core_private__: {
|
||||||
flattenNestedViewRenderNodes: typeof view_utils.flattenNestedViewRenderNodes,
|
flattenNestedViewRenderNodes: typeof view_utils.flattenNestedViewRenderNodes,
|
||||||
interpolate: typeof view_utils.interpolate,
|
interpolate: typeof view_utils.interpolate,
|
||||||
ViewUtils: typeof view_utils.ViewUtils, _ViewUtils?: view_utils.ViewUtils,
|
ViewUtils: typeof view_utils.ViewUtils, _ViewUtils?: view_utils.ViewUtils,
|
||||||
VIEW_ENCAPSULATION_VALUES: typeof metadata_view.VIEW_ENCAPSULATION_VALUES,
|
|
||||||
ViewMetadata: typeof metadata_view.ViewMetadata, _ViewMetadata?: metadata_view.ViewMetadata,
|
ViewMetadata: typeof metadata_view.ViewMetadata, _ViewMetadata?: metadata_view.ViewMetadata,
|
||||||
DebugContext: typeof debug_context.DebugContext, _DebugContext?: debug_context.DebugContext,
|
DebugContext: typeof debug_context.DebugContext, _DebugContext?: debug_context.DebugContext,
|
||||||
StaticNodeDebugInfo: typeof debug_context.StaticNodeDebugInfo,
|
StaticNodeDebugInfo: typeof debug_context.StaticNodeDebugInfo,
|
||||||
|
@ -124,7 +122,6 @@ export var __core_private__: {
|
||||||
} = {
|
} = {
|
||||||
isDefaultChangeDetectionStrategy: constants.isDefaultChangeDetectionStrategy,
|
isDefaultChangeDetectionStrategy: constants.isDefaultChangeDetectionStrategy,
|
||||||
ChangeDetectorStatus: constants.ChangeDetectorStatus,
|
ChangeDetectorStatus: constants.ChangeDetectorStatus,
|
||||||
CHANGE_DETECTION_STRATEGY_VALUES: constants.CHANGE_DETECTION_STRATEGY_VALUES,
|
|
||||||
constructDependencies: reflective_provider.constructDependencies,
|
constructDependencies: reflective_provider.constructDependencies,
|
||||||
LifecycleHooks: lifecycle_hooks.LifecycleHooks,
|
LifecycleHooks: lifecycle_hooks.LifecycleHooks,
|
||||||
LIFECYCLE_HOOKS_VALUES: lifecycle_hooks.LIFECYCLE_HOOKS_VALUES,
|
LIFECYCLE_HOOKS_VALUES: lifecycle_hooks.LIFECYCLE_HOOKS_VALUES,
|
||||||
|
@ -141,7 +138,6 @@ export var __core_private__: {
|
||||||
flattenNestedViewRenderNodes: view_utils.flattenNestedViewRenderNodes,
|
flattenNestedViewRenderNodes: view_utils.flattenNestedViewRenderNodes,
|
||||||
interpolate: view_utils.interpolate,
|
interpolate: view_utils.interpolate,
|
||||||
ViewUtils: view_utils.ViewUtils,
|
ViewUtils: view_utils.ViewUtils,
|
||||||
VIEW_ENCAPSULATION_VALUES: metadata_view.VIEW_ENCAPSULATION_VALUES,
|
|
||||||
ViewMetadata: metadata_view.ViewMetadata,
|
ViewMetadata: metadata_view.ViewMetadata,
|
||||||
DebugContext: debug_context.DebugContext,
|
DebugContext: debug_context.DebugContext,
|
||||||
StaticNodeDebugInfo: debug_context.StaticNodeDebugInfo,
|
StaticNodeDebugInfo: debug_context.StaticNodeDebugInfo,
|
||||||
|
|
|
@ -37,10 +37,6 @@ export enum ViewEncapsulation {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
export var VIEW_ENCAPSULATION_VALUES =
|
|
||||||
[ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata properties available for configuring Views.
|
* Metadata properties available for configuring Views.
|
||||||
*
|
*
|
||||||
|
|
|
@ -12,8 +12,6 @@ export type RenderDebugInfo = typeof r._RenderDebugInfo;
|
||||||
export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
|
export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
|
||||||
|
|
||||||
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
|
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
|
||||||
export var VIEW_ENCAPSULATION_VALUES: typeof r.VIEW_ENCAPSULATION_VALUES =
|
|
||||||
r.VIEW_ENCAPSULATION_VALUES;
|
|
||||||
|
|
||||||
export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer;
|
export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer;
|
||||||
export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;
|
export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;
|
||||||
|
|
|
@ -13,9 +13,6 @@ export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
|
||||||
|
|
||||||
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
|
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
|
||||||
|
|
||||||
export var VIEW_ENCAPSULATION_VALUES: typeof r.VIEW_ENCAPSULATION_VALUES =
|
|
||||||
r.VIEW_ENCAPSULATION_VALUES;
|
|
||||||
|
|
||||||
export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer;
|
export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer;
|
||||||
export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;
|
export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;
|
||||||
export var reflector: typeof r.reflector = r.reflector;
|
export var reflector: typeof r.reflector = r.reflector;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
import {Injectable, RenderComponentType, Type, ViewEncapsulation} from '@angular/core';
|
import {Injectable, RenderComponentType, Type, ViewEncapsulation} from '@angular/core';
|
||||||
|
|
||||||
import {isArray, isPresent} from '../../facade/lang';
|
import {isArray, isPresent} from '../../facade/lang';
|
||||||
import {VIEW_ENCAPSULATION_VALUES} from '../../private_import_core';
|
|
||||||
|
|
||||||
import {RenderStore} from './render_store';
|
import {RenderStore} from './render_store';
|
||||||
import {LocationType} from './serialized_types';
|
import {LocationType} from './serialized_types';
|
||||||
|
@ -54,26 +53,32 @@ export class Serializer {
|
||||||
if (!isPresent(map)) {
|
if (!isPresent(map)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (isArray(map)) {
|
|
||||||
var obj: any[] = [];
|
if (Array.isArray(map)) {
|
||||||
(<any[]>map).forEach(val => obj.push(this.deserialize(val, type, data)));
|
return (<any[]>map).map(val => this.deserialize(val, type, data));
|
||||||
return obj;
|
|
||||||
}
|
}
|
||||||
if (type == PRIMITIVE) {
|
|
||||||
|
if (type === PRIMITIVE) {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == RenderStoreObject) {
|
if (type === RenderStoreObject) {
|
||||||
return this._renderStore.deserialize(map);
|
return this._renderStore.deserialize(map);
|
||||||
} else if (type === RenderComponentType) {
|
|
||||||
return this._deserializeRenderComponentType(map);
|
|
||||||
} else if (type === ViewEncapsulation) {
|
|
||||||
return VIEW_ENCAPSULATION_VALUES[map];
|
|
||||||
} else if (type === LocationType) {
|
|
||||||
return this._deserializeLocation(map);
|
|
||||||
} else {
|
|
||||||
throw new Error('No deserializer for ' + type.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === RenderComponentType) {
|
||||||
|
return this._deserializeRenderComponentType(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === ViewEncapsulation) {
|
||||||
|
return map as ViewEncapsulation;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === LocationType) {
|
||||||
|
return this._deserializeLocation(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error('No deserializer for ' + type.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private _serializeLocation(loc: LocationType): Object {
|
private _serializeLocation(loc: LocationType): Object {
|
||||||
|
|
Loading…
Reference in New Issue