@ezs/analytics
Advanced tools
Comparing version
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.13.0](https://github.com/Inist-CNRS/ezs/compare/@ezs/analytics@1.12.1...@ezs/analytics@1.13.0) (2021-04-07) | ||
### Features | ||
* 🎸 add option default ([dd2dee4](https://github.com/Inist-CNRS/ezs/commit/dd2dee41ca9c127bb71a7ae6341708b253155c01)) | ||
## [1.12.1](https://github.com/Inist-CNRS/ezs/compare/@ezs/analytics@1.12.0...@ezs/analytics@1.12.1) (2021-04-02) | ||
@@ -8,0 +19,0 @@ |
@@ -77,2 +77,3 @@ "use strict"; | ||
* @param {String} [path] the path to substitute | ||
* @param {String} [default] value if no substitution (otherwise value stay unchanged) | ||
* @param {String} [primer=auto] Data to send to the external pipeline | ||
@@ -144,2 +145,3 @@ * @param {String} [file] the external pipeline is described in a file | ||
return whenReady.then(async () => { | ||
const defval = this.getParam('default', null); | ||
const path = this.getParam('path'); | ||
@@ -162,2 +164,8 @@ const pathVal = (0, _lodash.default)(data, path); | ||
(0, _lodash2.default)(data, path, val); | ||
} else if (defval !== null) { | ||
const orig = (0, _lodash.default)(data, path); | ||
(0, _lodash2.default)(data, path, { | ||
id: orig, | ||
value: defval | ||
}); | ||
} else { | ||
@@ -164,0 +172,0 @@ const orig = (0, _lodash.default)(data, path); |
{ | ||
"name": "@ezs/analytics", | ||
"version": "1.12.1", | ||
"version": "1.13.0", | ||
"description": "Analytics statements for EZS", | ||
@@ -48,3 +48,3 @@ "directories": { | ||
}, | ||
"gitHead": "85d1cf1f1be7db5bfed0321140cb623720ee3925", | ||
"gitHead": "d2e1ef1744e5efbf40e971f2f8bd9e4e6709331c", | ||
"devDependencies": { | ||
@@ -51,0 +51,0 @@ "@ezs/core": "1.2.2" |
@@ -1467,2 +1467,3 @@ # analytics | ||
- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** the path to substitute | ||
- `default` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** value if no substitution (otherwise value stay unchanged) | ||
- `primer` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Data to send to the external pipeline (optional, default `auto`) | ||
@@ -1469,0 +1470,0 @@ - `file` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** the external pipeline is described in a file |
145343
0.52%3387
0.24%1791
0.06%