@withonevision/omnihive-core
Advanced tools
Comparing version 6.2.45 to 6.2.46
@@ -13,4 +13,5 @@ /// <reference types="src/types/globals.omnihive" /> | ||
checkMetadata: (metadata: any) => void; | ||
getEnvironmentVariable: <T extends string | number | boolean>(name: string) => T | undefined; | ||
getWorker<T extends IHiveWorker | undefined>(type: string, name?: string): T | undefined; | ||
} | ||
//# sourceMappingURL=HiveWorkerBase.d.ts.map |
@@ -42,3 +42,4 @@ "use strict"; | ||
case EnvironmentVariableType_1.EnvironmentVariableType.Boolean: | ||
this.metadata[metaKey] = environmentVariable.value === "true" || environmentVariable.value === true; | ||
this.metadata[metaKey] = | ||
environmentVariable.value === "true" || environmentVariable.value === true; | ||
break; | ||
@@ -55,2 +56,14 @@ case EnvironmentVariableType_1.EnvironmentVariableType.Number: | ||
}; | ||
this.getEnvironmentVariable = (name) => { | ||
const envVariable = this.environmentVariables.find((variable) => variable.key === name); | ||
if (IsHelper_1.IsHelper.isNullOrUndefined(envVariable)) { | ||
return undefined; | ||
} | ||
try { | ||
return envVariable.value; | ||
} | ||
catch (_a) { | ||
return undefined; | ||
} | ||
}; | ||
} | ||
@@ -57,0 +70,0 @@ init(name, metadata) { |
{ | ||
"name": "@withonevision/omnihive-core", | ||
"version": "6.2.45", | ||
"version": "6.2.46", | ||
"description": "OmniHive Core", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
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
105856
1310