mirror of
				https://github.com/flynx/object.js.git
				synced 2025-10-31 03:20:09 +00:00 
			
		
		
		
	added doc/text template string tags...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									979d8cb5bb
								
							
						
					
					
						commit
						817fda0ef7
					
				| @ -144,7 +144,7 @@ class B extends A { | ||||
| 		- [`RawInstance(..)`](#rawinstance) | ||||
| 		- [`Constructor(..)` / `C(..)`](#constructor--c) | ||||
| 	- [Utilities](#utilities) | ||||
| 		- [`normalizeIndent(..)` / `normalizeTextIndent(..)`](#normalizeindent--normalizetextindent) | ||||
| 		- [`normalizeIndent(..)` / `normalizeTextIndent(..)` / `doc` / `text`](#normalizeindent--normalizetextindent--doc--text) | ||||
| 		- [`deepKeys(..)`](#deepkeys) | ||||
| 		- [`match(..)`](#match) | ||||
| 		- [`matchPartial(..)`](#matchpartial) | ||||
| @ -867,7 +867,7 @@ C(<name>, ..) | ||||
| 
 | ||||
| ## Utilities | ||||
| 
 | ||||
| ### `normalizeIndent(..)` / `normalizeTextIndent(..)` | ||||
| ### `normalizeIndent(..)` / `normalizeTextIndent(..)` / `doc` / `text` | ||||
| 
 | ||||
| Align _code_ to shortest leading white-space | ||||
| ``` | ||||
| @ -894,6 +894,9 @@ normalizeTextIndent(..) | ||||
| This ignores `object.LEADING_TABS` and `leading_tabs` is 0 by default. | ||||
| 
 | ||||
| 
 | ||||
| `doc` and `text` are template string versions of `normalizeIndent(..)` and `normalizeTextIndent(..)` respectively. | ||||
| 
 | ||||
| 
 | ||||
| ### `deepKeys(..)` | ||||
| 
 | ||||
| ``` | ||||
|  | ||||
							
								
								
									
										16
									
								
								object.js
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								object.js
									
									
									
									
									
								
							| @ -120,6 +120,22 @@ function(text, tab_size, leading_tabs){ | ||||
| 	return module.normalizeIndent(text, tab_size, leading_tabs || 0) } | ||||
| 
 | ||||
| 
 | ||||
| // template string tag versions of the above...
 | ||||
| var doc = | ||||
| module.doc = | ||||
| function(strings, ...values){ | ||||
| 	return normalizeIndent(strings | ||||
| 		.map(function(s, i){ return s + (values[i] || '') }) | ||||
| 		.join('')) } | ||||
| 
 | ||||
| var text = | ||||
| module.text = | ||||
| function(strings, ...values){ | ||||
| 	return normalizeTextIndent(strings | ||||
| 		.map(function(s, i){ return s + (values[i] || '') }) | ||||
| 		.join('')) } | ||||
| 
 | ||||
| 
 | ||||
| // Get keys from prototype chain...
 | ||||
| //
 | ||||
| // 	deepKeys(obj)
 | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "ig-object", | ||||
|   "version": "5.0.15", | ||||
|   "version": "5.1.15", | ||||
|   "description": "", | ||||
|   "main": "object.js", | ||||
|   "scripts": { | ||||
| @ -28,6 +28,6 @@ | ||||
|   "devDependencies": { | ||||
|     "c8": "^7.2.1", | ||||
|     "colors": "^1.4.0", | ||||
|     "ig-argv": "^2.10.3" | ||||
|     "ig-argv": "^2.11.2" | ||||
|   } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user