@runnerty/interpreter-core
Advanced tools
@@ -19,2 +19,4 @@ 'use strict'; | ||
| gvunescape: getvalueunescape, | ||
| genv: getenv, | ||
| env: getenv, | ||
| if: _if, | ||
@@ -93,3 +95,3 @@ eq: eq, | ||
| * Get Environment variable. | ||
| * Used by GetValue | ||
| * Used by GetValue / GetEnv | ||
| * @param s string | ||
@@ -118,13 +120,3 @@ * @returns string | ||
| const match = values[idvalue]; | ||
| if (match) { | ||
| res = match; | ||
| } | ||
| if (quote) { | ||
| if (quote === "\\'") { | ||
| quote = "'"; | ||
| } | ||
| res = quote + res + quote; | ||
| } | ||
| if (match) res = match; | ||
| } else { | ||
@@ -135,2 +127,7 @@ if (idvalue.startsWith('ENV_')) { | ||
| } | ||
| if (quote) { | ||
| if (quote === "\\'") quote = "'"; | ||
| res = quote + res + quote; | ||
| } | ||
| return res; | ||
@@ -152,2 +149,18 @@ } | ||
| /** | ||
| * GetEnv/GENV: Returns a environment value | ||
| * Used to obtain values of the environment | ||
| * @param envName | ||
| * @param values | ||
| * @returns {string} | ||
| */ | ||
| function getenv(envName, quote) { | ||
| let res = process.env[envName] || ''; | ||
| if (quote) { | ||
| if (quote === "\\'") quote = "'"; | ||
| res = quote + res + quote; | ||
| } | ||
| return res; | ||
| } | ||
| /** | ||
| * Escape | ||
@@ -154,0 +167,0 @@ * @param string |
+1
-1
| { | ||
| "name": "@runnerty/interpreter-core", | ||
| "version": "3.0.3", | ||
| "version": "3.1.0", | ||
| "description": "Runnerty interpreter module", | ||
@@ -5,0 +5,0 @@ "author": "Runnerty Tech", |
33837
0.98%1228
1.07%3
50%