mirror of
https://github.com/abort-retry-ignore/joplock.git
synced 2026-05-22 19:57:34 +00:00
15 lines
359 B
JavaScript
15 lines
359 B
JavaScript
'use strict';
|
|
|
|
const normalizeEnvValue = value => {
|
|
if (typeof value !== 'string') return '';
|
|
if (value.length >= 2) {
|
|
const first = value[0];
|
|
const last = value[value.length - 1];
|
|
if ((first === "'" && last === "'") || (first === '"' && last === '"')) {
|
|
return value.slice(1, -1);
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
|
|
module.exports = { normalizeEnvValue };
|