From 3e8cc3fb9f3ab6eed7d4068e9f36ed3f9a03be90 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Mon, 7 Feb 2022 10:32:43 -0800 Subject: [PATCH] Update dependencies Still preserving compatibility with node 10 Change-Id: I0e1d0e0e919a7b071174d7f16a1fae20aa6b9086 --- .eslintrc.yml | 6 +- lib/base_feed.js | 1 + lib/mwUtil.js | 43 ++++-- lib/security_response_header_filter.js | 4 +- .../generate-wikimedia-domain-config.js | 18 +-- maintenance/generate_random_load.js | 4 - package.json | 146 +++++++++--------- server.js | 2 +- sys/action.js | 1 + sys/page_revisions.js | 2 + sys/parsoid.js | 10 +- v1/common_schemas.yaml | 4 - v1/lists.js | 10 +- v1/summary.js | 2 +- 14 files changed, 141 insertions(+), 112 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index 9eb2d652d..ae112bcf8 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,11 +1,9 @@ extends: - 'wikimedia/server' -plugins: - - json - - jsdoc - rules: + no-shadow: + - off array-bracket-spacing: - off camelcase: diff --git a/lib/base_feed.js b/lib/base_feed.js index 112dc1599..cdc99115e 100644 --- a/lib/base_feed.js +++ b/lib/base_feed.js @@ -17,6 +17,7 @@ class BaseFeed { /** * Extract a very header from any of the result parts. + * * @param {!Object} result * @return {string|null} * @private diff --git a/lib/mwUtil.js b/lib/mwUtil.js index 1720c92c8..24073f271 100644 --- a/lib/mwUtil.js +++ b/lib/mwUtil.js @@ -16,7 +16,8 @@ const mwUtil = {}; /** * Create an etag value of the form * "//" - * @param {Integer} rev page revision number + * + * @param {number} rev page revision number * @param {string} tid page render UUID * @param {string} [suffix] optional suffix * @return {string} the value of the ETag header @@ -31,6 +32,7 @@ mwUtil.makeETag = (rev, tid, suffix) => { /** * Normalizes the request.params.title and returns it back + * * @param {HyperSwitch} hyper hyperswitch * @param {Object} req request object * @param {string} title @@ -54,6 +56,7 @@ mwUtil.normalizeTitle = (hyper, req, title) => mwUtil.getSiteInfo(hyper, req) /** * Parse an etag value of the form * "//" + * * @param {string} etag tag to parse * @return {Object} an object with rev, tid and optional suffix properties */ @@ -85,6 +88,7 @@ mwUtil.parseETag = (etag) => { /** * Checks whether a language variant could exist for * a page in a requested language on a particular wiki. + * * @param {HyperSwitch} hyper * @param {Object} req * @param {string} pageLanguage the language of the requested page. @@ -98,6 +102,7 @@ mwUtil.canConvertLangVariant = (hyper, req, pageLanguage) => { /** * Checks whether a specialized requested language variant exist for * a page in a requested language on a particular wiki. + * * @param {HyperSwitch} hyper * @param {Object} req * @param {string} pageLang the language of the requested page. @@ -124,6 +129,7 @@ mwUtil.shouldConvertLangVariant = (hyper, req, pageLang, acceptLang) => { /** * Extract the date from an `etag` header of the form * "//" + * * @param {string} etag * @return {Date|null} */ @@ -155,6 +161,7 @@ mwUtil.coerceTid = (tidString, bucket) => { /** * Normalizes the order of 'Content-Type' header fields. + * * @param {Object} res server response */ mwUtil.normalizeContentType = (res) => { @@ -170,6 +177,7 @@ mwUtil.normalizeContentType = (res) => { /** * Checks whether the request is a 'no-cache' request + * * @param {Object} req * @return {boolean} */ @@ -177,6 +185,7 @@ mwUtil.isNoCacheRequest = (req) => req.headers && /no-cache/i.test(req.headers[' /** * Checks whether the request is a 'no-store' request + * * @param {Object} req * @return {boolean} */ @@ -212,6 +221,7 @@ mwUtil.getLimit = (hyper, req) => { * if access is restricted, no-op otherwise. * * Item might be either a revision or a restriction. + * * @param {Object} revision the revision object */ mwUtil.applyAccessChecks = (revision) => { @@ -246,6 +256,7 @@ mwUtil.applyAccessChecks = (revision) => { /** * Create a json web token. + * * @param {HyperSwitch} hyper HyperSwitch context* * @param {Object} object a JSON object to encode * @return {string} @@ -260,6 +271,7 @@ mwUtil.encodePagingToken = (hyper, object) => { /** * Decode signed token and decode the orignal token + * * @param {HyperSwitch} hyper HyperSwitch context * @param {string} token paging request token * @return {Object} @@ -304,6 +316,7 @@ mwUtil.getQueryString = (req) => { /** * Extracts the domain name from the provided URL. + * * @param {string} url * @return {string} */ @@ -325,6 +338,7 @@ mwUtil.addQueryString = (location, query) => { /** * Create a `location` header value for a relative redirect. + * * @param {string} path the path pattern from specInfo. * @param {hyper.request} req the request * @param {Object} options with possible parameters: @@ -360,10 +374,8 @@ mwUtil.createRelativeTitleRedirect = (path, req, options) => { mwUtil.getQueryString(req); } else if (/#/.test(newReqParams.title)) { const titleFragments = encodeURIComponent(newReqParams.title).split(/%23/); - /* eslint-disable prefer-template */ location = backString + titleFragments.shift() + mwUtil.getQueryString(req) + '#' + titleFragments.join('%23'); - /* eslint-enable prefer-template */ } else { location = backString + encodeURIComponent(newReqParams.title) + mwUtil.getQueryString(req); } @@ -376,10 +388,11 @@ mwUtil.createRelativeTitleRedirect = (path, req, options) => { }; /** - * Checks if the request is a CORS request - * @param {Object} req The request to check - * @return {boolean} Whether the request is CORS or not - */ + * Checks if the request is a CORS request + * + * @param {Object} req The request to check + * @return {boolean} Whether the request is CORS or not + */ mwUtil.isCrossOrigin = (req) => { return req && req.headers && req.headers.origin && req.headers.origin !== req.params.domain; }; @@ -425,6 +438,7 @@ mwUtil.isSelfRedirect = (req, location) => { /** * Fetches the summary content from the provided URI + * * @param {HyperSwitch} hyper HyperSwitch context * @param {URI} uri summary URI * @param {headers} headers req header @@ -448,6 +462,7 @@ mwUtil.fetchSummary = (hyper, uri, headers) => { /** * Traverses through a request body and replaces the given keys with * the content fetched using the 'fetch' callback + * * @param {Object} response the response object to hydrate * @param {Function} fetch the function used to fetch the content if it's not present * @return {Promise} response @@ -494,6 +509,7 @@ mwUtil.hydrateResponse = (response, fetch) => { /** * Checks whether the date is today or in the past in UTC-0 timezone + * * @param {Date} date a date to check * @return {boolean} true if the date is in the past */ @@ -505,6 +521,7 @@ mwUtil.isHistoric = (date) => { /** * Verifies that the date parameter is in proper format. + * * @param {Object} req the request to check */ mwUtil.verifyDateParams = (req) => { @@ -543,6 +560,7 @@ mwUtil.verifyDateParams = (req) => { /** * Safely builds the Date from request parameters + * * @param {Object} rp request parameters object * @return {Date} the requested date. */ @@ -563,6 +581,7 @@ mwUtil.getDateSafe = (rp) => { /** * From a list of regexes and strings, constructs a regex that * matches any of list items + * * @param {Array.string} list array of strings and regexes * @return {Object|undefined} either a RegExp object or undefined */ @@ -582,6 +601,7 @@ mwUtil.constructRegex = (list) => { /** * Remove entries with duplicate 'title' values from an array of objects + * * @param {?Array} arr Array of page/article objects * @param {?Function} upd Optional function to update the original item based on the duplicate. * Takes two parameters (orig, dupe): orig - the original object, @@ -593,9 +613,8 @@ mwUtil.removeDuplicateTitles = (arr, upd) => { return arr.filter((item, idx, init) => { if (titles[item.title]) { if (upd) { - // eslint-disable-next-line no-unused-vars - let orig = init[init.findIndex((el) => el.title === item.title)]; - orig = upd(orig, item); + const orig = init[init.findIndex((el) => el.title === item.title)]; + upd(orig, item); } return false; } @@ -606,6 +625,7 @@ mwUtil.removeDuplicateTitles = (arr, upd) => { /** * Checks if the provided path is an HTML route. + * * @param {string} path the path to check. * @return {boolean} */ @@ -613,6 +633,7 @@ mwUtil.isHTMLRoute = (path) => /\/page\/html\//.test(path); /** * Extracts the version number from the content-type or accept profile. + * * @param {string} header the content-type or accept header. * @return {string|undefined} */ @@ -656,7 +677,7 @@ mwUtil.addVaryHeader = (res, vary) => { mwUtil.deepCloneObj = (obj) => { const clonedObj = Array.isArray(obj) ? [] : {}; - Object.keys(obj).forEach((key) =>{ + Object.keys(obj).forEach((key) => { const node = obj[key]; clonedObj[key] = (typeof node === 'object' && node !== null) ? mwUtil.deepCloneObj(node) : node; }); diff --git a/lib/security_response_header_filter.js b/lib/security_response_header_filter.js index cc8eea087..6da2d91f2 100644 --- a/lib/security_response_header_filter.js +++ b/lib/security_response_header_filter.js @@ -30,6 +30,7 @@ const cspHeaderVariants = [ /** * Replaces subdomain with a wildcard + * * @param {string} domain a full domain name (e.g. en.wikipedia.org) * @return {string} wildcard version (e.g. *.wikipedia.org) */ @@ -43,7 +44,8 @@ function wildcardSubdomain(domain) { /** * Adds Content-Security-Policy & related headers to send in response - * @param {HyperSwitch} hyper the HyperSwitch object + * + * @param {Object} hyper the HyperSwitch object * @param {Object} req the request to handle * @param {P} next the promise to execute * @param {Object} options options containing the following fields: diff --git a/maintenance/generate-wikimedia-domain-config.js b/maintenance/generate-wikimedia-domain-config.js index 88b8b1e18..2c44407a5 100644 --- a/maintenance/generate-wikimedia-domain-config.js +++ b/maintenance/generate-wikimedia-domain-config.js @@ -6,15 +6,15 @@ 'use strict'; -var preq = require('preq'); -var downloadUrl = 'https://en.wikipedia.org/w/api.php?action=sitematrix&format=json'; +const preq = require('preq'); +const downloadUrl = 'https://en.wikipedia.org/w/api.php?action=sitematrix&format=json'; preq.get({ uri: downloadUrl }) .then((res) => { - var sm = res.body.sitematrix; - var projects = { + const sm = res.body.sitematrix; + const projects = { wikipedia: [], wiktionary: [], wikiquote: [], @@ -28,13 +28,13 @@ preq.get({ }; Object.keys(sm).forEach((k) => { - var lang = sm[k]; + const lang = sm[k]; if (lang.site || k === 'specials') { - var sites = lang.site || lang; + const sites = lang.site || lang; sites.forEach((site) => { if (site.closed === undefined && site.private === undefined) { - var domain = site.url.replace(/^https?:\/\//, ''); - var name = domain.replace(/[^.]+\.(\w+)\.org$/, '$1'); + const domain = site.url.replace(/^https?:\/\//, ''); + const name = domain.replace(/[^.]+\.(\w+)\.org$/, '$1'); if (projects[name]) { projects[name].push(domain); } else { @@ -46,10 +46,8 @@ preq.get({ }); Object.keys(projects).forEach((name) => { - // eslint-disable-next-line no-console console.log(`\n # ${name}`); projects[name].forEach((domain) => { - // eslint-disable-next-line no-console console.log(` /{domain:${domain}}: *wp/default/1.0.0`); }); }); diff --git a/maintenance/generate_random_load.js b/maintenance/generate_random_load.js index 57b68599a..7f07af363 100644 --- a/maintenance/generate_random_load.js +++ b/maintenance/generate_random_load.js @@ -18,19 +18,16 @@ function makeCheck() { return preq.get(`${testRestBASEUri}/page/html/${encodeURIComponent(title)}/${revision}`) .then((res) => { const tid = res.headers.etag.match(/\/(.+)"$/)[1]; - // eslint-disable-next-line no-console console.log(`Testing for ${title}/${revision}/${tid}`); P.delay(Math.floor(Math.random() * 86400000)) .then(() => { return P.all([ preq.get(`${testRestBASEUri}/page/html/${encodeURIComponent(title)}/${revision}/${tid}`) .catch((err) => { - // eslint-disable-next-line no-console console.log(`${new Date()} Failed to fetch HTML ${title}/${revision}/${tid} from test RB: ${err}`); }), preq.get(`${testRestBASEUri}/page/html/${encodeURIComponent(title)}/${revision}/${tid}`) .catch((err) => { - // eslint-disable-next-line no-console console.log(`${new Date()} Failed to fetch Data-Parsoid ${title}/${revision}/${tid} from test RB: ${err}`); }) ]); @@ -38,7 +35,6 @@ function makeCheck() { return P.delay(500).then(makeCheck); }, (e) => { - // eslint-disable-next-line no-console console.log(`${new Date()} Failed to fetch HTML ${title}/${revision} from test RB: ${e}`); }); }); diff --git a/package.json b/package.json index b796286fa..3b1f98276 100644 --- a/package.json +++ b/package.json @@ -1,78 +1,76 @@ { - "name": "restbase", - "version": "1.1.4", - "description": "REST storage and service dispatcher", - "main": "index.js", - "scripts": { - "postpublish": "git tag -a \"v${npm_package_version}\" -m \"${npm_package_name}@${npm_package_version} release\" && git push upstream \"v${npm_package_version}\"", - "start": "service-runner", - "test": "npm run lint && sh test/utils/run_tests.sh test", - "lint": "eslint --max-warnings 0 --ext .js --ext .json .", - "coverage": "sh test/utils/run_tests.sh coverage", - "coveralls": "cat ./coverage/lcov.info | coveralls" - }, - "repository": { - "type": "git", - "url": "git://github.com/wikimedia/restbase.git" - }, - "keywords": [ - "REST", - "API", - "routing", - "orchestration", - "storage", - "buckets", - "tables", - "queues", - "cassandra", - "kafka" - ], - "author": "Wikimedia Service Team ", - "license": "Apache-2.0", - "bugs": { - "url": "https://phabricator.wikimedia.org/tag/restbase/" - }, - "homepage": "https://github.com/wikimedia/restbase", - "readme": "README.md", - "dependencies": { - "bluebird": "^3.7.2", - "content-type": "git+https://github.com/wikimedia/content-type#master", - "entities": "^2.0.3", - "fast-json-stable-stringify": "^2.1.0", - "hyperswitch": "^0.14.0", - "jsonwebtoken": "^8.5.1", - "mediawiki-title": "^0.7.4", - "restbase-mod-table-cassandra": "^1.2.1", - "semver": "^7.3.2", - "service-runner": "^2.8.1", - "uuid": "^7.0.3" - }, - "devDependencies": { - "ajv": "^6.10.2", - "bunyan": "^1.8.12", - "coveralls": "^3.1.0", - "eslint": "^5.16.0", - "eslint-config-wikimedia": "^0.13.1", - "eslint-plugin-jsdoc": "^20.4.0", - "eslint-plugin-json": "^1.4.0", - "js-yaml": "^3.13.1", - "mocha": "^6.2.3", - "mocha-lcov-reporter": "^1.3.0", - "mocha.parallel": "^0.15.6", - "nock": "^10.0.6", - "nyc": "^14.1.1", - "openapi-schema-validator": "^3.0.3", - "preq": "^0.5.14", - "restbase-mod-table-sqlite": "^1.2.1" - }, - "engines": { - "node": ">=6" - }, - "deploy": { - "node": "6.11.1", - "target": "debian:stretch", + "name": "restbase", + "version": "1.1.4", + "description": "REST storage and service dispatcher", + "main": "index.js", + "scripts": { + "postpublish": "git tag -a \"v${npm_package_version}\" -m \"${npm_package_name}@${npm_package_version} release\" && git push upstream \"v${npm_package_version}\"", + "start": "service-runner", + "test": "npm run lint && sh test/utils/run_tests.sh test", + "lint": "eslint --max-warnings 0 --ext .js --ext .json .", + "coverage": "sh test/utils/run_tests.sh coverage", + "coveralls": "cat ./coverage/lcov.info | coveralls" + }, + "repository": { + "type": "git", + "url": "git://github.com/wikimedia/restbase.git" + }, + "keywords": [ + "REST", + "API", + "routing", + "orchestration", + "storage", + "buckets", + "tables", + "queues", + "cassandra", + "kafka" + ], + "author": "Wikimedia Service Team ", + "license": "Apache-2.0", + "bugs": { + "url": "https://phabricator.wikimedia.org/tag/restbase/" + }, + "homepage": "https://github.com/wikimedia/restbase", + "readme": "README.md", "dependencies": { - "_all": [] + "bluebird": "^3.7.2", + "content-type": "git+https://github.com/wikimedia/content-type#master", + "entities": "^3.0.1", + "fast-json-stable-stringify": "^2.1.0", + "hyperswitch": "^0.14.0", + "jsonwebtoken": "^8.5.1", + "mediawiki-title": "^0.7.4", + "restbase-mod-table-cassandra": "^1.2.1", + "semver": "^7.3.5", + "service-runner": "^3.0.0", + "uuid": "^8.3.2" + }, + "devDependencies": { + "ajv": "^8.10.0", + "bunyan": "^1.8.15", + "coveralls": "^3.1.1", + "eslint": "^7.24.0", + "eslint-config-wikimedia": "^0.20.0", + "js-yaml": "^4.1.0", + "mocha": "^9.2.0", + "mocha-lcov-reporter": "^1.3.0", + "mocha.parallel": "^0.15.6", + "nock": "^13.2.4", + "nyc": "^15.1.0", + "openapi-schema-validator": "^10.0.0", + "preq": "^0.5.14", + "restbase-mod-table-sqlite": "^1.2.1" + }, + "engines": { + "node": ">=10" + }, + "deploy": { + "node": "10.24.0", + "target": "debian:buster", + "dependencies": { + "_all": [] + } } - } } diff --git a/server.js b/server.js index 844c588bd..943f92ea5 100755 --- a/server.js +++ b/server.js @@ -3,5 +3,5 @@ 'use strict'; // B/C wrapper to make the old init script work with service-runner. -var ServiceRunner = require('service-runner'); +const ServiceRunner = require('service-runner'); new ServiceRunner().start(); diff --git a/sys/action.js b/sys/action.js index e3bb97c85..cca0b9850 100644 --- a/sys/action.js +++ b/sys/action.js @@ -283,6 +283,7 @@ class ActionService { * * Expects the project domain to be passed in req.params.domain. Fetching * siteinfo for other projects / domains is not supported. + * * @param {Object} hyper Hyperswitch instance * @param {Object} req request object * @return {Object} site info diff --git a/sys/page_revisions.js b/sys/page_revisions.js index 3ad626b26..90a23f8eb 100644 --- a/sys/page_revisions.js +++ b/sys/page_revisions.js @@ -251,6 +251,7 @@ class PRS { * - sha1hidden or texthidden: raise 403 error * - commenthidden: remove comment field from response * - userhidden: remove user information from response + * * @param {Object} item the revision item * @throws HTTPError if access to the revision should be denied */ @@ -316,6 +317,7 @@ class PRS { /** * Checks if two revisions are the same, ignoring different tid values. + * * @private * @param {Object} firstRev * @param {Object} secondRev diff --git a/sys/parsoid.js b/sys/parsoid.js index f298fef4e..9949e3fa6 100644 --- a/sys/parsoid.js +++ b/sys/parsoid.js @@ -25,6 +25,7 @@ function sameHtml(a, b) { /** * Makes sure we have a meta tag for the tid in our output + * * @param {string} html original HTML content * @param {string} tid the tid to insert * @return {string} modified html @@ -48,6 +49,7 @@ function extractTidMeta(html) { /** * Checks whether the content has been modified since the timestamp * in `if-unmodified-since` header of the request + * * @param {Object} req the request * @param {Object} res the response * @return {boolean} true if content has beed modified @@ -66,6 +68,7 @@ function isModifiedSince(req, res) { } /** HTML resource_change event emission + * * @param {HyperSwitch} hyper the hyperswitch router object * @param {Object} req the request * @param {boolean} [newContent] whether this is the newest revision @@ -224,6 +227,7 @@ class ParsoidService { /** * Get full content from the stash bucket. + * * @param {HyperSwitch} hyper the hyper object to route requests * @param {string} domain the domain name * @param {string} title the article title @@ -273,6 +277,7 @@ class ParsoidService { * // it's not really the latest content, but we have already looked into * // the latest bucket, thus we can somehow pass the data over here * // so that we don't do several checks. + * * @param {HyperSwitch} hyper the hyper object for request routing * @param {string} domain the domain name * @param {string} title the page title @@ -352,6 +357,7 @@ class ParsoidService { * as we can not check the stash with no tid provided. * If all the 'title', 'revision' and 'tid' are provided, * we check the latest bucket first, and then the stash bucket. + * * @param {HyperSwitch} hyper the hyper object to rout requests * @param {string} domain the domain name * @param {string} title the article title @@ -400,6 +406,7 @@ class ParsoidService { /** * Generate content and store it in the latest bucket if the content is indeed * newer then the original content we have fetched. + * * @param {HyperSwitch} hyper the hyper object for request routing * @param {Object} req the original request * @param {Object} currentContentRes the pagebundle received from latest or fallback bucket. @@ -481,7 +488,8 @@ class ParsoidService { * https://phabricator.wikimedia.org/T120171 and * https://phabricator.wikimedia.org/T120972 are resolved / resource * consumption for these articles has been reduced to a reasonable level. - * @param {Request} req the request being processed + * + * @param {Object} req the request being processed * @return {boolean} Whether re-rendering this title is okay. */ _okayToRerender(req) { diff --git a/v1/common_schemas.yaml b/v1/common_schemas.yaml index 215b09033..3fc9ab7ac 100644 --- a/v1/common_schemas.yaml +++ b/v1/common_schemas.yaml @@ -108,20 +108,16 @@ components: lang: type: string description: The page language code - example: en dir: type: string description: The page language direction code - example: ltr timestamp: type: string description: The time when the page was last edited in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format - example: 1970-01-01T00:00:00.000Z description: type: string description: Wikidata description for the page - example: American poet coordinates: type: object description: The coordinates of the item diff --git a/v1/lists.js b/v1/lists.js index ed1fa7fca..40509542f 100644 --- a/v1/lists.js +++ b/v1/lists.js @@ -17,6 +17,7 @@ class ReadingLists { /** * Transform the continuation data into a string so it is easier for clients to deal with. + * * @param {!Object|undefined} continuation Continuation object returned by the MediaWiki API. * @return {!string|undefined} Continuation string. */ @@ -26,6 +27,7 @@ class ReadingLists { /** * Inverse of flattenContinuation. + * * @param {!string|undefined} continuation Continuation string returned by * flattenContinuation() * @return {!Object} Continuation object. @@ -63,6 +65,7 @@ class ReadingLists { /** * Convert an array of values into the format expected by the MediaWiki API. + * * @param {!Array} list A list containing strings and numbers. * @return {!string} */ @@ -72,10 +75,11 @@ class ReadingLists { /** * Takes an array of integers and formats them as an array of {: } objects. + * * @param {!Array} ids * @param {!string} keyword * @return {!Array} - */ + */ idsToObjects(ids, keyword) { return ids.map((id) => { // If the MW API has been updated to send objects, handle that gracefully. @@ -91,6 +95,7 @@ class ReadingLists { /** * Get the sort parameters for the action API. + * * @param {!string} sort Sort mode ('name' or 'updated'). * @return {!Object} { sort: , dir: } */ @@ -110,6 +115,7 @@ class ReadingLists { * * Normally the timstamp is just copied from the MediaWiki response, but for a transition * period we are going to generate it. + * * @param {!Object} responseBody The response object body. * @param {!string} next The continuation parameter submitted by the client. * @return {!string} An ISO 8601 timestamp. @@ -133,6 +139,7 @@ class ReadingLists { /** * Handle the /list/{id}/entries endpoint (get entries of a list). + * * @param {!HyperSwitch} hyper * @param {!Object} req The request object as provided by HyperSwitch. * @return {!Promise} A response promise. @@ -173,6 +180,7 @@ class ReadingLists { /** * Add data from the summary endpoint to an array of list entries. + * * @param {!Object} res Response object. * @param {!HyperSwitch} hyper Hyperswitch context * @param {!Object} req The request object as provided by HyperSwitch. diff --git a/v1/summary.js b/v1/summary.js index a39f60287..8497158fc 100644 --- a/v1/summary.js +++ b/v1/summary.js @@ -12,7 +12,7 @@ const entities = require('entities'); * attributes are separated by spaces, attribute might have a value surrounded by ' or ", * the value is allowed to have any character. * - * @const + * @constant * @type {RegExp} */ const TAGS_MATCH = /<\/?[a-zA-Z][\w-]*(?:\s+[a-zA-Z_\-:]+(?:=\\?(?:"[^"]*"|'[^']*'))?)*\s*\/?>/g;