From 18952a62257db51de4e485f4924268f3813d672f Mon Sep 17 00:00:00 2001 From: VijayKesharwani <122533719+VijayKesharwani@users.noreply.github.com> Date: Tue, 7 Nov 2023 17:21:28 +0530 Subject: [PATCH] Update camara-language-spelling.js --- lint_function/camara-language-spelling.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lint_function/camara-language-spelling.js b/lint_function/camara-language-spelling.js index bb0426fb53..c98984b546 100644 --- a/lint_function/camara-language-spelling.js +++ b/lint_function/camara-language-spelling.js @@ -5,12 +5,14 @@ import('dictionary-en').then((dictionaryModule) => { var exceptions = ['eventId', 'eventType', 'eventTime', 'eventSubscriptionId', 'publicAddress', 'subnet', 'privateAddress', 'publicPort', 'sessionId', 'UUID', 'devicePorts', 'QoS', 'qosProfile', 'TCP', 'UDP', 'QOS_S', 'QOS_M', 'QOS_L', 'QOS_E', 'webhook', 'notificationUrl', 'notificationAuthToken', 'startedAt', 'expiresAt', 'qosprofiles', 'minDuration', 'maxDuration', 'packetDelayBudget', 'oneway', 'endtoend', 'jitter', 'roundtrip', 'ITU', 'eg', 'realtime', 'packetErrorLossRate', 'QCI', 'maxDownstreamRate', 'QOS_STATUS_CHANGED', 'qosStatus', 'statusInfo', 'DURATION_EXPIRED', 'Enduser', 'IoT', 'sensorsactuators', 'phoneNumber', 'networkAccessIdentifier', 'MNO', 'invoker', 'MNOs', 'MSISDN', 'GPSI', 'IdentifierDomain', 'DNS', 'ie', 'applicationServerPorts', 'maxDownstreamBurstRate', 'maxUpstreamRate', 'QoD', 'cmunication', 'QualityOnDemand', 'Telco', 'indepth', 'Telecom', 'VRGaming', 'backend', 'OverviewhttpsrawgithubusercontentcomcamaraprojectQualityOnDemandmaindocumentationAPI_documentationresourcesQoD_latency_overviewPNG', 'QOD', 'OAuth', 'andor', 'AppFlow', 'portranges', 'AppFlows', 'portportranges', 'Appflow', 'br', 'APIhttpsrawgithubusercontentcomcamaraprojectQualityOnDemandmaindocumentationAPI_documentationresourcesQoD_detailsPNG', 'CAMARA', 'DRAFThttpsgithubcomcamaraprojectQualityOnDemandblobmaindocumentationAPI_documentationQoSProfile_Mapping_Tablemd', 'IETF', 'addressmask', 'applicationServer', 'dottedquad', 'sessionssessionId', 'createSession', 'targetMinUpstreamRate', 'SessionId', 'SessionInfo', 'EventNotification', 'PhoneNumber', 'QosStatus', 'EventQosStatus', 'ErrorInfo', 'GBR', 'latencysensitive', 'DOCSIS', 'maxUpstreamBurstRate', 'targetMinDownstreamRate', 'qosprofilesname', 'RateUnitEnum', 'CreateSession', 'PortsSpec', 'QosProfile', 'QosProfileName', 'TimeUnitEnum', 'QosProfileStatusEnum', 'EventId', 'EventType', 'EventTime', 'QosStatusChangedEvent', 'eventDetail', 'NETWORK_TERMINATED', 'StatusInfo', 'ApplicationServer', 'NetworkAccessIdentifier']; var separatorsRegex = /\s/; var mistakes = []; + var exceptions = []; // Define your exceptions array here function includesNumber(value) { return /\d/.test(value); } export default async function (input) { + // Move your asynchronous logic here dictionary((err, dict) => { if (err) { throw err; @@ -21,12 +23,12 @@ import('dictionary-en').then((dictionaryModule) => { var errors = words .filter((word) => !exceptions.includes(word)) .filter((word) => !spell.correct(word)) - .filter((word) => !word == '') - .filter((word) => !includesNumber(word)); + .filter((word) => word !== '') + .filter((word) => !includesNumber(word); if ( errors.length > 0 && - mistakes[mistakes.length - 1] != errors[errors.length - 1] + mistakes[mistakes.length - 1] !== errors[errors.length - 1] ) { mistakes.push(errors); errors = [];