cloudcmd/server/prefixer.js
2023-08-07 17:36:06 +03:00

16 lines
288 B
JavaScript

'use strict';
const isString = (a) => typeof a === 'string';
module.exports = (value) => {
if (!isString(value))
return '';
if (value.length === 1)
return '';
if (value && !value.includes('/'))
return `/${value}`;
return value;
};