CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
envKeyToSetting.js20 linesDownload Raw Back to lib
1module.exports = function (x) {2	const colonIndex = x.indexOf(':');3	if (colonIndex === -1) {4		return normalize(x);5	}6	const firstPart = x.substr(0, colonIndex);7	const secondPart = x.substr(colonIndex + 1);8	return `${normalize(firstPart)}:${normalize(secondPart)}`;9}10 11function normalize (s) {12	s = s.toLowerCase();13	if (s === '_authtoken') return '_authToken';14	let r = s[0];15	for (let i = 1; i < s.length; i++) {16		r += s[i] === '_' ? '-' : s[i];17	}18	return r;19}20 
basant307/AI_Governance_Project · CoolFace