@win2win/shared 1.0.140 → 1.0.141

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.
@@ -5,6 +5,8 @@ exports.deserializeAndRun = deserializeAndRun;
5
5
  exports.deserializeWithContext = deserializeWithContext;
6
6
  exports.deserializeWithContextAndRun = deserializeWithContextAndRun;
7
7
  exports.toCurrency = toCurrency;
8
+ const lodash_1 = require("lodash");
9
+ // TODO: refactorizar para usar siempre invisible context, si se pasa
8
10
  function deserialize(stringFn, options) {
9
11
  const { context = {}, run = false, useInvisibleContext = false, } = options || {};
10
12
  if (!stringFn || typeof stringFn !== "string")
@@ -54,3 +56,11 @@ function toCurrency(value, symbol = "EUR", options) {
54
56
  }).format(value);
55
57
  return formatted;
56
58
  }
59
+ function mergeData(target, source) {
60
+ return (0, lodash_1.mergeWith)(target, source, (objValue, srcValue) => {
61
+ if ((0, lodash_1.isNil)(srcValue)) {
62
+ return objValue;
63
+ }
64
+ return srcValue;
65
+ });
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@win2win/shared",
3
- "version": "1.0.140",
3
+ "version": "1.0.141",
4
4
  "description": "Tipos, interfaces, funciones, constantes, clases y enums compartidos por todos los proyectos de Win2Win",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,10 +16,13 @@
16
16
  ],
17
17
  "devDependencies": {
18
18
  "@types/iban": "^0.0.35",
19
+ "@types/lodash": "^4.17.17",
20
+ "lodash": "^4.17.21",
19
21
  "typescript": "^5.5.2"
20
22
  },
21
23
  "dependencies": {
22
24
  "better-dni": "^4.4.2",
23
- "iban": "^0.0.14"
25
+ "iban": "^0.0.14",
26
+ "lodash": "^4.17.21"
24
27
  }
25
28
  }