@universal-packages/variable-replacer
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -5,1 +5,2 @@ export * from './replaceVars'; | ||
export * from './evaluateAndReplace'; | ||
export * from './evaluate'; |
@@ -21,2 +21,3 @@ "use strict"; | ||
__exportStar(require("./evaluateAndReplace"), exports); | ||
__exportStar(require("./evaluate"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@universal-packages/variable-replacer", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "Easily inject environment variables or provided variables to compose richer strings.", | ||
@@ -5,0 +5,0 @@ "author": "David De Anda <david@universal-packages.com> (https://github.com/universal-packages)", |
@@ -122,2 +122,17 @@ # Variable Replacer | ||
#### **`evaluate(input: string, [scope: Object])`** | ||
Evaluates the whole string as a JS expression and returns the actual JS result. | ||
```js | ||
import { evaluate } from '@universal-packages/variable-replacer' | ||
const string = 'a + b' | ||
const result = evaluate(string, { a: 1, b: 2 }) | ||
console.log(result) | ||
// > 3 | ||
``` | ||
## Combine replacements | ||
@@ -124,0 +139,0 @@ |
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
20516
27
137
202