@cross-nft-marketplace/auction-house-nft-components
Version:
NFT Media Rendering Components
22 lines (21 loc) • 675 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.camelCase = exports.capitalize = void 0;
const capitalize = (word) => word
.split('')
.map((letter, index) => index ? letter.toLowerCase() : letter.toUpperCase())
.join('');
exports.capitalize = capitalize;
const camelCase = (text) => {
if (text !== 'unknown') {
const regex = /[^a-z0-9]|\s+|\r?\n|\r/gmi;
return text
.split(regex)
.map((word, index) => index ? (0, exports.capitalize)(word) : word.toLowerCase())
.join('');
}
else {
return '';
}
};
exports.camelCase = camelCase;