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