mirror of
https://github.com/flynx/object.js.git
synced 2025-12-19 09:51:41 +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)
|
- [`RawInstance(..)`](#rawinstance)
|
||||||
- [`Constructor(..)` / `C(..)`](#constructor--c)
|
- [`Constructor(..)` / `C(..)`](#constructor--c)
|
||||||
- [Utilities](#utilities)
|
- [Utilities](#utilities)
|
||||||
- [`normalizeIndent(..)` / `normalizeTextIndent(..)`](#normalizeindent--normalizetextindent)
|
- [`normalizeIndent(..)` / `normalizeTextIndent(..)` / `doc` / `text`](#normalizeindent--normalizetextindent--doc--text)
|
||||||
- [`deepKeys(..)`](#deepkeys)
|
- [`deepKeys(..)`](#deepkeys)
|
||||||
- [`match(..)`](#match)
|
- [`match(..)`](#match)
|
||||||
- [`matchPartial(..)`](#matchpartial)
|
- [`matchPartial(..)`](#matchpartial)
|
||||||
@ -867,7 +867,7 @@ C(<name>, ..)
|
|||||||
|
|
||||||
## Utilities
|
## Utilities
|
||||||
|
|
||||||
### `normalizeIndent(..)` / `normalizeTextIndent(..)`
|
### `normalizeIndent(..)` / `normalizeTextIndent(..)` / `doc` / `text`
|
||||||
|
|
||||||
Align _code_ to shortest leading white-space
|
Align _code_ to shortest leading white-space
|
||||||
```
|
```
|
||||||
@ -894,6 +894,9 @@ normalizeTextIndent(..)
|
|||||||
This ignores `object.LEADING_TABS` and `leading_tabs` is 0 by default.
|
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(..)`
|
### `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) }
|
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...
|
// Get keys from prototype chain...
|
||||||
//
|
//
|
||||||
// deepKeys(obj)
|
// deepKeys(obj)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ig-object",
|
"name": "ig-object",
|
||||||
"version": "5.0.15",
|
"version": "5.1.15",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "object.js",
|
"main": "object.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -28,6 +28,6 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"c8": "^7.2.1",
|
"c8": "^7.2.1",
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"ig-argv": "^2.10.3"
|
"ig-argv": "^2.11.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user