Get rid of facade/lang deps (fixes #129)

This commit is contained in:
Roman Hotsiy 2016-10-29 12:31:56 +03:00
parent f3b7c13ae0
commit c95755718f
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
4 changed files with 18 additions and 3 deletions

View File

@ -1,6 +1,6 @@
'use strict';
import { Injectable } from '@angular/core';
import { isFunction, isString } from '@angular/core/src/facade/lang';
import { isFunction, isString } from '../utils/helpers';
import { BrowserDomAdapter as DOM } from '../utils/browser-adapter';
const defaults = {

View File

@ -1,6 +1,5 @@
'use strict';
import { Pipe, PipeTransform } from '@angular/core';
//import { isBlank } from '@angular/core/src/facade/lang';
import { DomSanitizer } from '@angular/platform-browser';
function isBlank(obj) {

View File

@ -21,6 +21,22 @@ interface HeadersHandler {
close: Function;
}
export function stringify(obj:any) {
return JSON.stringify(obj);
}
export function isString(str:any) {
return typeof str === 'string';
}
export function isFunction(func: any) {
return typeof func === 'function';
}
export function isBlank(obj: any): boolean {
return obj == null;
}
export function renderMd(rawText:string, headersHandler?:HeadersHandler) {
let _origRule;
if (headersHandler) {

View File

@ -2,7 +2,7 @@
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { isString, stringify, isBlank } from '@angular/core/src/facade/lang';
import { isString, stringify, isBlank } from './helpers';
import JsonPointer from './JsonPointer';
import { renderMd } from './helpers';
import { JsonFormatter } from './JsonFormatterPipe';