refactor(injector): rename humanize into stringify
This commit is contained in:
parent
b2199632c7
commit
a85812f688
|
@ -1,9 +1,9 @@
|
|||
import {ListWrapper, List} from 'facade/collection';
|
||||
import {humanize} from 'facade/lang';
|
||||
import {stringify} from 'facade/lang';
|
||||
|
||||
function constructResolvingPath(keys: List) {
|
||||
if (keys.length > 1) {
|
||||
var tokenStrs = ListWrapper.map(keys, (k) => humanize(k.token));
|
||||
var tokenStrs = ListWrapper.map(keys, (k) => stringify(k.token));
|
||||
return " (" + tokenStrs.join(' -> ') + ")";
|
||||
} else {
|
||||
return "";
|
||||
|
@ -16,7 +16,7 @@ export class NoProviderError extends Error {
|
|||
}
|
||||
|
||||
_constructResolvingMessage(keys:List) {
|
||||
var last = humanize(ListWrapper.last(keys).token);
|
||||
var last = stringify(ListWrapper.last(keys).token);
|
||||
return `No provider for ${last}!${constructResolvingPath(keys)}`;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ export class AsyncProviderError extends Error {
|
|||
}
|
||||
|
||||
_constructResolvingMessage(keys:List) {
|
||||
var last = humanize(ListWrapper.last(keys).token);
|
||||
var last = stringify(ListWrapper.last(keys).token);
|
||||
return `Cannot instantiate ${last} synchronously. ` +
|
||||
`It is provided as a future!${constructResolvingPath(keys)}`;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ class IMPLEMENTS {
|
|||
bool isPresent(obj) => obj != null;
|
||||
bool isBlank(obj) => obj == null;
|
||||
|
||||
String humanize(obj) => obj.toString();
|
||||
String stringify(obj) => obj.toString();
|
||||
|
||||
class StringWrapper {
|
||||
static String fromCharCode(int code) {
|
||||
|
|
|
@ -19,7 +19,7 @@ export function isBlank(obj){
|
|||
return obj == undefined || obj == null;
|
||||
}
|
||||
|
||||
export function humanize(token) {
|
||||
export function stringify(token) {
|
||||
if (typeof token === 'string') {
|
||||
return token;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue