// features - Maximum number of models that can be used as a descriptor (feature) to a specific model to be 10 models. ["intents", "entities"].forEach(scope => { luisJSON[scope].forEach(item => { if (item.features && item.features.length > retCode.boundaryLimits.MAX_NUM_DESCRIPTORS_PER_MODEL) { validationError(retCode.errorCode.BOUNDARY_FEATURE_PER_MODEL, `${scope.substring(0, scope.length - 1)} ${item.name} has ${item.features.length} descriptors (feature). At most ${retCode.boundaryLimits.MAX_NUM_DESCRIPTORS_PER_MODEL} is allowed.`) } }) })
/** * @param {string} prefix vendor-specific prefix, eg: Webkit * @param {string} key style name, eg: transitionDuration * @return {string} style name prefixed with `prefix`, properly camelCased, eg: * WebkitTransitionDuration */ function prefixKey(prefix, key) { return prefix + key.charAt(0).toUpperCase() + key.substring(1); }
function getFilterText() { var settings = util.parseJSON(storage.get('filterText')); return settings ? { disabledFilterText: settings.disabledFilterText, filterText: util.toString(settings.filterText).substring(0, MAX_INCLUDE_LEN), disabledExcludeText: settings.disabledExcludeText, excludeText: util.toString(settings.excludeText).substring(0, MAX_EXCLUDE_LEN) } : { filterText: '', excludeText: '' }; }
function generateDate (dateArray) { if (!dateArray) { return null; } const millisecondsLastDigits = String(dateArray[1] || '000'); const millisecondsTotal = `${dateArray[0]}${millisecondsLastDigits.substring(0, 3)}`; const date = new Date(Number(millisecondsTotal)); return date.toJSON(); }
function hashCode(str) { var hash = 0, i, chr; if(str.length === 0){ return hash; } for(i = 0; i < str.length; i++){ chr = str.charCodeAt(i); hash = (hash << 5) - hash + chr; } hash = Math.abs(hash) >> 0; return hash.toString(16).substring(0, 5); }
/** * Convert Context ID to Zipkin format * * @param {String} id * @returns {String} */ convertID(id) { return id ? id.replace(/-/g, "").substring(0, 16) : null; }
["prebuiltEntities", "patternAnyEntities", "regex_entities", "closedLists", "composites", "entities"].forEach(scope => { luisJSON[scope].forEach(item => { if (item.roles.length > retCode.boundaryLimits.MAX_ROLES_PER_ENTITY) { validationError(retCode.errorCode.BOUNDARY_ROLES_PER_ENTITY, `${scope.substring(0, scope.length - 1)} ${item.name} has ${item.roles.length} roles. At most ${retCode.boundaryLimits.MAX_ROLES_PER_ENTITY} is allowed.`) } totalRoles += item.roles.length; }) })
useEffect(() => { if (result) { const temp = result.series().map((data) => { return { name: data.key.substring(0, 4), data: data.series.map((item) => item.value), }; }); setData(temp); } }, [result]);
function guidFor(str) { const hash = fnv1a(str).toString(); let slug = slugify(sanitize(str)); // Max the slug at 100 char slug = slug.substring(0, 100 - hash.length - 1); return `${slug}_${hash}`; }
/** * Convert Trace/Span ID to Jaeger format * * @param {String} id * @returns {String} */ convertID(id) { if (id) return Buffer.from(id.replace(/-/g, "").substring(0, 16), "hex"); return null; }
result.map(function(name) { if (name.indexOf('req.') === 0) { name = reqHeaders[name.substring(4)]; name && reqResult.push(name); return; } return headers[name]; }).filter(noop)
/** * @param {string} prefix vendor-specific prefix, eg: Webkit * @param {string} key style name, eg: transitionDuration * @return {string} style name prefixed with `prefix`, properly camelCased, eg: * WebkitTransitionDuration */ function prefixKey(prefix, key) { return prefix + key.charAt(0).toUpperCase() + key.substring(1); }
/** * Convert Context ID to Zipkin format * * @param {String} id * @returns {String} */ convertID(id) { return id ? id.replace(/-/g, "").substring(0, 16) : null; }
function guidFor(str) { const hash = fnv1a(str).toString(); let slug = slugify(sanitize(str)); // Max the slug at 100 char slug = slug.substring(0, 100 - hash.length - 1); return `${slug}_${hash}`; }