Add alternative local vectors source.

x5 speed boost!!
This commit is contained in:
Cohee
2023-09-14 23:40:13 +03:00
parent 0cc048cb64
commit 6ad786f348
6 changed files with 42 additions and 11 deletions

View File

@ -1,6 +1,7 @@
const path = require('path');
const child_process = require('child_process');
const commandExistsSync = require('command-exists').sync;
const _ = require('lodash');
/**
* Returns the config object from the config.conf file.
@ -16,6 +17,17 @@ function getConfig() {
}
}
/**
* Returns the value for the given key from the config object.
* @param {string} key - Key to get from the config object
* @param {any} defaultValue - Default value to return if the key is not found
* @returns {any} Value for the given key
*/
function getConfigValue(key, defaultValue = null) {
const config = getConfig();
return _.get(config, key, defaultValue);
}
/**
* Encodes the Basic Auth header value for the given user and password.
* @param {string} auth username:password
@ -67,6 +79,7 @@ function delay(ms) {
module.exports = {
getConfig,
getConfigValue,
getVersion,
getBasicAuthHeader,
delay,