@evlop/commons 1.0.115 → 1.0.116

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"useScope.d.ts","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,mBAAoB,MAAM,iBAAiB,GAAG,QAOlE,CAAC;AAEF,OAAO,EAAC,QAAQ,IAAI,OAAO,EAAC,CAAC"}
1
+ {"version":3,"file":"useScope.d.ts","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,mBAAoB,MAAM,iBAAiB,GAAG,QAMlE,CAAC;AAEF,OAAO,EAAC,QAAQ,IAAI,OAAO,EAAC,CAAC"}
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useData = exports.useScope = void 0;
4
+ const lodash_1 = require("lodash");
4
5
  const react_1 = require("react");
5
6
  const contexts_1 = require("../contexts");
6
7
  const useScope = (scopeVariable, defaultValue) => {
7
8
  const scope = react_1.useContext(contexts_1.DataContext);
8
9
  if (scopeVariable) {
9
- const { [scopeVariable]: value = defaultValue } = scope;
10
- return value;
10
+ return lodash_1.get(scope, scopeVariable, defaultValue);
11
11
  }
12
12
  return scope;
13
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useScope.js","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,0CAA0C;AAEnC,MAAM,QAAQ,GAAG,CAAC,aAAsB,EAAE,YAAkB,EAAC,EAAE;IAClE,MAAM,KAAK,GAAS,kBAAU,CAAC,sBAAW,CAAC,CAAC;IAC5C,IAAG,aAAa,EAAC;QACb,MAAM,EAAC,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,YAAY,EAAC,GAAG,KAAK,CAAC;QACtD,OAAO,KAAK,CAAC;KAChB;IACD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAPW,QAAA,QAAQ,YAOnB;AAEkB,kBATP,gBAAQ,CASM"}
1
+ {"version":3,"file":"useScope.js","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":";;;AAAA,mCAA6B;AAC7B,iCAAmC;AACnC,0CAA0C;AAEnC,MAAM,QAAQ,GAAG,CAAC,aAAsB,EAAE,YAAkB,EAAC,EAAE;IAClE,MAAM,KAAK,GAAS,kBAAU,CAAC,sBAAW,CAAC,CAAC;IAC5C,IAAG,aAAa,EAAC;QACb,OAAO,YAAG,CAAC,KAAK,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;KAClD;IACD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB;AAEkB,kBARP,gBAAQ,CAQM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.115",
3
+ "version": "1.0.116",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {