baset-core
Advanced tools
Comparing version 0.14.6 to 0.14.7
@@ -6,2 +6,14 @@ # Change Log | ||
<a name="0.14.7"></a> | ||
## [0.14.7](https://github.com/Igmat/baset/compare/v0.14.6...v0.14.7) (2018-10-10) | ||
### Bug Fixes | ||
* **core:** execute functions if they are exported directly ([4d64a8d](https://github.com/Igmat/baset/commit/4d64a8d)) | ||
<a name="0.14.6"></a> | ||
@@ -8,0 +20,0 @@ ## [0.14.6](https://github.com/Igmat/baset/compare/v0.14.5...v0.14.6) (2018-10-09) |
@@ -78,4 +78,16 @@ "use strict"; | ||
return this.calculateValues(yield obj, context, sandbox, name); | ||
if (typeof obj === 'function') | ||
return obj.toString().split('\n')[0]; | ||
if (typeof obj === 'function') { | ||
return name.split('.').length === 2 // this means that function directly exported | ||
? (() => { | ||
try { | ||
return obj(); | ||
} | ||
catch (err) { | ||
return { | ||
[dataTypes_1.error]: err, | ||
}; | ||
} | ||
})() | ||
: obj.toString().split('\n')[0]; | ||
} | ||
if (Array.isArray(obj)) { | ||
@@ -82,0 +94,0 @@ return yield Promise.all(obj.map((value, key) => this.calculateValues(value, context, sandbox, `${name}[${key}]`))); |
{ | ||
"name": "baset-core", | ||
"version": "0.14.6", | ||
"version": "0.14.7", | ||
"description": "Core library for BaseT project.", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "21a51f5885fd9ccfb91ae2909f230d21c645cefe" | ||
"gitHead": "b572e1a67f49f5dac5f4610fe84d274cf1f8cf2c" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67153
798