cozy-client 38.5.0 → 38.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2677,7 +2677,7 @@ var CozyClient = /*#__PURE__*/function () {
2677
2677
  CozyClient.hooks = CozyClient.hooks || {};
2678
2678
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2679
2679
 
2680
- CozyClient.version = "38.5.0";
2680
+ CozyClient.version = "38.5.1";
2681
2681
 
2682
2682
  _microee.default.mixin(CozyClient);
2683
2683
 
@@ -7,10 +7,16 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.getBoundT = void 0;
9
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
10
12
  var _nodePolyglot = _interopRequireDefault(require("node-polyglot"));
11
13
 
12
14
  var _emojiCountry = require("../emojiCountry");
13
15
 
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19
+
14
20
  var polyglots = {};
15
21
  var langs = ['fr', 'en'];
16
22
 
@@ -38,9 +44,11 @@ var getBoundT = function getBoundT(lang) {
38
44
  var t = polyglot.t.bind(polyglot);
39
45
  return function (label) {
40
46
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
41
- var newOpts = {
47
+
48
+ var newOpts = _objectSpread(_objectSpread({}, opts), {}, {
42
49
  smart_count: (opts === null || opts === void 0 ? void 0 : opts.smart_count) || 1
43
- };
50
+ });
51
+
44
52
  var emojiCountry = (0, _emojiCountry.getEmojiByCountry)(opts === null || opts === void 0 ? void 0 : opts.country, t);
45
53
  return emojiCountry ? "".concat(t(label, newOpts), " ").concat(emojiCountry) : t(label, newOpts);
46
54
  };
@@ -13,6 +13,11 @@ describe('getBoundT', () => {
13
13
 
14
14
  expect(res).toBe('IBAN')
15
15
  })
16
+ it('should return "default value" option', () => {
17
+ const res = t('Scan.items.unknown_key', { _: 'default value' })
18
+
19
+ expect(res).toBe('default value')
20
+ })
16
21
 
17
22
  it.each`
18
23
  translationKey | country | smart_count | lang | expected
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "38.5.0",
3
+ "version": "38.5.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -73,5 +73,5 @@
73
73
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "c14ae8fe2ea2a6f5d8936696ba9521e545722d01"
76
+ "gitHead": "4c1672ea17f48297d1a671658caf707a8356f6b0"
77
77
  }