From 1086ef1f5085f551d444c6cee2e9ffd7d812fc0a Mon Sep 17 00:00:00 2001 From: Felix Hsu Date: Wed, 1 Feb 2023 02:15:13 +0800 Subject: [PATCH] fix(route): fix the eslint/prettier conflict on 'space-in-parens' rule by replacing 'for loop' with 'while loop' (#11742) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(route): xiaomiyoupin crowdfunding error and migrate to v2 * initial commit * add searchHit * add jobPosting * linkedincn * add linkedincn ok * feat(route): 中国新闻周刊 (#11665) * feat(route): 中国新闻周刊 * fix: decode via iconv instead of puppeteer * fix: cache full text request * Update lib/v2/inewsweek/index.js * fix: exact publish time * fix: timezone * feat(route): 修复 HelloGitHub 的 月刊 路由 (#11675) * feat(route): 添加 百度股市通 * fix: 修改 百度股市通 路径 * docs: 添加 百度股市通 文档 * feat: 添加 radar 支持 * fix: 按字母顺序插入新路由 * feat(route): 新增 腾讯新闻 - 新型冠状病毒肺炎疫情实时追踪 * fix: 优化 腾讯新闻 - 新型冠状病毒肺炎疫情实时追踪 的标题 * fix: 修复 腾讯新闻 - 新型冠状病毒肺炎疫情实时追踪 部分情况下的非空判断 * fix: 修复 地区名称标题的问题 * fix: 腾讯新闻 - 新型冠状病毒肺炎疫情实时追踪 的 guid 增加 pubDate * fix: 修复 腾讯新闻 - 新型冠状病毒肺炎疫情实时追踪 guid 中添加 pubDate * fix: 修改 腾讯新闻 - 新型冠状病毒肺炎疫情实时追踪 的 title * feat(route): 修复 HelloGitHub 的 月刊 路由 * fix: remove guid * fix(route): x6d (#11676) * chore(deps): bump rand-user-agent from 1.0.101 to 1.0.102 (#11678) Bumps [rand-user-agent](https://github.com/WebScrapingAPI/rand-user-agent) from 1.0.101 to 1.0.102. - [Release notes](https://github.com/WebScrapingAPI/rand-user-agent/releases) - [Commits](https://github.com/WebScrapingAPI/rand-user-agent/commits) --- updated-dependencies: - dependency-name: rand-user-agent dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump @sentry/node from 7.31.1 to 7.32.1 (#11680) Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.31.1 to 7.32.1. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/7.31.1...7.32.1) --- updated-dependencies: - dependency-name: "@sentry/node" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump jsdom from 21.0.0 to 21.1.0 (#11681) Bumps [jsdom](https://github.com/jsdom/jsdom) from 21.0.0 to 21.1.0. - [Release notes](https://github.com/jsdom/jsdom/releases) - [Changelog](https://github.com/jsdom/jsdom/blob/master/Changelog.md) - [Commits](https://github.com/jsdom/jsdom/compare/21.0.0...21.1.0) --- updated-dependencies: - dependency-name: jsdom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump puppeteer from 19.5.2 to 19.6.0 (#11679) Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 19.5.2 to 19.6.0. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json) - [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.5.2...puppeteer-v19.6.0) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat(route): famitsu (#11682) * fix(route): xiaomiyoupin crowdfunding error and migrate to v2 (#11677) * fix(route): xiaomiyoupin crowdfunding error and migrate to v2 * Update lib/v2/xiaomiyoupin/maintainer.js * Update docs/shopping.md * use single api endpoint for both module * add pubDate() * fix(route): ikea (#11685) * chore(deps): bump @sentry/node from 7.32.1 to 7.33.0 (#11687) Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.32.1 to 7.33.0. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/7.32.1...7.33.0) --- updated-dependencies: - dependency-name: "@sentry/node" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump jest from 29.3.1 to 29.4.0 (#11686) Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.3.1 to 29.4.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.4.0/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(route): bloomberg videopage parse error (#11688) * fix(route): clickme (#11689) * fix(route): lofter (#11696) * fix(route): caixin blog (#11695) * fix(route): caixin blog * fix: url * chore(deps): bump ioredis from 5.2.5 to 5.3.0 (#11697) Bumps [ioredis](https://github.com/luin/ioredis) from 5.2.5 to 5.3.0. - [Release notes](https://github.com/luin/ioredis/releases) - [Changelog](https://github.com/luin/ioredis/blob/main/CHANGELOG.md) - [Commits](https://github.com/luin/ioredis/compare/v5.2.5...v5.3.0) --- updated-dependencies: - dependency-name: ioredis dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(route): bioone (#11699) * feat(route): github wiki history (#11700) * feat(route): wuhan (#11701) Co-authored-by: nczitzk * chore(deps): bump puppeteer from 19.6.0 to 19.6.1 (#11702) Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 19.6.0 to 19.6.1. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json) - [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.6.0...puppeteer-v19.6.1) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump jest from 29.4.0 to 29.4.1 (#11703) Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.4.0 to 29.4.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.4.1/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(route): fix date err and refactor to v2 (#11705) * fix(route): fix date err and refactor to v2 * docs: add en docs * fix: typo * feat(route): add mixcloud (#11672) * feat(route): add mixcloud * docs * feat(route): add mixcloud * convert linebreaks to
* docs: add supportPodcast * codestyle: use template literals * refactor: split graph ql queries * fix(route): 软餐 (#11708) * feat(route): gelonghui (#11710) * chore(deps): bump @sentry/node from 7.33.0 to 7.34.0 (#11711) Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 7.33.0 to 7.34.0. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/7.33.0...7.34.0) --- updated-dependencies: - dependency-name: "@sentry/node" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(route): fix not unique guid and refactor to v2 (#11712) * add null check * add more null check for compensation * remove unused key * refactor: change route * fix typo * add desc text formatting and caching * posting forget to accept * Fix async/await mismatch Co-authored-by: Tony * Fix async/await mismatch on ctx.cache.tryGet Co-authored-by: Tony * renderer ok * fix eslint & pretty error * fix eslint/prettier conflict * fix eslint/prettier conflict * revert back to origin --- lib/v2/linkedin/cn/renderer.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/v2/linkedin/cn/renderer.js b/lib/v2/linkedin/cn/renderer.js index 52509e888..f90f493ee 100644 --- a/lib/v2/linkedin/cn/renderer.js +++ b/lib/v2/linkedin/cn/renderer.js @@ -31,9 +31,24 @@ class Ucs2Text { const k = text.length; const d = []; - for (let l, e, m = 0; m < k; ) { - 55296 <= (l = text.charCodeAt(m++)) && 56319 >= l && m < k ? (56320 === (64512 & (e = text.charCodeAt(m++))) ? d.push(((1023 & l) << 10) + (1023 & e) + 65536) : (d.push(l), m--)) : d.push(l); + let l, + e, + m = 0; + while (m < k) { + l = text.charCodeAt(m++); + if (l >= 55296 && l <= 56319 && m < k) { + e = text.charCodeAt(m++); + if (56320 === (64512 & e)) { + d.push(((1023 & l) << 10) + (1023 & e) + 65536); + } else { + d.push(l); + m--; + } + } else { + d.push(l); + } } + this.codePoints = d; } this.length = this.codePoints.length; @@ -78,7 +93,8 @@ const parseAttr = (description) => { const n = []; for (const q of attrs) { const p = new TreeNode(q); - for (let w = q.start; 0 < n.length && n[n.length - 1].attr.start >= w; ) { + const w = q.start; + while (0 < n.length && n[n.length - 1].attr.start >= w) { p.children.push(n.pop()); } p.children.reverse();