惊鸿戏梦 3 ماه پیش
والد
کامیت
91cc616fb2
100فایلهای تغییر یافته به همراه6835 افزوده شده و 0 حذف شده
  1. 280 0
      async-demo/node_modules/.package-lock.json
  2. 10 0
      async-demo/node_modules/boolbase/README.md
  3. 8 0
      async-demo/node_modules/boolbase/index.js
  4. 23 0
      async-demo/node_modules/boolbase/package.json
  5. 11 0
      async-demo/node_modules/cheerio-select/LICENSE
  6. 18 0
      async-demo/node_modules/cheerio-select/README.md
  7. 5 0
      async-demo/node_modules/cheerio-select/lib/esm/helpers.d.ts
  8. 1 0
      async-demo/node_modules/cheerio-select/lib/esm/helpers.d.ts.map
  9. 20 0
      async-demo/node_modules/cheerio-select/lib/esm/helpers.js
  10. 1 0
      async-demo/node_modules/cheerio-select/lib/esm/helpers.js.map
  11. 12 0
      async-demo/node_modules/cheerio-select/lib/esm/index.d.ts
  12. 1 0
      async-demo/node_modules/cheerio-select/lib/esm/index.d.ts.map
  13. 241 0
      async-demo/node_modules/cheerio-select/lib/esm/index.js
  14. 0 0
      async-demo/node_modules/cheerio-select/lib/esm/index.js.map
  15. 1 0
      async-demo/node_modules/cheerio-select/lib/esm/package.json
  16. 10 0
      async-demo/node_modules/cheerio-select/lib/esm/positionals.d.ts
  17. 1 0
      async-demo/node_modules/cheerio-select/lib/esm/positionals.d.ts.map
  18. 47 0
      async-demo/node_modules/cheerio-select/lib/esm/positionals.js
  19. 1 0
      async-demo/node_modules/cheerio-select/lib/esm/positionals.js.map
  20. 5 0
      async-demo/node_modules/cheerio-select/lib/helpers.d.ts
  21. 1 0
      async-demo/node_modules/cheerio-select/lib/helpers.d.ts.map
  22. 26 0
      async-demo/node_modules/cheerio-select/lib/helpers.js
  23. 1 0
      async-demo/node_modules/cheerio-select/lib/helpers.js.map
  24. 12 0
      async-demo/node_modules/cheerio-select/lib/index.d.ts
  25. 1 0
      async-demo/node_modules/cheerio-select/lib/index.d.ts.map
  26. 302 0
      async-demo/node_modules/cheerio-select/lib/index.js
  27. 0 0
      async-demo/node_modules/cheerio-select/lib/index.js.map
  28. 10 0
      async-demo/node_modules/cheerio-select/lib/positionals.d.ts
  29. 1 0
      async-demo/node_modules/cheerio-select/lib/positionals.d.ts.map
  30. 52 0
      async-demo/node_modules/cheerio-select/lib/positionals.js
  31. 1 0
      async-demo/node_modules/cheerio-select/lib/positionals.js.map
  32. 76 0
      async-demo/node_modules/cheerio-select/package.json
  33. 21 0
      async-demo/node_modules/cheerio/LICENSE
  34. 247 0
      async-demo/node_modules/cheerio/Readme.md
  35. 385 0
      async-demo/node_modules/cheerio/dist/browser/api/attributes.d.ts
  36. 0 0
      async-demo/node_modules/cheerio/dist/browser/api/attributes.d.ts.map
  37. 619 0
      async-demo/node_modules/cheerio/dist/browser/api/attributes.js
  38. 0 0
      async-demo/node_modules/cheerio/dist/browser/api/attributes.js.map
  39. 42 0
      async-demo/node_modules/cheerio/dist/browser/api/css.d.ts
  40. 1 0
      async-demo/node_modules/cheerio/dist/browser/api/css.d.ts.map
  41. 116 0
      async-demo/node_modules/cheerio/dist/browser/api/css.js
  42. 0 0
      async-demo/node_modules/cheerio/dist/browser/api/css.js.map
  43. 29 0
      async-demo/node_modules/cheerio/dist/browser/api/extract.d.ts
  44. 1 0
      async-demo/node_modules/cheerio/dist/browser/api/extract.d.ts.map
  45. 42 0
      async-demo/node_modules/cheerio/dist/browser/api/extract.js
  46. 1 0
      async-demo/node_modules/cheerio/dist/browser/api/extract.js.map
  47. 36 0
      async-demo/node_modules/cheerio/dist/browser/api/forms.d.ts
  48. 1 0
      async-demo/node_modules/cheerio/dist/browser/api/forms.d.ts.map
  49. 81 0
      async-demo/node_modules/cheerio/dist/browser/api/forms.js
  50. 1 0
      async-demo/node_modules/cheerio/dist/browser/api/forms.js.map
  51. 528 0
      async-demo/node_modules/cheerio/dist/browser/api/manipulation.d.ts
  52. 0 0
      async-demo/node_modules/cheerio/dist/browser/api/manipulation.d.ts.map
  53. 829 0
      async-demo/node_modules/cheerio/dist/browser/api/manipulation.js
  54. 0 0
      async-demo/node_modules/cheerio/dist/browser/api/manipulation.js.map
  55. 657 0
      async-demo/node_modules/cheerio/dist/browser/api/traversing.d.ts
  56. 0 0
      async-demo/node_modules/cheerio/dist/browser/api/traversing.d.ts.map
  57. 853 0
      async-demo/node_modules/cheerio/dist/browser/api/traversing.js
  58. 0 0
      async-demo/node_modules/cheerio/dist/browser/api/traversing.js.map
  59. 85 0
      async-demo/node_modules/cheerio/dist/browser/cheerio.d.ts
  60. 1 0
      async-demo/node_modules/cheerio/dist/browser/cheerio.d.ts.map
  61. 58 0
      async-demo/node_modules/cheerio/dist/browser/cheerio.js
  62. 1 0
      async-demo/node_modules/cheerio/dist/browser/cheerio.js.map
  63. 1 0
      async-demo/node_modules/cheerio/dist/browser/index-browser.d.mts.map
  64. 1 0
      async-demo/node_modules/cheerio/dist/browser/index-browser.mjs.map
  65. 5 0
      async-demo/node_modules/cheerio/dist/browser/index.d.ts
  66. 3 0
      async-demo/node_modules/cheerio/dist/browser/index.js
  67. 20 0
      async-demo/node_modules/cheerio/dist/browser/load-parse.d.ts
  68. 1 0
      async-demo/node_modules/cheerio/dist/browser/load-parse.d.ts.map
  69. 28 0
      async-demo/node_modules/cheerio/dist/browser/load-parse.js
  70. 1 0
      async-demo/node_modules/cheerio/dist/browser/load-parse.js.map
  71. 91 0
      async-demo/node_modules/cheerio/dist/browser/load.d.ts
  72. 1 0
      async-demo/node_modules/cheerio/dist/browser/load.d.ts.map
  73. 123 0
      async-demo/node_modules/cheerio/dist/browser/load.js
  74. 0 0
      async-demo/node_modules/cheerio/dist/browser/load.js.map
  75. 95 0
      async-demo/node_modules/cheerio/dist/browser/options.d.ts
  76. 1 0
      async-demo/node_modules/cheerio/dist/browser/options.d.ts.map
  77. 34 0
      async-demo/node_modules/cheerio/dist/browser/options.js
  78. 1 0
      async-demo/node_modules/cheerio/dist/browser/options.js.map
  79. 3 0
      async-demo/node_modules/cheerio/dist/browser/package.json
  80. 18 0
      async-demo/node_modules/cheerio/dist/browser/parse.d.ts
  81. 1 0
      async-demo/node_modules/cheerio/dist/browser/parse.d.ts.map
  82. 73 0
      async-demo/node_modules/cheerio/dist/browser/parse.js
  83. 1 0
      async-demo/node_modules/cheerio/dist/browser/parse.js.map
  84. 20 0
      async-demo/node_modules/cheerio/dist/browser/parsers/parse5-adapter.d.ts
  85. 1 0
      async-demo/node_modules/cheerio/dist/browser/parsers/parse5-adapter.d.ts.map
  86. 50 0
      async-demo/node_modules/cheerio/dist/browser/parsers/parse5-adapter.js
  87. 1 0
      async-demo/node_modules/cheerio/dist/browser/parsers/parse5-adapter.js.map
  88. 25 0
      async-demo/node_modules/cheerio/dist/browser/slim.d.ts
  89. 1 0
      async-demo/node_modules/cheerio/dist/browser/slim.d.ts.map
  90. 22 0
      async-demo/node_modules/cheerio/dist/browser/slim.js
  91. 1 0
      async-demo/node_modules/cheerio/dist/browser/slim.js.map
  92. 112 0
      async-demo/node_modules/cheerio/dist/browser/static.d.ts
  93. 1 0
      async-demo/node_modules/cheerio/dist/browser/static.d.ts.map
  94. 204 0
      async-demo/node_modules/cheerio/dist/browser/static.js
  95. 0 0
      async-demo/node_modules/cheerio/dist/browser/static.js.map
  96. 21 0
      async-demo/node_modules/cheerio/dist/browser/types.d.ts
  97. 1 0
      async-demo/node_modules/cheerio/dist/browser/types.d.ts.map
  98. 3 0
      async-demo/node_modules/cheerio/dist/browser/types.js
  99. 1 0
      async-demo/node_modules/cheerio/dist/browser/types.js.map
  100. 55 0
      async-demo/node_modules/cheerio/dist/browser/utils.d.ts

+ 280 - 0
async-demo/node_modules/.package-lock.json

@@ -0,0 +1,280 @@
+{
+  "name": "async-demo",
+  "version": "1.0.0",
+  "lockfileVersion": 3,
+  "requires": true,
+  "packages": {
+    "node_modules/boolbase": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/boolbase/-/boolbase-1.0.0.tgz",
+      "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==",
+      "license": "ISC"
+    },
+    "node_modules/cheerio": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/cheerio/-/cheerio-1.0.0.tgz",
+      "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==",
+      "license": "MIT",
+      "dependencies": {
+        "cheerio-select": "^2.1.0",
+        "dom-serializer": "^2.0.0",
+        "domhandler": "^5.0.3",
+        "domutils": "^3.1.0",
+        "encoding-sniffer": "^0.2.0",
+        "htmlparser2": "^9.1.0",
+        "parse5": "^7.1.2",
+        "parse5-htmlparser2-tree-adapter": "^7.0.0",
+        "parse5-parser-stream": "^7.1.2",
+        "undici": "^6.19.5",
+        "whatwg-mimetype": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=18.17"
+      },
+      "funding": {
+        "url": "https://github.com/cheeriojs/cheerio?sponsor=1"
+      }
+    },
+    "node_modules/cheerio-select": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/cheerio-select/-/cheerio-select-2.1.0.tgz",
+      "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==",
+      "license": "BSD-2-Clause",
+      "dependencies": {
+        "boolbase": "^1.0.0",
+        "css-select": "^5.1.0",
+        "css-what": "^6.1.0",
+        "domelementtype": "^2.3.0",
+        "domhandler": "^5.0.3",
+        "domutils": "^3.0.1"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/fb55"
+      }
+    },
+    "node_modules/css-select": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmmirror.com/css-select/-/css-select-5.1.0.tgz",
+      "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==",
+      "license": "BSD-2-Clause",
+      "dependencies": {
+        "boolbase": "^1.0.0",
+        "css-what": "^6.1.0",
+        "domhandler": "^5.0.2",
+        "domutils": "^3.0.1",
+        "nth-check": "^2.0.1"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/fb55"
+      }
+    },
+    "node_modules/css-what": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmmirror.com/css-what/-/css-what-6.1.0.tgz",
+      "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==",
+      "license": "BSD-2-Clause",
+      "engines": {
+        "node": ">= 6"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/fb55"
+      }
+    },
+    "node_modules/dom-serializer": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-2.0.0.tgz",
+      "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
+      "license": "MIT",
+      "dependencies": {
+        "domelementtype": "^2.3.0",
+        "domhandler": "^5.0.2",
+        "entities": "^4.2.0"
+      },
+      "funding": {
+        "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
+      }
+    },
+    "node_modules/domelementtype": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-2.3.0.tgz",
+      "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/fb55"
+        }
+      ],
+      "license": "BSD-2-Clause"
+    },
+    "node_modules/domhandler": {
+      "version": "5.0.3",
+      "resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-5.0.3.tgz",
+      "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+      "license": "BSD-2-Clause",
+      "dependencies": {
+        "domelementtype": "^2.3.0"
+      },
+      "engines": {
+        "node": ">= 4"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/domhandler?sponsor=1"
+      }
+    },
+    "node_modules/domutils": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmmirror.com/domutils/-/domutils-3.1.0.tgz",
+      "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==",
+      "license": "BSD-2-Clause",
+      "dependencies": {
+        "dom-serializer": "^2.0.0",
+        "domelementtype": "^2.3.0",
+        "domhandler": "^5.0.3"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/domutils?sponsor=1"
+      }
+    },
+    "node_modules/encoding-sniffer": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmmirror.com/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz",
+      "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==",
+      "license": "MIT",
+      "dependencies": {
+        "iconv-lite": "^0.6.3",
+        "whatwg-encoding": "^3.1.1"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/encoding-sniffer?sponsor=1"
+      }
+    },
+    "node_modules/entities": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz",
+      "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
+      "license": "BSD-2-Clause",
+      "engines": {
+        "node": ">=0.12"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/entities?sponsor=1"
+      }
+    },
+    "node_modules/htmlparser2": {
+      "version": "9.1.0",
+      "resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-9.1.0.tgz",
+      "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==",
+      "funding": [
+        "https://github.com/fb55/htmlparser2?sponsor=1",
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/fb55"
+        }
+      ],
+      "license": "MIT",
+      "dependencies": {
+        "domelementtype": "^2.3.0",
+        "domhandler": "^5.0.3",
+        "domutils": "^3.1.0",
+        "entities": "^4.5.0"
+      }
+    },
+    "node_modules/iconv-lite": {
+      "version": "0.6.3",
+      "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
+      "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+      "license": "MIT",
+      "dependencies": {
+        "safer-buffer": ">= 2.1.2 < 3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/nth-check": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz",
+      "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
+      "license": "BSD-2-Clause",
+      "dependencies": {
+        "boolbase": "^1.0.0"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/nth-check?sponsor=1"
+      }
+    },
+    "node_modules/parse5": {
+      "version": "7.2.1",
+      "resolved": "https://registry.npmmirror.com/parse5/-/parse5-7.2.1.tgz",
+      "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==",
+      "license": "MIT",
+      "dependencies": {
+        "entities": "^4.5.0"
+      },
+      "funding": {
+        "url": "https://github.com/inikulin/parse5?sponsor=1"
+      }
+    },
+    "node_modules/parse5-htmlparser2-tree-adapter": {
+      "version": "7.1.0",
+      "resolved": "https://registry.npmmirror.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz",
+      "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==",
+      "license": "MIT",
+      "dependencies": {
+        "domhandler": "^5.0.3",
+        "parse5": "^7.0.0"
+      },
+      "funding": {
+        "url": "https://github.com/inikulin/parse5?sponsor=1"
+      }
+    },
+    "node_modules/parse5-parser-stream": {
+      "version": "7.1.2",
+      "resolved": "https://registry.npmmirror.com/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz",
+      "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==",
+      "license": "MIT",
+      "dependencies": {
+        "parse5": "^7.0.0"
+      },
+      "funding": {
+        "url": "https://github.com/inikulin/parse5?sponsor=1"
+      }
+    },
+    "node_modules/safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+      "license": "MIT"
+    },
+    "node_modules/undici": {
+      "version": "6.21.0",
+      "resolved": "https://registry.npmmirror.com/undici/-/undici-6.21.0.tgz",
+      "integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18.17"
+      }
+    },
+    "node_modules/whatwg-encoding": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmmirror.com/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz",
+      "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==",
+      "license": "MIT",
+      "dependencies": {
+        "iconv-lite": "0.6.3"
+      },
+      "engines": {
+        "node": ">=18"
+      }
+    },
+    "node_modules/whatwg-mimetype": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmmirror.com/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz",
+      "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      }
+    }
+  }
+}

+ 10 - 0
async-demo/node_modules/boolbase/README.md

@@ -0,0 +1,10 @@
+#boolbase
+This very simple module provides two basic functions, one that always returns true (`trueFunc`) and one that always returns false (`falseFunc`).
+
+###WTF?
+
+By having only a single instance of these functions around, it's possible to do some nice optimizations. Eg. [`CSSselect`](https://github.com/fb55/CSSselect) uses these functions to determine whether a selector won't match any elements. If that's the case, the DOM doesn't even have to be touched.
+
+###And why is this a separate module?
+
+I'm trying to modularize `CSSselect` and most modules depend on these functions. IMHO, having a separate module is the easiest solution to this problem.

+ 8 - 0
async-demo/node_modules/boolbase/index.js

@@ -0,0 +1,8 @@
+module.exports = {
+	trueFunc: function trueFunc(){
+		return true;
+	},
+	falseFunc: function falseFunc(){
+		return false;
+	}
+};

+ 23 - 0
async-demo/node_modules/boolbase/package.json

@@ -0,0 +1,23 @@
+{
+  "name": "boolbase",
+  "version": "1.0.0",
+  "description": "two functions: One that returns true, one that returns false",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/fb55/boolbase"
+  },
+  "keywords": [
+    "boolean",
+    "function"
+  ],
+  "author": "Felix Boehm <me@feedic.com>",
+  "license": "ISC",
+  "bugs": {
+    "url": "https://github.com/fb55/boolbase/issues"
+  },
+  "homepage": "https://github.com/fb55/boolbase"
+}

+ 11 - 0
async-demo/node_modules/cheerio-select/LICENSE

@@ -0,0 +1,11 @@
+Copyright (c) Felix Böhm
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 18 - 0
async-demo/node_modules/cheerio-select/README.md

@@ -0,0 +1,18 @@
+# cheerio-select [![NPM version](http://img.shields.io/npm/v/cheerio-select.svg)](https://npmjs.org/package/cheerio-select) [![Build Status](https://travis-ci.org/cheeriojs/cheerio-select.svg?branch=master)](http://travis-ci.org/cheeriojs/cheerio-select) [![Downloads](https://img.shields.io/npm/dm/cheerio-select.svg)](https://npmjs.org/package/cheerio-select) [![Coverage](https://coveralls.io/repos/cheeriojs/cheerio-select/badge.svg?branch=master)](https://coveralls.io/r/cheeriojs/cheerio-select)
+
+CSS selector engine supporting jQuery selectors, based on [`css-select`](https://github.com/fb55/css-select).
+
+Supports all jQuery positional pseudo-selectors:
+
+-   `:first`
+-   `:last`
+-   `:eq`
+-   `:nth`
+-   `:gt`
+-   `:lt`
+-   `:even`
+-   `:odd`
+-   `:not(:positional)`, where `:positional` is any of the above.
+
+This library is a thin wrapper around [`css-select`](https://github.com/fb55/css-select).
+Only use this module if you will actually use jQuery positional selectors.

+ 5 - 0
async-demo/node_modules/cheerio-select/lib/esm/helpers.d.ts

@@ -0,0 +1,5 @@
+import type { AnyNode } from "domhandler";
+import type { Selector } from "css-what";
+export declare function getDocumentRoot(node: AnyNode): AnyNode;
+export declare function groupSelectors(selectors: Selector[][]): [plain: Selector[][], filtered: Selector[][]];
+//# sourceMappingURL=helpers.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/esm/helpers.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"helpers.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAGtD;AAED,wBAAgB,cAAc,CAC1B,SAAS,EAAE,QAAQ,EAAE,EAAE,GACxB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAa/C"}

+ 20 - 0
async-demo/node_modules/cheerio-select/lib/esm/helpers.js

@@ -0,0 +1,20 @@
+import { isFilter } from "./positionals.js";
+export function getDocumentRoot(node) {
+    while (node.parent)
+        node = node.parent;
+    return node;
+}
+export function groupSelectors(selectors) {
+    const filteredSelectors = [];
+    const plainSelectors = [];
+    for (const selector of selectors) {
+        if (selector.some(isFilter)) {
+            filteredSelectors.push(selector);
+        }
+        else {
+            plainSelectors.push(selector);
+        }
+    }
+    return [plainSelectors, filteredSelectors];
+}
+//# sourceMappingURL=helpers.js.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/esm/helpers.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"helpers.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,UAAU,eAAe,CAAC,IAAa;IACzC,OAAO,IAAI,CAAC,MAAM;QAAE,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACvC,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,cAAc,CAC1B,SAAuB;IAEvB,MAAM,iBAAiB,GAAiB,EAAE,CAAC;IAC3C,MAAM,cAAc,GAAiB,EAAE,CAAC;IAExC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAC9B,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACzB,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACpC;aAAM;YACH,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACjC;KACJ;IAED,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAC/C,CAAC"}

+ 12 - 0
async-demo/node_modules/cheerio-select/lib/esm/index.d.ts

@@ -0,0 +1,12 @@
+import { type Options as CSSSelectOptions } from "css-select";
+import type { Element, AnyNode, Document } from "domhandler";
+export { filters, pseudos, aliases } from "css-select";
+export interface Options extends CSSSelectOptions<AnyNode, Element> {
+    /** Optional reference to the root of the document. If not set, this will be computed when needed. */
+    root?: Document;
+}
+export declare function is(element: Element, selector: string | ((el: Element) => boolean), options?: Options): boolean;
+export declare function some(elements: Element[], selector: string | ((el: Element) => boolean), options?: Options): boolean;
+export declare function filter(selector: string, elements: AnyNode[], options?: Options): Element[];
+export declare function select(selector: string | ((el: Element) => boolean), root: AnyNode | AnyNode[], options?: Options, limit?: number): Element[];
+//# sourceMappingURL=index.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/esm/index.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,OAAO,IAAI,gBAAgB,EAEnC,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAU7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYvD,MAAM,WAAW,OAAQ,SAAQ,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC;IAC/D,qGAAqG;IACrG,IAAI,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,wBAAgB,EAAE,CACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,OAAO,GAAE,OAAY,GACtB,OAAO,CAET;AAED,wBAAgB,IAAI,CAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,OAAO,GAAE,OAAY,GACtB,OAAO,CAWT;AAsCD,wBAAgB,MAAM,CAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,GAAE,OAAY,GACtB,OAAO,EAAE,CAEX;AAoGD,wBAAgB,MAAM,CAClB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,EACzB,OAAO,GAAE,OAAY,EACrB,KAAK,SAAW,GACjB,OAAO,EAAE,CA2BX"}

+ 241 - 0
async-demo/node_modules/cheerio-select/lib/esm/index.js

@@ -0,0 +1,241 @@
+import { parse, SelectorType, isTraversal } from "css-what";
+import { _compileToken as compileToken, prepareContext, } from "css-select";
+import * as DomUtils from "domutils";
+import * as boolbase from "boolbase";
+import { getDocumentRoot, groupSelectors } from "./helpers.js";
+import { isFilter, getLimit, } from "./positionals.js";
+// Re-export pseudo extension points
+export { filters, pseudos, aliases } from "css-select";
+const UNIVERSAL_SELECTOR = {
+    type: SelectorType.Universal,
+    namespace: null,
+};
+const SCOPE_PSEUDO = {
+    type: SelectorType.Pseudo,
+    name: "scope",
+    data: null,
+};
+export function is(element, selector, options = {}) {
+    return some([element], selector, options);
+}
+export function some(elements, selector, options = {}) {
+    if (typeof selector === "function")
+        return elements.some(selector);
+    const [plain, filtered] = groupSelectors(parse(selector));
+    return ((plain.length > 0 && elements.some(compileToken(plain, options))) ||
+        filtered.some((sel) => filterBySelector(sel, elements, options).length > 0));
+}
+function filterByPosition(filter, elems, data, options) {
+    const num = typeof data === "string" ? parseInt(data, 10) : NaN;
+    switch (filter) {
+        case "first":
+        case "lt":
+            // Already done in `getLimit`
+            return elems;
+        case "last":
+            return elems.length > 0 ? [elems[elems.length - 1]] : elems;
+        case "nth":
+        case "eq":
+            return isFinite(num) && Math.abs(num) < elems.length
+                ? [num < 0 ? elems[elems.length + num] : elems[num]]
+                : [];
+        case "gt":
+            return isFinite(num) ? elems.slice(num + 1) : [];
+        case "even":
+            return elems.filter((_, i) => i % 2 === 0);
+        case "odd":
+            return elems.filter((_, i) => i % 2 === 1);
+        case "not": {
+            const filtered = new Set(filterParsed(data, elems, options));
+            return elems.filter((e) => !filtered.has(e));
+        }
+    }
+}
+export function filter(selector, elements, options = {}) {
+    return filterParsed(parse(selector), elements, options);
+}
+/**
+ * Filter a set of elements by a selector.
+ *
+ * Will return elements in the original order.
+ *
+ * @param selector Selector to filter by.
+ * @param elements Elements to filter.
+ * @param options Options for selector.
+ */
+function filterParsed(selector, elements, options) {
+    if (elements.length === 0)
+        return [];
+    const [plainSelectors, filteredSelectors] = groupSelectors(selector);
+    let found;
+    if (plainSelectors.length) {
+        const filtered = filterElements(elements, plainSelectors, options);
+        // If there are no filters, just return
+        if (filteredSelectors.length === 0) {
+            return filtered;
+        }
+        // Otherwise, we have to do some filtering
+        if (filtered.length) {
+            found = new Set(filtered);
+        }
+    }
+    for (let i = 0; i < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i++) {
+        const filteredSelector = filteredSelectors[i];
+        const missing = found
+            ? elements.filter((e) => DomUtils.isTag(e) && !found.has(e))
+            : elements;
+        if (missing.length === 0)
+            break;
+        const filtered = filterBySelector(filteredSelector, elements, options);
+        if (filtered.length) {
+            if (!found) {
+                /*
+                 * If we haven't found anything before the last selector,
+                 * just return what we found now.
+                 */
+                if (i === filteredSelectors.length - 1) {
+                    return filtered;
+                }
+                found = new Set(filtered);
+            }
+            else {
+                filtered.forEach((el) => found.add(el));
+            }
+        }
+    }
+    return typeof found !== "undefined"
+        ? (found.size === elements.length
+            ? elements
+            : // Filter elements to preserve order
+                elements.filter((el) => found.has(el)))
+        : [];
+}
+function filterBySelector(selector, elements, options) {
+    var _a;
+    if (selector.some(isTraversal)) {
+        /*
+         * Get root node, run selector with the scope
+         * set to all of our nodes.
+         */
+        const root = (_a = options.root) !== null && _a !== void 0 ? _a : getDocumentRoot(elements[0]);
+        const opts = { ...options, context: elements, relativeSelector: false };
+        selector.push(SCOPE_PSEUDO);
+        return findFilterElements(root, selector, opts, true, elements.length);
+    }
+    // Performance optimization: If we don't have to traverse, just filter set.
+    return findFilterElements(elements, selector, options, false, elements.length);
+}
+export function select(selector, root, options = {}, limit = Infinity) {
+    if (typeof selector === "function") {
+        return find(root, selector);
+    }
+    const [plain, filtered] = groupSelectors(parse(selector));
+    const results = filtered.map((sel) => findFilterElements(root, sel, options, true, limit));
+    // Plain selectors can be queried in a single go
+    if (plain.length) {
+        results.push(findElements(root, plain, options, limit));
+    }
+    if (results.length === 0) {
+        return [];
+    }
+    // If there was only a single selector, just return the result
+    if (results.length === 1) {
+        return results[0];
+    }
+    // Sort results, filtering for duplicates
+    return DomUtils.uniqueSort(results.reduce((a, b) => [...a, ...b]));
+}
+/**
+ *
+ * @param root Element(s) to search from.
+ * @param selector Selector to look for.
+ * @param options Options for querying.
+ * @param queryForSelector Query multiple levels deep for the initial selector, even if it doesn't contain a traversal.
+ */
+function findFilterElements(root, selector, options, queryForSelector, totalLimit) {
+    const filterIndex = selector.findIndex(isFilter);
+    const sub = selector.slice(0, filterIndex);
+    const filter = selector[filterIndex];
+    // If we are at the end of the selector, we can limit the number of elements to retrieve.
+    const partLimit = selector.length - 1 === filterIndex ? totalLimit : Infinity;
+    /*
+     * Set the number of elements to retrieve.
+     * Eg. for :first, we only have to get a single element.
+     */
+    const limit = getLimit(filter.name, filter.data, partLimit);
+    if (limit === 0)
+        return [];
+    /*
+     * Skip `findElements` call if our selector starts with a positional
+     * pseudo.
+     */
+    const elemsNoLimit = sub.length === 0 && !Array.isArray(root)
+        ? DomUtils.getChildren(root).filter(DomUtils.isTag)
+        : sub.length === 0
+            ? (Array.isArray(root) ? root : [root]).filter(DomUtils.isTag)
+            : queryForSelector || sub.some(isTraversal)
+                ? findElements(root, [sub], options, limit)
+                : filterElements(root, [sub], options);
+    const elems = elemsNoLimit.slice(0, limit);
+    let result = filterByPosition(filter.name, elems, filter.data, options);
+    if (result.length === 0 || selector.length === filterIndex + 1) {
+        return result;
+    }
+    const remainingSelector = selector.slice(filterIndex + 1);
+    const remainingHasTraversal = remainingSelector.some(isTraversal);
+    if (remainingHasTraversal) {
+        if (isTraversal(remainingSelector[0])) {
+            const { type } = remainingSelector[0];
+            if (type === SelectorType.Sibling ||
+                type === SelectorType.Adjacent) {
+                // If we have a sibling traversal, we need to also look at the siblings.
+                result = prepareContext(result, DomUtils, true);
+            }
+            // Avoid a traversal-first selector error.
+            remainingSelector.unshift(UNIVERSAL_SELECTOR);
+        }
+        options = {
+            ...options,
+            // Avoid absolutizing the selector
+            relativeSelector: false,
+            /*
+             * Add a custom root func, to make sure traversals don't match elements
+             * that aren't a part of the considered tree.
+             */
+            rootFunc: (el) => result.includes(el),
+        };
+    }
+    else if (options.rootFunc && options.rootFunc !== boolbase.trueFunc) {
+        options = { ...options, rootFunc: boolbase.trueFunc };
+    }
+    /*
+     * If we have another filter, recursively call `findFilterElements`,
+     * with the `recursive` flag disabled. We only have to look for more
+     * elements when we see a traversal.
+     *
+     * Otherwise,
+     */
+    return remainingSelector.some(isFilter)
+        ? findFilterElements(result, remainingSelector, options, false, totalLimit)
+        : remainingHasTraversal
+            ? // Query existing elements to resolve traversal.
+                findElements(result, [remainingSelector], options, totalLimit)
+            : // If we don't have any more traversals, simply filter elements.
+                filterElements(result, [remainingSelector], options);
+}
+function findElements(root, sel, options, limit) {
+    const query = compileToken(sel, options, root);
+    return find(root, query, limit);
+}
+function find(root, query, limit = Infinity) {
+    const elems = prepareContext(root, DomUtils, query.shouldTestNextSiblings);
+    return DomUtils.find((node) => DomUtils.isTag(node) && query(node), elems, true, limit);
+}
+function filterElements(elements, sel, options) {
+    const els = (Array.isArray(elements) ? elements : [elements]).filter(DomUtils.isTag);
+    if (els.length === 0)
+        return els;
+    const query = compileToken(sel, options);
+    return query === boolbase.trueFunc ? els : els.filter(query);
+}
+//# sourceMappingURL=index.js.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio-select/lib/esm/index.js.map


+ 1 - 0
async-demo/node_modules/cheerio-select/lib/esm/package.json

@@ -0,0 +1 @@
+{"type":"module"}

+ 10 - 0
async-demo/node_modules/cheerio-select/lib/esm/positionals.d.ts

@@ -0,0 +1,10 @@
+import type { Selector, PseudoSelector } from "css-what";
+export declare type Filter = "first" | "last" | "eq" | "nth" | "gt" | "lt" | "even" | "odd" | "not";
+export declare const filterNames: Set<string>;
+export interface CheerioSelector extends PseudoSelector {
+    name: Filter;
+    data: string | null;
+}
+export declare function isFilter(s: Selector): s is CheerioSelector;
+export declare function getLimit(filter: Filter, data: string | null, partLimit: number): number;
+//# sourceMappingURL=positionals.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/esm/positionals.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"positionals.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["positionals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzD,oBAAY,MAAM,GACZ,OAAO,GACP,MAAM,GACN,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,KAAK,GACL,KAAK,CAAC;AACZ,eAAO,MAAM,WAAW,EAAE,GAAG,CAAC,MAAM,CASlC,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,IAAI,eAAe,CAS1D;AAED,wBAAgB,QAAQ,CACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,SAAS,EAAE,MAAM,GAClB,MAAM,CAyBR"}

+ 47 - 0
async-demo/node_modules/cheerio-select/lib/esm/positionals.js

@@ -0,0 +1,47 @@
+export const filterNames = new Set([
+    "first",
+    "last",
+    "eq",
+    "gt",
+    "nth",
+    "lt",
+    "even",
+    "odd",
+]);
+export function isFilter(s) {
+    if (s.type !== "pseudo")
+        return false;
+    if (filterNames.has(s.name))
+        return true;
+    if (s.name === "not" && Array.isArray(s.data)) {
+        // Only consider `:not` with embedded filters
+        return s.data.some((s) => s.some(isFilter));
+    }
+    return false;
+}
+export function getLimit(filter, data, partLimit) {
+    const num = data != null ? parseInt(data, 10) : NaN;
+    switch (filter) {
+        case "first":
+            return 1;
+        case "nth":
+        case "eq":
+            return isFinite(num) ? (num >= 0 ? num + 1 : Infinity) : 0;
+        case "lt":
+            return isFinite(num)
+                ? num >= 0
+                    ? Math.min(num, partLimit)
+                    : Infinity
+                : 0;
+        case "gt":
+            return isFinite(num) ? Infinity : 0;
+        case "odd":
+            return 2 * partLimit;
+        case "even":
+            return 2 * partLimit - 1;
+        case "last":
+        case "not":
+            return Infinity;
+    }
+}
+//# sourceMappingURL=positionals.js.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/esm/positionals.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"positionals.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["positionals.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,WAAW,GAAgB,IAAI,GAAG,CAAS;IACpD,OAAO;IACP,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,MAAM;IACN,KAAK;CACR,CAAC,CAAC;AAOH,MAAM,UAAU,QAAQ,CAAC,CAAW;IAChC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;QAC3C,6CAA6C;QAC7C,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC/C;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,QAAQ,CACpB,MAAc,EACd,IAAmB,EACnB,SAAiB;IAEjB,MAAM,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAEpD,QAAQ,MAAM,EAAE;QACZ,KAAK,OAAO;YACR,OAAO,CAAC,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,CAAC,GAAG,IAAI,CAAC;oBACN,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;oBAC1B,CAAC,CAAC,QAAQ;gBACd,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,KAAK,KAAK;YACN,OAAO,CAAC,GAAG,SAAS,CAAC;QACzB,KAAK,MAAM;YACP,OAAO,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;QAC7B,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK;YACN,OAAO,QAAQ,CAAC;KACvB;AACL,CAAC"}

+ 5 - 0
async-demo/node_modules/cheerio-select/lib/helpers.d.ts

@@ -0,0 +1,5 @@
+import type { AnyNode } from "domhandler";
+import type { Selector } from "css-what";
+export declare function getDocumentRoot(node: AnyNode): AnyNode;
+export declare function groupSelectors(selectors: Selector[][]): [plain: Selector[][], filtered: Selector[][]];
+//# sourceMappingURL=helpers.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/helpers.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"helpers.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAGtD;AAED,wBAAgB,cAAc,CAC1B,SAAS,EAAE,QAAQ,EAAE,EAAE,GACxB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAa/C"}

+ 26 - 0
async-demo/node_modules/cheerio-select/lib/helpers.js

@@ -0,0 +1,26 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.groupSelectors = exports.getDocumentRoot = void 0;
+var positionals_js_1 = require("./positionals.js");
+function getDocumentRoot(node) {
+    while (node.parent)
+        node = node.parent;
+    return node;
+}
+exports.getDocumentRoot = getDocumentRoot;
+function groupSelectors(selectors) {
+    var filteredSelectors = [];
+    var plainSelectors = [];
+    for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) {
+        var selector = selectors_1[_i];
+        if (selector.some(positionals_js_1.isFilter)) {
+            filteredSelectors.push(selector);
+        }
+        else {
+            plainSelectors.push(selector);
+        }
+    }
+    return [plainSelectors, filteredSelectors];
+}
+exports.groupSelectors = groupSelectors;
+//# sourceMappingURL=helpers.js.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/helpers.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"helpers.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["helpers.ts"],"names":[],"mappings":";;;AAEA,mDAA4C;AAE5C,SAAgB,eAAe,CAAC,IAAa;IACzC,OAAO,IAAI,CAAC,MAAM;QAAE,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACvC,OAAO,IAAI,CAAC;AAChB,CAAC;AAHD,0CAGC;AAED,SAAgB,cAAc,CAC1B,SAAuB;IAEvB,IAAM,iBAAiB,GAAiB,EAAE,CAAC;IAC3C,IAAM,cAAc,GAAiB,EAAE,CAAC;IAExC,KAAuB,UAAS,EAAT,uBAAS,EAAT,uBAAS,EAAT,IAAS,EAAE;QAA7B,IAAM,QAAQ,kBAAA;QACf,IAAI,QAAQ,CAAC,IAAI,CAAC,yBAAQ,CAAC,EAAE;YACzB,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACpC;aAAM;YACH,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACjC;KACJ;IAED,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAC/C,CAAC;AAfD,wCAeC"}

+ 12 - 0
async-demo/node_modules/cheerio-select/lib/index.d.ts

@@ -0,0 +1,12 @@
+import { type Options as CSSSelectOptions } from "css-select";
+import type { Element, AnyNode, Document } from "domhandler";
+export { filters, pseudos, aliases } from "css-select";
+export interface Options extends CSSSelectOptions<AnyNode, Element> {
+    /** Optional reference to the root of the document. If not set, this will be computed when needed. */
+    root?: Document;
+}
+export declare function is(element: Element, selector: string | ((el: Element) => boolean), options?: Options): boolean;
+export declare function some(elements: Element[], selector: string | ((el: Element) => boolean), options?: Options): boolean;
+export declare function filter(selector: string, elements: AnyNode[], options?: Options): Element[];
+export declare function select(selector: string | ((el: Element) => boolean), root: AnyNode | AnyNode[], options?: Options, limit?: number): Element[];
+//# sourceMappingURL=index.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/index.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,OAAO,IAAI,gBAAgB,EAEnC,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAU7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAYvD,MAAM,WAAW,OAAQ,SAAQ,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC;IAC/D,qGAAqG;IACrG,IAAI,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,wBAAgB,EAAE,CACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,OAAO,GAAE,OAAY,GACtB,OAAO,CAET;AAED,wBAAgB,IAAI,CAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,OAAO,GAAE,OAAY,GACtB,OAAO,CAWT;AAsCD,wBAAgB,MAAM,CAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,GAAE,OAAY,GACtB,OAAO,EAAE,CAEX;AAoGD,wBAAgB,MAAM,CAClB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAC7C,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,EACzB,OAAO,GAAE,OAAY,EACrB,KAAK,SAAW,GACjB,OAAO,EAAE,CA2BX"}

+ 302 - 0
async-demo/node_modules/cheerio-select/lib/index.js

@@ -0,0 +1,302 @@
+"use strict";
+var __assign = (this && this.__assign) || function () {
+    __assign = Object.assign || function(t) {
+        for (var s, i = 1, n = arguments.length; i < n; i++) {
+            s = arguments[i];
+            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
+                t[p] = s[p];
+        }
+        return t;
+    };
+    return __assign.apply(this, arguments);
+};
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
+    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
+        if (ar || !(i in from)) {
+            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
+            ar[i] = from[i];
+        }
+    }
+    return to.concat(ar || Array.prototype.slice.call(from));
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.select = exports.filter = exports.some = exports.is = exports.aliases = exports.pseudos = exports.filters = void 0;
+var css_what_1 = require("css-what");
+var css_select_1 = require("css-select");
+var DomUtils = __importStar(require("domutils"));
+var boolbase = __importStar(require("boolbase"));
+var helpers_js_1 = require("./helpers.js");
+var positionals_js_1 = require("./positionals.js");
+// Re-export pseudo extension points
+var css_select_2 = require("css-select");
+Object.defineProperty(exports, "filters", { enumerable: true, get: function () { return css_select_2.filters; } });
+Object.defineProperty(exports, "pseudos", { enumerable: true, get: function () { return css_select_2.pseudos; } });
+Object.defineProperty(exports, "aliases", { enumerable: true, get: function () { return css_select_2.aliases; } });
+var UNIVERSAL_SELECTOR = {
+    type: css_what_1.SelectorType.Universal,
+    namespace: null,
+};
+var SCOPE_PSEUDO = {
+    type: css_what_1.SelectorType.Pseudo,
+    name: "scope",
+    data: null,
+};
+function is(element, selector, options) {
+    if (options === void 0) { options = {}; }
+    return some([element], selector, options);
+}
+exports.is = is;
+function some(elements, selector, options) {
+    if (options === void 0) { options = {}; }
+    if (typeof selector === "function")
+        return elements.some(selector);
+    var _a = (0, helpers_js_1.groupSelectors)((0, css_what_1.parse)(selector)), plain = _a[0], filtered = _a[1];
+    return ((plain.length > 0 && elements.some((0, css_select_1._compileToken)(plain, options))) ||
+        filtered.some(function (sel) { return filterBySelector(sel, elements, options).length > 0; }));
+}
+exports.some = some;
+function filterByPosition(filter, elems, data, options) {
+    var num = typeof data === "string" ? parseInt(data, 10) : NaN;
+    switch (filter) {
+        case "first":
+        case "lt":
+            // Already done in `getLimit`
+            return elems;
+        case "last":
+            return elems.length > 0 ? [elems[elems.length - 1]] : elems;
+        case "nth":
+        case "eq":
+            return isFinite(num) && Math.abs(num) < elems.length
+                ? [num < 0 ? elems[elems.length + num] : elems[num]]
+                : [];
+        case "gt":
+            return isFinite(num) ? elems.slice(num + 1) : [];
+        case "even":
+            return elems.filter(function (_, i) { return i % 2 === 0; });
+        case "odd":
+            return elems.filter(function (_, i) { return i % 2 === 1; });
+        case "not": {
+            var filtered_1 = new Set(filterParsed(data, elems, options));
+            return elems.filter(function (e) { return !filtered_1.has(e); });
+        }
+    }
+}
+function filter(selector, elements, options) {
+    if (options === void 0) { options = {}; }
+    return filterParsed((0, css_what_1.parse)(selector), elements, options);
+}
+exports.filter = filter;
+/**
+ * Filter a set of elements by a selector.
+ *
+ * Will return elements in the original order.
+ *
+ * @param selector Selector to filter by.
+ * @param elements Elements to filter.
+ * @param options Options for selector.
+ */
+function filterParsed(selector, elements, options) {
+    if (elements.length === 0)
+        return [];
+    var _a = (0, helpers_js_1.groupSelectors)(selector), plainSelectors = _a[0], filteredSelectors = _a[1];
+    var found;
+    if (plainSelectors.length) {
+        var filtered = filterElements(elements, plainSelectors, options);
+        // If there are no filters, just return
+        if (filteredSelectors.length === 0) {
+            return filtered;
+        }
+        // Otherwise, we have to do some filtering
+        if (filtered.length) {
+            found = new Set(filtered);
+        }
+    }
+    for (var i = 0; i < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i++) {
+        var filteredSelector = filteredSelectors[i];
+        var missing = found
+            ? elements.filter(function (e) { return DomUtils.isTag(e) && !found.has(e); })
+            : elements;
+        if (missing.length === 0)
+            break;
+        var filtered = filterBySelector(filteredSelector, elements, options);
+        if (filtered.length) {
+            if (!found) {
+                /*
+                 * If we haven't found anything before the last selector,
+                 * just return what we found now.
+                 */
+                if (i === filteredSelectors.length - 1) {
+                    return filtered;
+                }
+                found = new Set(filtered);
+            }
+            else {
+                filtered.forEach(function (el) { return found.add(el); });
+            }
+        }
+    }
+    return typeof found !== "undefined"
+        ? (found.size === elements.length
+            ? elements
+            : // Filter elements to preserve order
+                elements.filter(function (el) {
+                    return found.has(el);
+                }))
+        : [];
+}
+function filterBySelector(selector, elements, options) {
+    var _a;
+    if (selector.some(css_what_1.isTraversal)) {
+        /*
+         * Get root node, run selector with the scope
+         * set to all of our nodes.
+         */
+        var root = (_a = options.root) !== null && _a !== void 0 ? _a : (0, helpers_js_1.getDocumentRoot)(elements[0]);
+        var opts = __assign(__assign({}, options), { context: elements, relativeSelector: false });
+        selector.push(SCOPE_PSEUDO);
+        return findFilterElements(root, selector, opts, true, elements.length);
+    }
+    // Performance optimization: If we don't have to traverse, just filter set.
+    return findFilterElements(elements, selector, options, false, elements.length);
+}
+function select(selector, root, options, limit) {
+    if (options === void 0) { options = {}; }
+    if (limit === void 0) { limit = Infinity; }
+    if (typeof selector === "function") {
+        return find(root, selector);
+    }
+    var _a = (0, helpers_js_1.groupSelectors)((0, css_what_1.parse)(selector)), plain = _a[0], filtered = _a[1];
+    var results = filtered.map(function (sel) {
+        return findFilterElements(root, sel, options, true, limit);
+    });
+    // Plain selectors can be queried in a single go
+    if (plain.length) {
+        results.push(findElements(root, plain, options, limit));
+    }
+    if (results.length === 0) {
+        return [];
+    }
+    // If there was only a single selector, just return the result
+    if (results.length === 1) {
+        return results[0];
+    }
+    // Sort results, filtering for duplicates
+    return DomUtils.uniqueSort(results.reduce(function (a, b) { return __spreadArray(__spreadArray([], a, true), b, true); }));
+}
+exports.select = select;
+/**
+ *
+ * @param root Element(s) to search from.
+ * @param selector Selector to look for.
+ * @param options Options for querying.
+ * @param queryForSelector Query multiple levels deep for the initial selector, even if it doesn't contain a traversal.
+ */
+function findFilterElements(root, selector, options, queryForSelector, totalLimit) {
+    var filterIndex = selector.findIndex(positionals_js_1.isFilter);
+    var sub = selector.slice(0, filterIndex);
+    var filter = selector[filterIndex];
+    // If we are at the end of the selector, we can limit the number of elements to retrieve.
+    var partLimit = selector.length - 1 === filterIndex ? totalLimit : Infinity;
+    /*
+     * Set the number of elements to retrieve.
+     * Eg. for :first, we only have to get a single element.
+     */
+    var limit = (0, positionals_js_1.getLimit)(filter.name, filter.data, partLimit);
+    if (limit === 0)
+        return [];
+    /*
+     * Skip `findElements` call if our selector starts with a positional
+     * pseudo.
+     */
+    var elemsNoLimit = sub.length === 0 && !Array.isArray(root)
+        ? DomUtils.getChildren(root).filter(DomUtils.isTag)
+        : sub.length === 0
+            ? (Array.isArray(root) ? root : [root]).filter(DomUtils.isTag)
+            : queryForSelector || sub.some(css_what_1.isTraversal)
+                ? findElements(root, [sub], options, limit)
+                : filterElements(root, [sub], options);
+    var elems = elemsNoLimit.slice(0, limit);
+    var result = filterByPosition(filter.name, elems, filter.data, options);
+    if (result.length === 0 || selector.length === filterIndex + 1) {
+        return result;
+    }
+    var remainingSelector = selector.slice(filterIndex + 1);
+    var remainingHasTraversal = remainingSelector.some(css_what_1.isTraversal);
+    if (remainingHasTraversal) {
+        if ((0, css_what_1.isTraversal)(remainingSelector[0])) {
+            var type = remainingSelector[0].type;
+            if (type === css_what_1.SelectorType.Sibling ||
+                type === css_what_1.SelectorType.Adjacent) {
+                // If we have a sibling traversal, we need to also look at the siblings.
+                result = (0, css_select_1.prepareContext)(result, DomUtils, true);
+            }
+            // Avoid a traversal-first selector error.
+            remainingSelector.unshift(UNIVERSAL_SELECTOR);
+        }
+        options = __assign(__assign({}, options), { 
+            // Avoid absolutizing the selector
+            relativeSelector: false, 
+            /*
+             * Add a custom root func, to make sure traversals don't match elements
+             * that aren't a part of the considered tree.
+             */
+            rootFunc: function (el) { return result.includes(el); } });
+    }
+    else if (options.rootFunc && options.rootFunc !== boolbase.trueFunc) {
+        options = __assign(__assign({}, options), { rootFunc: boolbase.trueFunc });
+    }
+    /*
+     * If we have another filter, recursively call `findFilterElements`,
+     * with the `recursive` flag disabled. We only have to look for more
+     * elements when we see a traversal.
+     *
+     * Otherwise,
+     */
+    return remainingSelector.some(positionals_js_1.isFilter)
+        ? findFilterElements(result, remainingSelector, options, false, totalLimit)
+        : remainingHasTraversal
+            ? // Query existing elements to resolve traversal.
+                findElements(result, [remainingSelector], options, totalLimit)
+            : // If we don't have any more traversals, simply filter elements.
+                filterElements(result, [remainingSelector], options);
+}
+function findElements(root, sel, options, limit) {
+    var query = (0, css_select_1._compileToken)(sel, options, root);
+    return find(root, query, limit);
+}
+function find(root, query, limit) {
+    if (limit === void 0) { limit = Infinity; }
+    var elems = (0, css_select_1.prepareContext)(root, DomUtils, query.shouldTestNextSiblings);
+    return DomUtils.find(function (node) { return DomUtils.isTag(node) && query(node); }, elems, true, limit);
+}
+function filterElements(elements, sel, options) {
+    var els = (Array.isArray(elements) ? elements : [elements]).filter(DomUtils.isTag);
+    if (els.length === 0)
+        return els;
+    var query = (0, css_select_1._compileToken)(sel, options);
+    return query === boolbase.trueFunc ? els : els.filter(query);
+}
+//# sourceMappingURL=index.js.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio-select/lib/index.js.map


+ 10 - 0
async-demo/node_modules/cheerio-select/lib/positionals.d.ts

@@ -0,0 +1,10 @@
+import type { Selector, PseudoSelector } from "css-what";
+export declare type Filter = "first" | "last" | "eq" | "nth" | "gt" | "lt" | "even" | "odd" | "not";
+export declare const filterNames: Set<string>;
+export interface CheerioSelector extends PseudoSelector {
+    name: Filter;
+    data: string | null;
+}
+export declare function isFilter(s: Selector): s is CheerioSelector;
+export declare function getLimit(filter: Filter, data: string | null, partLimit: number): number;
+//# sourceMappingURL=positionals.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/positionals.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"positionals.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["positionals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzD,oBAAY,MAAM,GACZ,OAAO,GACP,MAAM,GACN,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,KAAK,GACL,KAAK,CAAC;AACZ,eAAO,MAAM,WAAW,EAAE,GAAG,CAAC,MAAM,CASlC,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,IAAI,eAAe,CAS1D;AAED,wBAAgB,QAAQ,CACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,SAAS,EAAE,MAAM,GAClB,MAAM,CAyBR"}

+ 52 - 0
async-demo/node_modules/cheerio-select/lib/positionals.js

@@ -0,0 +1,52 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getLimit = exports.isFilter = exports.filterNames = void 0;
+exports.filterNames = new Set([
+    "first",
+    "last",
+    "eq",
+    "gt",
+    "nth",
+    "lt",
+    "even",
+    "odd",
+]);
+function isFilter(s) {
+    if (s.type !== "pseudo")
+        return false;
+    if (exports.filterNames.has(s.name))
+        return true;
+    if (s.name === "not" && Array.isArray(s.data)) {
+        // Only consider `:not` with embedded filters
+        return s.data.some(function (s) { return s.some(isFilter); });
+    }
+    return false;
+}
+exports.isFilter = isFilter;
+function getLimit(filter, data, partLimit) {
+    var num = data != null ? parseInt(data, 10) : NaN;
+    switch (filter) {
+        case "first":
+            return 1;
+        case "nth":
+        case "eq":
+            return isFinite(num) ? (num >= 0 ? num + 1 : Infinity) : 0;
+        case "lt":
+            return isFinite(num)
+                ? num >= 0
+                    ? Math.min(num, partLimit)
+                    : Infinity
+                : 0;
+        case "gt":
+            return isFinite(num) ? Infinity : 0;
+        case "odd":
+            return 2 * partLimit;
+        case "even":
+            return 2 * partLimit - 1;
+        case "last":
+        case "not":
+            return Infinity;
+    }
+}
+exports.getLimit = getLimit;
+//# sourceMappingURL=positionals.js.map

+ 1 - 0
async-demo/node_modules/cheerio-select/lib/positionals.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"positionals.js","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio-select/ef063a6ca4c3f0d02d2fc3505e750b6fb81c448d/src/","sources":["positionals.ts"],"names":[],"mappings":";;;AAYa,QAAA,WAAW,GAAgB,IAAI,GAAG,CAAS;IACpD,OAAO;IACP,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,MAAM;IACN,KAAK;CACR,CAAC,CAAC;AAOH,SAAgB,QAAQ,CAAC,CAAW;IAChC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,mBAAW,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;QAC3C,6CAA6C;QAC7C,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAhB,CAAgB,CAAC,CAAC;KAC/C;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AATD,4BASC;AAED,SAAgB,QAAQ,CACpB,MAAc,EACd,IAAmB,EACnB,SAAiB;IAEjB,IAAM,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAEpD,QAAQ,MAAM,EAAE;QACZ,KAAK,OAAO;YACR,OAAO,CAAC,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC;gBAChB,CAAC,CAAC,GAAG,IAAI,CAAC;oBACN,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;oBAC1B,CAAC,CAAC,QAAQ;gBACd,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,IAAI;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,KAAK,KAAK;YACN,OAAO,CAAC,GAAG,SAAS,CAAC;QACzB,KAAK,MAAM;YACP,OAAO,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;QAC7B,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK;YACN,OAAO,QAAQ,CAAC;KACvB;AACL,CAAC;AA7BD,4BA6BC"}

+ 76 - 0
async-demo/node_modules/cheerio-select/package.json

@@ -0,0 +1,76 @@
+{
+    "name": "cheerio-select",
+    "description": "CSS selector engine supporting jQuery selectors",
+    "version": "2.1.0",
+    "author": "Felix Boehm <me@feedic.com>",
+    "funding": {
+        "url": "https://github.com/sponsors/fb55"
+    },
+    "license": "BSD-2-Clause",
+    "sideEffects": false,
+    "repository": {
+        "type": "git",
+        "url": "git://github.com/cheeriojs/cheerio-select.git"
+    },
+    "directories": {
+        "lib": "lib/"
+    },
+    "main": "lib/index.js",
+    "types": "lib/index.d.ts",
+    "module": "lib/esm/index.js",
+    "exports": {
+        "require": "./lib/index.js",
+        "import": "./lib/esm/index.js"
+    },
+    "files": [
+        "lib/**/*"
+    ],
+    "scripts": {
+        "test": "npm run test:jest && npm run lint",
+        "test:jest": "jest",
+        "lint": "npm run lint:es && npm run lint:prettier",
+        "lint:es": "eslint src",
+        "lint:prettier": "npm run format:prettier:raw -- --check",
+        "format": "npm run format:es && npm run format:prettier",
+        "format:es": "npm run lint:es -- --fix",
+        "format:prettier": "npm run format:prettier:raw -- --write",
+        "format:prettier:raw": "prettier '**/*.{ts,md,json,yml}'",
+        "build": "npm run build:cjs && npm run build:esm",
+        "build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/cheeriojs/cheerio-select/$(git rev-parse HEAD)/src/",
+        "build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
+        "prepare": "npm run build"
+    },
+    "dependencies": {
+        "boolbase": "^1.0.0",
+        "css-select": "^5.1.0",
+        "css-what": "^6.1.0",
+        "domelementtype": "^2.3.0",
+        "domhandler": "^5.0.3",
+        "domutils": "^3.0.1"
+    },
+    "devDependencies": {
+        "@types/boolbase": "^1.0.1",
+        "@types/jest": "^27.5.0",
+        "@types/node": "^17.0.33",
+        "@typescript-eslint/eslint-plugin": "^5.23.0",
+        "@typescript-eslint/parser": "^5.23.0",
+        "eslint": "^8.15.0",
+        "eslint-config-prettier": "^8.5.0",
+        "htmlparser2": "^8.0.1",
+        "jest": "^27.5.1",
+        "prettier": "^2.6.2",
+        "ts-jest": "^27.1.4",
+        "typescript": "^4.6.4"
+    },
+    "jest": {
+        "preset": "ts-jest",
+        "testEnvironment": "node",
+        "coverageProvider": "v8",
+        "moduleNameMapper": {
+            "^(.*)\\.js$": "$1"
+        }
+    },
+    "prettier": {
+        "tabWidth": 4
+    }
+}

+ 21 - 0
async-demo/node_modules/cheerio/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 The Cheerio contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 247 - 0
async-demo/node_modules/cheerio/Readme.md

@@ -0,0 +1,247 @@
+<h1 align="center">cheerio</h1>
+
+<h5 align="center">The fast, flexible, and elegant library for parsing and manipulating HTML and XML.</h5>
+
+<div align="center">
+  <a href="https://github.com/cheeriojs/cheerio/actions/workflows/ci.yml">
+    <img src="https://github.com/cheeriojs/cheerio/actions/workflows/ci.yml/badge.svg" alt="Build Status">
+  </a>
+  <a href="https://coveralls.io/github/cheeriojs/cheerio">
+    <img src="https://img.shields.io/coveralls/github/cheeriojs/cheerio/main" alt="Coverage">
+  </a>
+  <a href="#backers">
+    <img src="https://img.shields.io/opencollective/backers/cheerio" alt="OpenCollective backers">
+  </a>
+  <a href="#sponsors">
+    <img src="https://img.shields.io/opencollective/sponsors/cheerio" alt="OpenCollective sponsors">
+  </a>
+</div>
+
+<br>
+
+[中文文档 (Chinese Readme)](https://github.com/cheeriojs/cheerio/wiki/Chinese-README)
+
+```js
+import * as cheerio from 'cheerio';
+const $ = cheerio.load('<h2 class="title">Hello world</h2>');
+
+$('h2.title').text('Hello there!');
+$('h2').addClass('welcome');
+
+$.html();
+//=> <html><head></head><body><h2 class="title welcome">Hello there!</h2></body></html>
+```
+
+## Installation
+
+`npm install cheerio`
+
+## Features
+
+**&#10084; Proven syntax:** Cheerio implements a subset of core jQuery. Cheerio
+removes all the DOM inconsistencies and browser cruft from the jQuery library,
+revealing its truly gorgeous API.
+
+**&#991; Blazingly fast:** Cheerio works with a very simple, consistent DOM
+model. As a result parsing, manipulating, and rendering are incredibly
+efficient.
+
+**&#10049; Incredibly flexible:** Cheerio wraps around
+[parse5](https://github.com/inikulin/parse5) for parsing HTML and can optionally
+use the forgiving [htmlparser2](https://github.com/fb55/htmlparser2/). Cheerio
+can parse nearly any HTML or XML document. Cheerio works in both browser and
+server environments.
+
+## API
+
+### Loading
+
+First you need to load in the HTML. This step in jQuery is implicit, since
+jQuery operates on the one, baked-in DOM. With Cheerio, we need to pass in the
+HTML document.
+
+```js
+// ESM or TypeScript:
+import * as cheerio from 'cheerio';
+
+// In other environments:
+const cheerio = require('cheerio');
+
+const $ = cheerio.load('<ul id="fruits">...</ul>');
+
+$.html();
+//=> <html><head></head><body><ul id="fruits">...</ul></body></html>
+```
+
+### Selectors
+
+Once you've loaded the HTML, you can use jQuery-style selectors to find elements
+within the document.
+
+#### \$( selector, [context], [root] )
+
+`selector` searches within the `context` scope which searches within the `root`
+scope. `selector` and `context` can be a string expression, DOM Element, array
+of DOM elements, or cheerio object. `root`, if provided, is typically the HTML
+document string.
+
+This selector method is the starting point for traversing and manipulating the
+document. Like in jQuery, it's the primary method for selecting elements in the
+document.
+
+```js
+$('.apple', '#fruits').text();
+//=> Apple
+
+$('ul .pear').attr('class');
+//=> pear
+
+$('li[class=orange]').html();
+//=> Orange
+```
+
+### Rendering
+
+When you're ready to render the document, you can call the `html` method on the
+"root" selection:
+
+```js
+$.root().html();
+//=>  <html>
+//      <head></head>
+//      <body>
+//        <ul id="fruits">
+//          <li class="apple">Apple</li>
+//          <li class="orange">Orange</li>
+//          <li class="pear">Pear</li>
+//        </ul>
+//      </body>
+//    </html>
+```
+
+If you want to render the
+[`outerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML)
+of a selection, you can use the `outerHTML` prop:
+
+```js
+$('.pear').prop('outerHTML');
+//=> <li class="pear">Pear</li>
+```
+
+You may also render the text content of a Cheerio object using the `text`
+method:
+
+```js
+const $ = cheerio.load('This is <em>content</em>.');
+$('body').text();
+//=> This is content.
+```
+
+### The "DOM Node" object
+
+Cheerio collections are made up of objects that bear some resemblance to
+[browser-based DOM nodes](https://developer.mozilla.org/en-US/docs/Web/API/Node).
+You can expect them to define the following properties:
+
+- `tagName`
+- `parentNode`
+- `previousSibling`
+- `nextSibling`
+- `nodeValue`
+- `firstChild`
+- `childNodes`
+- `lastChild`
+
+## Screencasts
+
+[https://vimeo.com/31950192](https://vimeo.com/31950192)
+
+> This video tutorial is a follow-up to Nettut's "How to Scrape Web Pages with
+> Node.js and jQuery", using cheerio instead of JSDOM + jQuery. This video shows
+> how easy it is to use cheerio and how much faster cheerio is than JSDOM +
+> jQuery.
+
+## Cheerio in the real world
+
+Are you using cheerio in production? Add it to the
+[wiki](https://github.com/cheeriojs/cheerio/wiki/Cheerio-in-Production)!
+
+## Sponsors
+
+Does your company use Cheerio in production? Please consider
+[sponsoring this project](https://github.com/cheeriojs/cheerio?sponsor=1)! Your
+help will allow maintainers to dedicate more time and resources to its
+development and support.
+
+**Headlining Sponsors**
+
+<!-- BEGIN SPONSORS: headliner -->
+
+<a href="https://tidelift.com/subscription/pkg/npm-cheerio" target="_blank" rel="noopener noreferrer">
+            <img height="128px" width="128px" src="https://humble.imgix.net/https%3A%2F%2Fgithub.com%2Ftidelift.png?ixlib=js-3.8.0&w=128&h=128&fit=fillmax&fill=solid&s=0713e6ee5c7ab01e7559df695c1e8cd9" title="Tidelift" alt="Tidelift"></img>
+          </a>
+<a href="https://github.com/" target="_blank" rel="noopener noreferrer">
+            <img height="128px" width="128px" src="https://humble.imgix.net/https%3A%2F%2Fgithub.com%2Fgithub.png?ixlib=js-3.8.0&w=128&h=128&fit=fillmax&fill=solid&s=a1e87ca289de84eb32ea85432cf8ad11" title="Github" alt="Github"></img>
+          </a>
+<a href="https://www.airbnb.com/" target="_blank" rel="noopener noreferrer">
+            <img height="128px" width="128px" src="https://humble.imgix.net/https%3A%2F%2Fgithub.com%2Fairbnb.png?ixlib=js-3.8.0&w=128&h=128&fit=fillmax&fill=solid&s=384cad45e10faea516202ad10801f895" title="AirBnB" alt="AirBnB"></img>
+          </a>
+
+<!-- END SPONSORS -->
+
+**Other Sponsors**
+
+<!-- BEGIN SPONSORS: sponsor -->
+
+<a href="https://www.casinoonlineaams.com" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fcasinoonlineaamscom%2Fc59b0fd%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=7b90355c5df11c3ac489869b01279fee" title="Casinoonlineaams.com" alt="Casinoonlineaams.com"></img>
+          </a>
+<a href="https://casinoutansvensklicens.co/" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fcasino-utan-svensk-licens3%2Ff7e9357%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=45ea355f0c3411592219714943df29dd" title="Casino utan svensk licens" alt="Casino utan svensk licens"></img>
+          </a>
+<a href="https://www.zenrows.com" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fzenrows%2F3199d4b%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=8a51972a1004283672506d2e3aedd25b" title="ZenRows" alt="ZenRows"></img>
+          </a>
+<a href="https://slotoking.ua/games/all-slots/" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Figrovye-avtomaty-ua%2F96bfde3%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=07091c88a0b859ecaa81ef10fadf3075" title="Ігрові автомати" alt="Ігрові автомати"></img>
+          </a>
+<a href="https://onlinecasinosspelen.com" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fonlinecasinosspelen%2F4ce3830%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=60e5dd9f3993a754d0e5d47a43ff7462" title="OnlineCasinosSpelen" alt="OnlineCasinosSpelen"></img>
+          </a>
+<a href="https://casinoZonderregistratie.net/" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fczrnet%2F24e6252%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=d9b81b3c39bca4d3a8f279e79c5eec8d" title="CasinoZonderRegistratie.net" alt="CasinoZonderRegistratie.net"></img>
+          </a>
+<a href="https://Nieuwe-Casinos.net" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fnieuwecasinos%2Fee150d6%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=c2663f8b5dcfc983ef5641028d7b430b" title="Nieuwe-Casinos.net" alt="Nieuwe-Casinos.net"></img>
+          </a>
+<a href="https://vedonlyontiyhtiot.com/" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fvedonlyontiyhtiot-com%2Favatar.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=9983cbab4b2e4b4f715c31acaa27bea6" title="Vedonlyontiyhtiot.com" alt="Vedonlyontiyhtiot.com"></img>
+          </a>
+<a href="https://puter.com/" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fputer%2Ff8643c4%2Favatar.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=533e28124d885c9d8b261e464db029c5" title="Puter.com" alt="Puter.com"></img>
+          </a>
+<a href="https://www.nodepositcasinobonus.org/" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fno-deposit-bonus%2F912e261%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=ce708f21996657eef8c5207fb84312b5" title="No Deposit Bonus" alt="No Deposit Bonus"></img>
+          </a>
+
+<!-- END SPONSORS -->
+
+## Backers
+
+[Become a backer](https://github.com/cheeriojs/cheerio?sponsor=1) to show your
+support for Cheerio and help us maintain and improve this open source project.
+
+<!-- BEGIN SPONSORS: backer -->
+
+<a href="https://kafidoff.com" target="_blank" rel="noopener noreferrer">
+            <img height="64px" width="64px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fkafidoff-vasy%2Fd7ff85c%2Favatar.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=a41c66c2f9b1d3a7a241e425e7aa2d09" title="Vasy Kafidoff" alt="Vasy Kafidoff"></img>
+          </a>
+<a href="https://medium.com/norch" target="_blank" rel="noopener noreferrer">
+            <img height="48px" width="48px" src="https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fespenklem%2F7e8cd40%2Favatar.png?ixlib=js-3.8.0&w=48&h=48&fit=fillmax&fill=solid&s=f727bc0f59d1738188ec8e4499123149" title="Espen Klem" alt="Espen Klem"></img>
+          </a>
+
+<!-- END SPONSORS -->
+
+## License
+
+MIT

+ 385 - 0
async-demo/node_modules/cheerio/dist/browser/api/attributes.d.ts

@@ -0,0 +1,385 @@
+/**
+ * Methods for getting and modifying attributes.
+ *
+ * @module cheerio/attributes
+ */
+import { type AnyNode, type Element } from 'domhandler';
+import type { Cheerio } from '../cheerio.js';
+/**
+ * Method for getting attributes. Gets the attribute value for only the first
+ * element in the matched set.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('ul').attr('id');
+ * //=> fruits
+ * ```
+ *
+ * @param name - Name of the attribute.
+ * @returns The attribute's value.
+ * @see {@link https://api.jquery.com/attr/}
+ */
+export declare function attr<T extends AnyNode>(this: Cheerio<T>, name: string): string | undefined;
+/**
+ * Method for getting all attributes and their values of the first element in
+ * the matched set.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('ul').attr();
+ * //=> { id: 'fruits' }
+ * ```
+ *
+ * @returns The attribute's values.
+ * @see {@link https://api.jquery.com/attr/}
+ */
+export declare function attr<T extends AnyNode>(this: Cheerio<T>): Record<string, string> | undefined;
+/**
+ * Method for setting attributes. Sets the attribute value for only the first
+ * element in the matched set. If you set an attribute's value to `null`, you
+ * remove that attribute. You may also pass a `map` and `function`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.apple').attr('id', 'favorite').html();
+ * //=> <li class="apple" id="favorite">Apple</li>
+ * ```
+ *
+ * @param name - Name of the attribute.
+ * @param value - The new value of the attribute.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/attr/}
+ */
+export declare function attr<T extends AnyNode>(this: Cheerio<T>, name: string, value?: string | null | ((this: Element, i: number, attrib: string) => string | null)): Cheerio<T>;
+/**
+ * Method for setting multiple attributes at once. Sets the attribute value for
+ * only the first element in the matched set. If you set an attribute's value to
+ * `null`, you remove that attribute.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.apple').attr({ id: 'favorite' }).html();
+ * //=> <li class="apple" id="favorite">Apple</li>
+ * ```
+ *
+ * @param values - Map of attribute names and values.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/attr/}
+ */
+export declare function attr<T extends AnyNode>(this: Cheerio<T>, values: Record<string, string | null>): Cheerio<T>;
+interface StyleProp {
+    length: number;
+    [key: string]: string | number;
+    [index: number]: string;
+}
+/**
+ * Method for getting and setting properties. Gets the property value for only
+ * the first element in the matched set.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('input[type="checkbox"]').prop('checked');
+ * //=> false
+ *
+ * $('input[type="checkbox"]').prop('checked', true).val();
+ * //=> ok
+ * ```
+ *
+ * @param name - Name of the property.
+ * @returns If `value` is specified the instance itself, otherwise the prop's
+ *   value.
+ * @see {@link https://api.jquery.com/prop/}
+ */
+export declare function prop<T extends AnyNode>(this: Cheerio<T>, name: 'tagName' | 'nodeName'): string | undefined;
+export declare function prop<T extends AnyNode>(this: Cheerio<T>, name: 'innerHTML' | 'outerHTML' | 'innerText' | 'textContent'): string | null;
+/**
+ * Get a parsed CSS style object.
+ *
+ * @param name - Name of the property.
+ * @returns The style object, or `undefined` if the element has no `style`
+ *   attribute.
+ */
+export declare function prop<T extends AnyNode>(this: Cheerio<T>, name: 'style'): StyleProp | undefined;
+/**
+ * Resolve `href` or `src` of supported elements. Requires the `baseURI` option
+ * to be set, and a global `URL` object to be part of the environment.
+ *
+ * @example With `baseURI` set to `'https://example.com'`:
+ *
+ * ```js
+ * $('<img src="image.png">').prop('src');
+ * //=> 'https://example.com/image.png'
+ * ```
+ *
+ * @param name - Name of the property.
+ * @returns The resolved URL, or `undefined` if the element is not supported.
+ */
+export declare function prop<T extends AnyNode>(this: Cheerio<T>, name: 'href' | 'src'): string | undefined;
+/**
+ * Get a property of an element.
+ *
+ * @param name - Name of the property.
+ * @returns The property's value.
+ */
+export declare function prop<T extends AnyNode, K extends keyof Element>(this: Cheerio<T>, name: K): Element[K];
+/**
+ * Set a property of an element.
+ *
+ * @param name - Name of the property.
+ * @param value - Value to set the property to.
+ * @returns The instance itself.
+ */
+export declare function prop<T extends AnyNode, K extends keyof Element>(this: Cheerio<T>, name: K, value: Element[K] | ((this: Element, i: number, prop: K) => Element[keyof Element])): Cheerio<T>;
+/**
+ * Set multiple properties of an element.
+ *
+ * @example
+ *
+ * ```js
+ * $('input[type="checkbox"]').prop({
+ *   checked: true,
+ *   disabled: false,
+ * });
+ * ```
+ *
+ * @param map - Object of properties to set.
+ * @returns The instance itself.
+ */
+export declare function prop<T extends AnyNode>(this: Cheerio<T>, map: Record<string, string | Element[keyof Element] | boolean>): Cheerio<T>;
+/**
+ * Set a property of an element.
+ *
+ * @param name - Name of the property.
+ * @param value - Value to set the property to.
+ * @returns The instance itself.
+ */
+export declare function prop<T extends AnyNode>(this: Cheerio<T>, name: string, value: string | boolean | null | ((this: Element, i: number, prop: string) => string | boolean)): Cheerio<T>;
+/**
+ * Get a property of an element.
+ *
+ * @param name - The property's name.
+ * @returns The property's value.
+ */
+export declare function prop<T extends AnyNode>(this: Cheerio<T>, name: string): string;
+/**
+ * Method for getting data attributes, for only the first element in the matched
+ * set.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('<div data-apple-color="red"></div>').data('apple-color');
+ * //=> 'red'
+ * ```
+ *
+ * @param name - Name of the data attribute.
+ * @returns The data attribute's value, or `undefined` if the attribute does not
+ *   exist.
+ * @see {@link https://api.jquery.com/data/}
+ */
+export declare function data<T extends AnyNode>(this: Cheerio<T>, name: string): unknown | undefined;
+/**
+ * Method for getting all of an element's data attributes, for only the first
+ * element in the matched set.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('<div data-apple-color="red"></div>').data();
+ * //=> { appleColor: 'red' }
+ * ```
+ *
+ * @returns A map with all of the data attributes.
+ * @see {@link https://api.jquery.com/data/}
+ */
+export declare function data<T extends AnyNode>(this: Cheerio<T>): Record<string, unknown>;
+/**
+ * Method for setting data attributes, for only the first element in the matched
+ * set.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * const apple = $('.apple').data('kind', 'mac');
+ *
+ * apple.data('kind');
+ * //=> 'mac'
+ * ```
+ *
+ * @param name - Name of the data attribute.
+ * @param value - The new value.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/data/}
+ */
+export declare function data<T extends AnyNode>(this: Cheerio<T>, name: string, value: unknown): Cheerio<T>;
+/**
+ * Method for setting multiple data attributes at once, for only the first
+ * element in the matched set.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * const apple = $('.apple').data({ kind: 'mac' });
+ *
+ * apple.data('kind');
+ * //=> 'mac'
+ * ```
+ *
+ * @param values - Map of names to values.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/data/}
+ */
+export declare function data<T extends AnyNode>(this: Cheerio<T>, values: Record<string, unknown>): Cheerio<T>;
+/**
+ * Method for getting the value of input, select, and textarea. Note: Support
+ * for `map`, and `function` has not been added yet.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('input[type="text"]').val();
+ * //=> input_text
+ * ```
+ *
+ * @returns The value.
+ * @see {@link https://api.jquery.com/val/}
+ */
+export declare function val<T extends AnyNode>(this: Cheerio<T>): string | undefined | string[];
+/**
+ * Method for setting the value of input, select, and textarea. Note: Support
+ * for `map`, and `function` has not been added yet.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('input[type="text"]').val('test').html();
+ * //=> <input type="text" value="test"/>
+ * ```
+ *
+ * @param value - The new value.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/val/}
+ */
+export declare function val<T extends AnyNode>(this: Cheerio<T>, value: string | string[]): Cheerio<T>;
+/**
+ * Method for removing attributes by `name`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.pear').removeAttr('class').html();
+ * //=> <li>Pear</li>
+ *
+ * $('.apple').attr('id', 'favorite');
+ * $('.apple').removeAttr('id class').html();
+ * //=> <li>Apple</li>
+ * ```
+ *
+ * @param name - Name of the attribute.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/removeAttr/}
+ */
+export declare function removeAttr<T extends AnyNode>(this: Cheerio<T>, name: string): Cheerio<T>;
+/**
+ * Check to see if _any_ of the matched elements have the given `className`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.pear').hasClass('pear');
+ * //=> true
+ *
+ * $('apple').hasClass('fruit');
+ * //=> false
+ *
+ * $('li').hasClass('pear');
+ * //=> true
+ * ```
+ *
+ * @param className - Name of the class.
+ * @returns Indicates if an element has the given `className`.
+ * @see {@link https://api.jquery.com/hasClass/}
+ */
+export declare function hasClass<T extends AnyNode>(this: Cheerio<T>, className: string): boolean;
+/**
+ * Adds class(es) to all of the matched elements. Also accepts a `function`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.pear').addClass('fruit').html();
+ * //=> <li class="pear fruit">Pear</li>
+ *
+ * $('.apple').addClass('fruit red').html();
+ * //=> <li class="apple fruit red">Apple</li>
+ * ```
+ *
+ * @param value - Name of new class.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/addClass/}
+ */
+export declare function addClass<T extends AnyNode, R extends ArrayLike<T>>(this: R, value?: string | ((this: Element, i: number, className: string) => string | undefined)): R;
+/**
+ * Removes one or more space-separated classes from the selected elements. If no
+ * `className` is defined, all classes will be removed. Also accepts a
+ * `function`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.pear').removeClass('pear').html();
+ * //=> <li class="">Pear</li>
+ *
+ * $('.apple').addClass('red').removeClass().html();
+ * //=> <li class="">Apple</li>
+ * ```
+ *
+ * @param name - Name of the class. If not specified, removes all elements.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/removeClass/}
+ */
+export declare function removeClass<T extends AnyNode, R extends ArrayLike<T>>(this: R, name?: string | ((this: Element, i: number, className: string) => string | undefined)): R;
+/**
+ * Add or remove class(es) from the matched elements, depending on either the
+ * class's presence or the value of the switch argument. Also accepts a
+ * `function`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.apple.green').toggleClass('fruit green red').html();
+ * //=> <li class="apple fruit red">Apple</li>
+ *
+ * $('.apple.green').toggleClass('fruit green red', true).html();
+ * //=> <li class="apple green fruit red">Apple</li>
+ * ```
+ *
+ * @param value - Name of the class. Can also be a function.
+ * @param stateVal - If specified the state of the class.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/toggleClass/}
+ */
+export declare function toggleClass<T extends AnyNode, R extends ArrayLike<T>>(this: R, value?: string | ((this: Element, i: number, className: string, stateVal?: boolean) => string), stateVal?: boolean): R;
+export {};
+//# sourceMappingURL=attributes.d.ts.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/api/attributes.d.ts.map


+ 619 - 0
async-demo/node_modules/cheerio/dist/browser/api/attributes.js

@@ -0,0 +1,619 @@
+/**
+ * Methods for getting and modifying attributes.
+ *
+ * @module cheerio/attributes
+ */
+import { text } from '../static.js';
+import { domEach, camelCase, cssCase } from '../utils.js';
+import { isTag } from 'domhandler';
+import { innerText, textContent } from 'domutils';
+const hasOwn = Object.prototype.hasOwnProperty;
+const rspace = /\s+/;
+const dataAttrPrefix = 'data-';
+// Attributes that are booleans
+const rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;
+// Matches strings that look like JSON objects or arrays
+const rbrace = /^{[^]*}$|^\[[^]*]$/;
+function getAttr(elem, name, xmlMode) {
+    var _a;
+    if (!elem || !isTag(elem))
+        return undefined;
+    (_a = elem.attribs) !== null && _a !== void 0 ? _a : (elem.attribs = {});
+    // Return the entire attribs object if no attribute specified
+    if (!name) {
+        return elem.attribs;
+    }
+    if (hasOwn.call(elem.attribs, name)) {
+        // Get the (decoded) attribute
+        return !xmlMode && rboolean.test(name) ? name : elem.attribs[name];
+    }
+    // Mimic the DOM and return text content as value for `option's`
+    if (elem.name === 'option' && name === 'value') {
+        return text(elem.children);
+    }
+    // Mimic DOM with default value for radios/checkboxes
+    if (elem.name === 'input' &&
+        (elem.attribs['type'] === 'radio' || elem.attribs['type'] === 'checkbox') &&
+        name === 'value') {
+        return 'on';
+    }
+    return undefined;
+}
+/**
+ * Sets the value of an attribute. The attribute will be deleted if the value is
+ * `null`.
+ *
+ * @private
+ * @param el - The element to set the attribute on.
+ * @param name - The attribute's name.
+ * @param value - The attribute's value.
+ */
+function setAttr(el, name, value) {
+    if (value === null) {
+        removeAttribute(el, name);
+    }
+    else {
+        el.attribs[name] = `${value}`;
+    }
+}
+export function attr(name, value) {
+    // Set the value (with attr map support)
+    if (typeof name === 'object' || value !== undefined) {
+        if (typeof value === 'function') {
+            if (typeof name !== 'string') {
+                {
+                    throw new Error('Bad combination of arguments.');
+                }
+            }
+            return domEach(this, (el, i) => {
+                if (isTag(el))
+                    setAttr(el, name, value.call(el, i, el.attribs[name]));
+            });
+        }
+        return domEach(this, (el) => {
+            if (!isTag(el))
+                return;
+            if (typeof name === 'object') {
+                for (const objName of Object.keys(name)) {
+                    const objValue = name[objName];
+                    setAttr(el, objName, objValue);
+                }
+            }
+            else {
+                setAttr(el, name, value);
+            }
+        });
+    }
+    return arguments.length > 1
+        ? this
+        : getAttr(this[0], name, this.options.xmlMode);
+}
+/**
+ * Gets a node's prop.
+ *
+ * @private
+ * @category Attributes
+ * @param el - Element to get the prop of.
+ * @param name - Name of the prop.
+ * @param xmlMode - Disable handling of special HTML attributes.
+ * @returns The prop's value.
+ */
+function getProp(el, name, xmlMode) {
+    return name in el
+        ? // @ts-expect-error TS doesn't like us accessing the value directly here.
+            el[name]
+        : !xmlMode && rboolean.test(name)
+            ? getAttr(el, name, false) !== undefined
+            : getAttr(el, name, xmlMode);
+}
+/**
+ * Sets the value of a prop.
+ *
+ * @private
+ * @param el - The element to set the prop on.
+ * @param name - The prop's name.
+ * @param value - The prop's value.
+ * @param xmlMode - Disable handling of special HTML attributes.
+ */
+function setProp(el, name, value, xmlMode) {
+    if (name in el) {
+        // @ts-expect-error Overriding value
+        el[name] = value;
+    }
+    else {
+        setAttr(el, name, !xmlMode && rboolean.test(name) ? (value ? '' : null) : `${value}`);
+    }
+}
+export function prop(name, value) {
+    var _a;
+    if (typeof name === 'string' && value === undefined) {
+        const el = this[0];
+        if (!el || !isTag(el))
+            return undefined;
+        switch (name) {
+            case 'style': {
+                const property = this.css();
+                const keys = Object.keys(property);
+                for (let i = 0; i < keys.length; i++) {
+                    property[i] = keys[i];
+                }
+                property.length = keys.length;
+                return property;
+            }
+            case 'tagName':
+            case 'nodeName': {
+                return el.name.toUpperCase();
+            }
+            case 'href':
+            case 'src': {
+                const prop = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a[name];
+                if (typeof URL !== 'undefined' &&
+                    ((name === 'href' && (el.tagName === 'a' || el.tagName === 'link')) ||
+                        (name === 'src' &&
+                            (el.tagName === 'img' ||
+                                el.tagName === 'iframe' ||
+                                el.tagName === 'audio' ||
+                                el.tagName === 'video' ||
+                                el.tagName === 'source'))) &&
+                    prop !== undefined &&
+                    this.options.baseURI) {
+                    return new URL(prop, this.options.baseURI).href;
+                }
+                return prop;
+            }
+            case 'innerText': {
+                return innerText(el);
+            }
+            case 'textContent': {
+                return textContent(el);
+            }
+            case 'outerHTML': {
+                return this.clone().wrap('<container />').parent().html();
+            }
+            case 'innerHTML': {
+                return this.html();
+            }
+            default: {
+                return getProp(el, name, this.options.xmlMode);
+            }
+        }
+    }
+    if (typeof name === 'object' || value !== undefined) {
+        if (typeof value === 'function') {
+            if (typeof name === 'object') {
+                throw new TypeError('Bad combination of arguments.');
+            }
+            return domEach(this, (el, i) => {
+                if (isTag(el)) {
+                    setProp(el, name, value.call(el, i, getProp(el, name, this.options.xmlMode)), this.options.xmlMode);
+                }
+            });
+        }
+        return domEach(this, (el) => {
+            if (!isTag(el))
+                return;
+            if (typeof name === 'object') {
+                for (const key of Object.keys(name)) {
+                    const val = name[key];
+                    setProp(el, key, val, this.options.xmlMode);
+                }
+            }
+            else {
+                setProp(el, name, value, this.options.xmlMode);
+            }
+        });
+    }
+    return undefined;
+}
+/**
+ * Sets the value of a data attribute.
+ *
+ * @private
+ * @param elem - The element to set the data attribute on.
+ * @param name - The data attribute's name.
+ * @param value - The data attribute's value.
+ */
+function setData(elem, name, value) {
+    var _a;
+    (_a = elem.data) !== null && _a !== void 0 ? _a : (elem.data = {});
+    if (typeof name === 'object')
+        Object.assign(elem.data, name);
+    else if (typeof name === 'string' && value !== undefined) {
+        elem.data[name] = value;
+    }
+}
+/**
+ * Read _all_ HTML5 `data-*` attributes from the equivalent HTML5 `data-*`
+ * attribute, and cache the value in the node's internal data store.
+ *
+ * @private
+ * @category Attributes
+ * @param el - Element to get the data attribute of.
+ * @returns A map with all of the data attributes.
+ */
+function readAllData(el) {
+    for (const domName of Object.keys(el.attribs)) {
+        if (!domName.startsWith(dataAttrPrefix)) {
+            continue;
+        }
+        const jsName = camelCase(domName.slice(dataAttrPrefix.length));
+        if (!hasOwn.call(el.data, jsName)) {
+            el.data[jsName] = parseDataValue(el.attribs[domName]);
+        }
+    }
+    return el.data;
+}
+/**
+ * Read the specified attribute from the equivalent HTML5 `data-*` attribute,
+ * and (if present) cache the value in the node's internal data store.
+ *
+ * @private
+ * @category Attributes
+ * @param el - Element to get the data attribute of.
+ * @param name - Name of the data attribute.
+ * @returns The data attribute's value.
+ */
+function readData(el, name) {
+    const domName = dataAttrPrefix + cssCase(name);
+    const data = el.data;
+    if (hasOwn.call(data, name)) {
+        return data[name];
+    }
+    if (hasOwn.call(el.attribs, domName)) {
+        return (data[name] = parseDataValue(el.attribs[domName]));
+    }
+    return undefined;
+}
+/**
+ * Coerce string data-* attributes to their corresponding JavaScript primitives.
+ *
+ * @private
+ * @category Attributes
+ * @param value - The value to parse.
+ * @returns The parsed value.
+ */
+function parseDataValue(value) {
+    if (value === 'null')
+        return null;
+    if (value === 'true')
+        return true;
+    if (value === 'false')
+        return false;
+    const num = Number(value);
+    if (value === String(num))
+        return num;
+    if (rbrace.test(value)) {
+        try {
+            return JSON.parse(value);
+        }
+        catch {
+            /* Ignore */
+        }
+    }
+    return value;
+}
+export function data(name, value) {
+    var _a;
+    const elem = this[0];
+    if (!elem || !isTag(elem))
+        return;
+    const dataEl = elem;
+    (_a = dataEl.data) !== null && _a !== void 0 ? _a : (dataEl.data = {});
+    // Return the entire data object if no data specified
+    if (name == null) {
+        return readAllData(dataEl);
+    }
+    // Set the value (with attr map support)
+    if (typeof name === 'object' || value !== undefined) {
+        domEach(this, (el) => {
+            if (isTag(el)) {
+                if (typeof name === 'object')
+                    setData(el, name);
+                else
+                    setData(el, name, value);
+            }
+        });
+        return this;
+    }
+    return readData(dataEl, name);
+}
+export function val(value) {
+    const querying = arguments.length === 0;
+    const element = this[0];
+    if (!element || !isTag(element))
+        return querying ? undefined : this;
+    switch (element.name) {
+        case 'textarea': {
+            return this.text(value);
+        }
+        case 'select': {
+            const option = this.find('option:selected');
+            if (!querying) {
+                if (this.attr('multiple') == null && typeof value === 'object') {
+                    return this;
+                }
+                this.find('option').removeAttr('selected');
+                const values = typeof value === 'object' ? value : [value];
+                for (const val of values) {
+                    this.find(`option[value="${val}"]`).attr('selected', '');
+                }
+                return this;
+            }
+            return this.attr('multiple')
+                ? option.toArray().map((el) => text(el.children))
+                : option.attr('value');
+        }
+        case 'input':
+        case 'option': {
+            return querying
+                ? this.attr('value')
+                : this.attr('value', value);
+        }
+    }
+    return undefined;
+}
+/**
+ * Remove an attribute.
+ *
+ * @private
+ * @param elem - Node to remove attribute from.
+ * @param name - Name of the attribute to remove.
+ */
+function removeAttribute(elem, name) {
+    if (!elem.attribs || !hasOwn.call(elem.attribs, name))
+        return;
+    delete elem.attribs[name];
+}
+/**
+ * Splits a space-separated list of names to individual names.
+ *
+ * @category Attributes
+ * @param names - Names to split.
+ * @returns - Split names.
+ */
+function splitNames(names) {
+    return names ? names.trim().split(rspace) : [];
+}
+/**
+ * Method for removing attributes by `name`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.pear').removeAttr('class').html();
+ * //=> <li>Pear</li>
+ *
+ * $('.apple').attr('id', 'favorite');
+ * $('.apple').removeAttr('id class').html();
+ * //=> <li>Apple</li>
+ * ```
+ *
+ * @param name - Name of the attribute.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/removeAttr/}
+ */
+export function removeAttr(name) {
+    const attrNames = splitNames(name);
+    for (const attrName of attrNames) {
+        domEach(this, (elem) => {
+            if (isTag(elem))
+                removeAttribute(elem, attrName);
+        });
+    }
+    return this;
+}
+/**
+ * Check to see if _any_ of the matched elements have the given `className`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.pear').hasClass('pear');
+ * //=> true
+ *
+ * $('apple').hasClass('fruit');
+ * //=> false
+ *
+ * $('li').hasClass('pear');
+ * //=> true
+ * ```
+ *
+ * @param className - Name of the class.
+ * @returns Indicates if an element has the given `className`.
+ * @see {@link https://api.jquery.com/hasClass/}
+ */
+export function hasClass(className) {
+    return this.toArray().some((elem) => {
+        const clazz = isTag(elem) && elem.attribs['class'];
+        let idx = -1;
+        if (clazz && className.length > 0) {
+            while ((idx = clazz.indexOf(className, idx + 1)) > -1) {
+                const end = idx + className.length;
+                if ((idx === 0 || rspace.test(clazz[idx - 1])) &&
+                    (end === clazz.length || rspace.test(clazz[end]))) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    });
+}
+/**
+ * Adds class(es) to all of the matched elements. Also accepts a `function`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.pear').addClass('fruit').html();
+ * //=> <li class="pear fruit">Pear</li>
+ *
+ * $('.apple').addClass('fruit red').html();
+ * //=> <li class="apple fruit red">Apple</li>
+ * ```
+ *
+ * @param value - Name of new class.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/addClass/}
+ */
+export function addClass(value) {
+    // Support functions
+    if (typeof value === 'function') {
+        return domEach(this, (el, i) => {
+            if (isTag(el)) {
+                const className = el.attribs['class'] || '';
+                addClass.call([el], value.call(el, i, className));
+            }
+        });
+    }
+    // Return if no value or not a string or function
+    if (!value || typeof value !== 'string')
+        return this;
+    const classNames = value.split(rspace);
+    const numElements = this.length;
+    for (let i = 0; i < numElements; i++) {
+        const el = this[i];
+        // If selected element isn't a tag, move on
+        if (!isTag(el))
+            continue;
+        // If we don't already have classes — always set xmlMode to false here, as it doesn't matter for classes
+        const className = getAttr(el, 'class', false);
+        if (className) {
+            let setClass = ` ${className} `;
+            // Check if class already exists
+            for (const cn of classNames) {
+                const appendClass = `${cn} `;
+                if (!setClass.includes(` ${appendClass}`))
+                    setClass += appendClass;
+            }
+            setAttr(el, 'class', setClass.trim());
+        }
+        else {
+            setAttr(el, 'class', classNames.join(' ').trim());
+        }
+    }
+    return this;
+}
+/**
+ * Removes one or more space-separated classes from the selected elements. If no
+ * `className` is defined, all classes will be removed. Also accepts a
+ * `function`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.pear').removeClass('pear').html();
+ * //=> <li class="">Pear</li>
+ *
+ * $('.apple').addClass('red').removeClass().html();
+ * //=> <li class="">Apple</li>
+ * ```
+ *
+ * @param name - Name of the class. If not specified, removes all elements.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/removeClass/}
+ */
+export function removeClass(name) {
+    // Handle if value is a function
+    if (typeof name === 'function') {
+        return domEach(this, (el, i) => {
+            if (isTag(el)) {
+                removeClass.call([el], name.call(el, i, el.attribs['class'] || ''));
+            }
+        });
+    }
+    const classes = splitNames(name);
+    const numClasses = classes.length;
+    const removeAll = arguments.length === 0;
+    return domEach(this, (el) => {
+        if (!isTag(el))
+            return;
+        if (removeAll) {
+            // Short circuit the remove all case as this is the nice one
+            el.attribs['class'] = '';
+        }
+        else {
+            const elClasses = splitNames(el.attribs['class']);
+            let changed = false;
+            for (let j = 0; j < numClasses; j++) {
+                const index = elClasses.indexOf(classes[j]);
+                if (index >= 0) {
+                    elClasses.splice(index, 1);
+                    changed = true;
+                    /*
+                     * We have to do another pass to ensure that there are not duplicate
+                     * classes listed
+                     */
+                    j--;
+                }
+            }
+            if (changed) {
+                el.attribs['class'] = elClasses.join(' ');
+            }
+        }
+    });
+}
+/**
+ * Add or remove class(es) from the matched elements, depending on either the
+ * class's presence or the value of the switch argument. Also accepts a
+ * `function`.
+ *
+ * @category Attributes
+ * @example
+ *
+ * ```js
+ * $('.apple.green').toggleClass('fruit green red').html();
+ * //=> <li class="apple fruit red">Apple</li>
+ *
+ * $('.apple.green').toggleClass('fruit green red', true).html();
+ * //=> <li class="apple green fruit red">Apple</li>
+ * ```
+ *
+ * @param value - Name of the class. Can also be a function.
+ * @param stateVal - If specified the state of the class.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/toggleClass/}
+ */
+export function toggleClass(value, stateVal) {
+    // Support functions
+    if (typeof value === 'function') {
+        return domEach(this, (el, i) => {
+            if (isTag(el)) {
+                toggleClass.call([el], value.call(el, i, el.attribs['class'] || '', stateVal), stateVal);
+            }
+        });
+    }
+    // Return if no value or not a string or function
+    if (!value || typeof value !== 'string')
+        return this;
+    const classNames = value.split(rspace);
+    const numClasses = classNames.length;
+    const state = typeof stateVal === 'boolean' ? (stateVal ? 1 : -1) : 0;
+    const numElements = this.length;
+    for (let i = 0; i < numElements; i++) {
+        const el = this[i];
+        // If selected element isn't a tag, move on
+        if (!isTag(el))
+            continue;
+        const elementClasses = splitNames(el.attribs['class']);
+        // Check if class already exists
+        for (let j = 0; j < numClasses; j++) {
+            // Check if the class name is currently defined
+            const index = elementClasses.indexOf(classNames[j]);
+            // Add if stateValue === true or we are toggling and there is no value
+            if (state >= 0 && index < 0) {
+                elementClasses.push(classNames[j]);
+            }
+            else if (state <= 0 && index >= 0) {
+                // Otherwise remove but only if the item exists
+                elementClasses.splice(index, 1);
+            }
+        }
+        el.attribs['class'] = elementClasses.join(' ');
+    }
+    return this;
+}
+//# sourceMappingURL=attributes.js.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/api/attributes.js.map


+ 42 - 0
async-demo/node_modules/cheerio/dist/browser/api/css.d.ts

@@ -0,0 +1,42 @@
+import { type Element, type AnyNode } from 'domhandler';
+import type { Cheerio } from '../cheerio.js';
+/**
+ * Get the value of a style property for the first element in the set of matched
+ * elements.
+ *
+ * @category CSS
+ * @param names - Optionally the names of the properties of interest.
+ * @returns A map of all of the style properties.
+ * @see {@link https://api.jquery.com/css/}
+ */
+export declare function css<T extends AnyNode>(this: Cheerio<T>, names?: string[]): Record<string, string> | undefined;
+/**
+ * Get the value of a style property for the first element in the set of matched
+ * elements.
+ *
+ * @category CSS
+ * @param name - The name of the property.
+ * @returns The property value for the given name.
+ * @see {@link https://api.jquery.com/css/}
+ */
+export declare function css<T extends AnyNode>(this: Cheerio<T>, name: string): string | undefined;
+/**
+ * Set one CSS property for every matched element.
+ *
+ * @category CSS
+ * @param prop - The name of the property.
+ * @param val - The new value.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/css/}
+ */
+export declare function css<T extends AnyNode>(this: Cheerio<T>, prop: string, val: string | ((this: Element, i: number, style: string) => string | undefined)): Cheerio<T>;
+/**
+ * Set multiple CSS properties for every matched element.
+ *
+ * @category CSS
+ * @param map - A map of property names and values.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/css/}
+ */
+export declare function css<T extends AnyNode>(this: Cheerio<T>, map: Record<string, string>): Cheerio<T>;
+//# sourceMappingURL=css.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/api/css.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../src/api/css.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;AACtC;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAAC;AACtB;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EACC,MAAM,GACN,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GACpE,OAAO,CAAC,CAAC,CAAC,CAAC;AACd;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,OAAO,CAAC,CAAC,CAAC,CAAC"}

+ 116 - 0
async-demo/node_modules/cheerio/dist/browser/api/css.js

@@ -0,0 +1,116 @@
+import { domEach } from '../utils.js';
+import { isTag } from 'domhandler';
+/**
+ * Set multiple CSS properties for every matched element.
+ *
+ * @category CSS
+ * @param prop - The names of the properties.
+ * @param val - The new values.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/css/}
+ */
+export function css(prop, val) {
+    if ((prop != null && val != null) ||
+        // When `prop` is a "plain" object
+        (typeof prop === 'object' && !Array.isArray(prop))) {
+        return domEach(this, (el, i) => {
+            if (isTag(el)) {
+                // `prop` can't be an array here anymore.
+                setCss(el, prop, val, i);
+            }
+        });
+    }
+    if (this.length === 0) {
+        return undefined;
+    }
+    return getCss(this[0], prop);
+}
+/**
+ * Set styles of all elements.
+ *
+ * @private
+ * @param el - Element to set style of.
+ * @param prop - Name of property.
+ * @param value - Value to set property to.
+ * @param idx - Optional index within the selection.
+ */
+function setCss(el, prop, value, idx) {
+    if (typeof prop === 'string') {
+        const styles = getCss(el);
+        const val = typeof value === 'function' ? value.call(el, idx, styles[prop]) : value;
+        if (val === '') {
+            delete styles[prop];
+        }
+        else if (val != null) {
+            styles[prop] = val;
+        }
+        el.attribs['style'] = stringify(styles);
+    }
+    else if (typeof prop === 'object') {
+        const keys = Object.keys(prop);
+        for (let i = 0; i < keys.length; i++) {
+            const k = keys[i];
+            setCss(el, k, prop[k], i);
+        }
+    }
+}
+function getCss(el, prop) {
+    if (!el || !isTag(el))
+        return;
+    const styles = parse(el.attribs['style']);
+    if (typeof prop === 'string') {
+        return styles[prop];
+    }
+    if (Array.isArray(prop)) {
+        const newStyles = {};
+        for (const item of prop) {
+            if (styles[item] != null) {
+                newStyles[item] = styles[item];
+            }
+        }
+        return newStyles;
+    }
+    return styles;
+}
+/**
+ * Stringify `obj` to styles.
+ *
+ * @private
+ * @category CSS
+ * @param obj - Object to stringify.
+ * @returns The serialized styles.
+ */
+function stringify(obj) {
+    return Object.keys(obj).reduce((str, prop) => `${str}${str ? ' ' : ''}${prop}: ${obj[prop]};`, '');
+}
+/**
+ * Parse `styles`.
+ *
+ * @private
+ * @category CSS
+ * @param styles - Styles to be parsed.
+ * @returns The parsed styles.
+ */
+function parse(styles) {
+    styles = (styles || '').trim();
+    if (!styles)
+        return {};
+    const obj = {};
+    let key;
+    for (const str of styles.split(';')) {
+        const n = str.indexOf(':');
+        // If there is no :, or if it is the first/last character, add to the previous item's value
+        if (n < 1 || n === str.length - 1) {
+            const trimmed = str.trimEnd();
+            if (trimmed.length > 0 && key !== undefined) {
+                obj[key] += `;${trimmed}`;
+            }
+        }
+        else {
+            key = str.slice(0, n).trim();
+            obj[key] = str.slice(n + 1).trim();
+        }
+    }
+    return obj;
+}
+//# sourceMappingURL=css.js.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/api/css.js.map


+ 29 - 0
async-demo/node_modules/cheerio/dist/browser/api/extract.d.ts

@@ -0,0 +1,29 @@
+import type { AnyNode, Element } from 'domhandler';
+import type { Cheerio } from '../cheerio.js';
+import type { prop } from './attributes.js';
+type ExtractDescriptorFn = (el: Element, key: string, obj: Record<string, unknown>) => unknown;
+interface ExtractDescriptor {
+    selector: string;
+    value?: string | ExtractDescriptorFn | ExtractMap;
+}
+type ExtractValue = string | ExtractDescriptor | [string | ExtractDescriptor];
+export interface ExtractMap {
+    [key: string]: ExtractValue;
+}
+type ExtractedValue<V extends ExtractValue, M extends ExtractMap> = V extends [
+    string | ExtractDescriptor
+] ? NonNullable<ExtractedValue<V[0], M>>[] : V extends string ? string | undefined : V extends ExtractDescriptor ? V['value'] extends ExtractMap ? ExtractedMap<V['value']> | undefined : V['value'] extends ExtractDescriptorFn ? ReturnType<V['value']> | undefined : ReturnType<typeof prop> | undefined : never;
+export type ExtractedMap<M extends ExtractMap> = {
+    [key in keyof M]: ExtractedValue<M[key], M>;
+};
+/**
+ * Extract multiple values from a document, and store them in an object.
+ *
+ * @param map - An object containing key-value pairs. The keys are the names of
+ *   the properties to be created on the object, and the values are the
+ *   selectors to be used to extract the values.
+ * @returns An object containing the extracted values.
+ */
+export declare function extract<M extends ExtractMap, T extends AnyNode>(this: Cheerio<T>, map: M): ExtractedMap<M>;
+export {};
+//# sourceMappingURL=extract.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/api/extract.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/api/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,KAAK,mBAAmB,GAAG,CACzB,EAAE,EAAE,OAAO,EACX,GAAG,EAAE,MAAM,EAEX,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACzB,OAAO,CAAC;AAEb,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,mBAAmB,GAAG,UAAU,CAAC;CACnD;AAED,KAAK,YAAY,GAAG,MAAM,GAAG,iBAAiB,GAAG,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;AAE9E,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC7B;AAED,KAAK,cAAc,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,UAAU,IAAI,CAAC,SAAS;IAC5E,MAAM,GAAG,iBAAiB;CAC3B,GACG,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GACtC,CAAC,SAAS,MAAM,GACd,MAAM,GAAG,SAAS,GAClB,CAAC,SAAS,iBAAiB,GACzB,CAAC,CAAC,OAAO,CAAC,SAAS,UAAU,GAC3B,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,GACpC,CAAC,CAAC,OAAO,CAAC,SAAS,mBAAmB,GACpC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,GAClC,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,SAAS,GACvC,KAAK,CAAC;AAEd,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,UAAU,IAAI;KAC9C,GAAG,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;CAC5C,CAAC;AAeF;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO,EAC7D,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,GAAG,EAAE,CAAC,GACL,YAAY,CAAC,CAAC,CAAC,CA2BjB"}

+ 42 - 0
async-demo/node_modules/cheerio/dist/browser/api/extract.js

@@ -0,0 +1,42 @@
+function getExtractDescr(descr) {
+    var _a;
+    if (typeof descr === 'string') {
+        return { selector: descr, value: 'textContent' };
+    }
+    return {
+        selector: descr.selector,
+        value: (_a = descr.value) !== null && _a !== void 0 ? _a : 'textContent',
+    };
+}
+/**
+ * Extract multiple values from a document, and store them in an object.
+ *
+ * @param map - An object containing key-value pairs. The keys are the names of
+ *   the properties to be created on the object, and the values are the
+ *   selectors to be used to extract the values.
+ * @returns An object containing the extracted values.
+ */
+export function extract(map) {
+    const ret = {};
+    for (const key in map) {
+        const descr = map[key];
+        const isArray = Array.isArray(descr);
+        const { selector, value } = getExtractDescr(isArray ? descr[0] : descr);
+        const fn = typeof value === 'function'
+            ? value
+            : typeof value === 'string'
+                ? (el) => this._make(el).prop(value)
+                : (el) => this._make(el).extract(value);
+        if (isArray) {
+            ret[key] = this._findBySelector(selector, Number.POSITIVE_INFINITY)
+                .map((_, el) => fn(el, key, ret))
+                .get();
+        }
+        else {
+            const $ = this._findBySelector(selector, 1);
+            ret[key] = $.length > 0 ? fn($[0], key, ret) : undefined;
+        }
+    }
+    return ret;
+}
+//# sourceMappingURL=extract.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/api/extract.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../src/api/extract.ts"],"names":[],"mappings":"AAwCA,SAAS,eAAe,CACtB,KAAiC;;IAEjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IACnD,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,aAAa;KACpC,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAErB,GAAM;IAEN,MAAM,GAAG,GAA4B,EAAE,CAAC;IAExC,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAErC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAExE,MAAM,EAAE,GACN,OAAO,KAAK,KAAK,UAAU;YACzB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;gBACzB,CAAC,CAAC,CAAC,EAAW,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC7C,CAAC,CAAC,CAAC,EAAW,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEvD,IAAI,OAAO,EAAE,CAAC;YACZ,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,iBAAiB,CAAC;iBAChE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;iBAChC,GAAG,EAAE,CAAC;QACX,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC5C,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,OAAO,GAAsB,CAAC;AAChC,CAAC"}

+ 36 - 0
async-demo/node_modules/cheerio/dist/browser/api/forms.d.ts

@@ -0,0 +1,36 @@
+import { type AnyNode } from 'domhandler';
+import type { Cheerio } from '../cheerio.js';
+/**
+ * Encode a set of form elements as a string for submission.
+ *
+ * @category Forms
+ * @example
+ *
+ * ```js
+ * $('<form><input name="foo" value="bar" /></form>').serialize();
+ * //=> 'foo=bar'
+ * ```
+ *
+ * @returns The serialized form.
+ * @see {@link https://api.jquery.com/serialize/}
+ */
+export declare function serialize<T extends AnyNode>(this: Cheerio<T>): string;
+/**
+ * Encode a set of form elements as an array of names and values.
+ *
+ * @category Forms
+ * @example
+ *
+ * ```js
+ * $('<form><input name="foo" value="bar" /></form>').serializeArray();
+ * //=> [ { name: 'foo', value: 'bar' } ]
+ * ```
+ *
+ * @returns The serialized form.
+ * @see {@link https://api.jquery.com/serializeArray/}
+ */
+export declare function serializeArray<T extends AnyNode>(this: Cheerio<T>): {
+    name: string;
+    value: string;
+}[];
+//# sourceMappingURL=forms.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/api/forms.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../../src/api/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAU7C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAYrE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,OAAO,EAC9C,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GACf;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,EAAE,CA4CF"}

+ 81 - 0
async-demo/node_modules/cheerio/dist/browser/api/forms.js

@@ -0,0 +1,81 @@
+import { isTag } from 'domhandler';
+/*
+ * https://github.com/jquery/jquery/blob/2.1.3/src/manipulation/var/rcheckableType.js
+ * https://github.com/jquery/jquery/blob/2.1.3/src/serialize.js
+ */
+const submittableSelector = 'input,select,textarea,keygen';
+const r20 = /%20/g;
+const rCRLF = /\r?\n/g;
+/**
+ * Encode a set of form elements as a string for submission.
+ *
+ * @category Forms
+ * @example
+ *
+ * ```js
+ * $('<form><input name="foo" value="bar" /></form>').serialize();
+ * //=> 'foo=bar'
+ * ```
+ *
+ * @returns The serialized form.
+ * @see {@link https://api.jquery.com/serialize/}
+ */
+export function serialize() {
+    // Convert form elements into name/value objects
+    const arr = this.serializeArray();
+    // Serialize each element into a key/value string
+    const retArr = arr.map((data) => `${encodeURIComponent(data.name)}=${encodeURIComponent(data.value)}`);
+    // Return the resulting serialization
+    return retArr.join('&').replace(r20, '+');
+}
+/**
+ * Encode a set of form elements as an array of names and values.
+ *
+ * @category Forms
+ * @example
+ *
+ * ```js
+ * $('<form><input name="foo" value="bar" /></form>').serializeArray();
+ * //=> [ { name: 'foo', value: 'bar' } ]
+ * ```
+ *
+ * @returns The serialized form.
+ * @see {@link https://api.jquery.com/serializeArray/}
+ */
+export function serializeArray() {
+    // Resolve all form elements from either forms or collections of form elements
+    return this.map((_, elem) => {
+        const $elem = this._make(elem);
+        if (isTag(elem) && elem.name === 'form') {
+            return $elem.find(submittableSelector).toArray();
+        }
+        return $elem.filter(submittableSelector).toArray();
+    })
+        .filter(
+    // Verify elements have a name (`attr.name`) and are not disabled (`:enabled`)
+    '[name!=""]:enabled' +
+        // And cannot be clicked (`[type=submit]`) or are used in `x-www-form-urlencoded` (`[type=file]`)
+        ':not(:submit, :button, :image, :reset, :file)' +
+        // And are either checked/don't have a checkable state
+        ':matches([checked], :not(:checkbox, :radio))')
+        .map((_, elem) => {
+        var _a;
+        const $elem = this._make(elem);
+        const name = $elem.attr('name'); // We have filtered for elements with a name before.
+        // If there is no value set (e.g. `undefined`, `null`), then default value to empty
+        const value = (_a = $elem.val()) !== null && _a !== void 0 ? _a : '';
+        // If we have an array of values (e.g. `<select multiple>`), return an array of key/value pairs
+        if (Array.isArray(value)) {
+            return value.map((val) => 
+            /*
+             * We trim replace any line endings (e.g. `\r` or `\r\n` with `\r\n`) to guarantee consistency across platforms
+             * These can occur inside of `<textarea>'s`
+             */
+            ({ name, value: val.replace(rCRLF, '\r\n') }));
+        }
+        // Otherwise (e.g. `<input type="text">`, return only one key/value pair
+        return { name, value: value.replace(rCRLF, '\r\n') };
+    })
+        .toArray();
+}
+//# sourceMappingURL=forms.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/api/forms.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../src/api/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,MAAM,YAAY,CAAC;AAGjD;;;GAGG;AACH,MAAM,mBAAmB,GAAG,8BAA8B,CAAC;AAC3D,MAAM,GAAG,GAAG,MAAM,CAAC;AACnB,MAAM,KAAK,GAAG,QAAQ,CAAC;AAEvB;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,SAAS;IACvB,gDAAgD;IAChD,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAElC,iDAAiD;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CACpB,CAAC,IAAI,EAAE,EAAE,CACP,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CACvE,CAAC;IAEF,qCAAqC;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc;IAM5B,8EAA8E;IAC9E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,EAAE,CAAC;QACnD,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,OAAO,EAAE,CAAC;IACrD,CAAC,CAAC;SACC,MAAM;IACL,8EAA8E;IAC9E,oBAAoB;QAClB,iGAAiG;QACjG,+CAA+C;QAC/C,sDAAsD;QACtD,8CAA8C,CAEjD;SACA,GAAG,CAMF,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE;;QACZ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAW,CAAC,CAAC,oDAAoD;QAC/F,mFAAmF;QACnF,MAAM,KAAK,GAAG,MAAA,KAAK,CAAC,GAAG,EAAE,mCAAI,EAAE,CAAC;QAEhC,+FAA+F;QAC/F,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACvB;;;eAGG;YACH,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,CAC9C,CAAC;QACJ,CAAC;QACD,wEAAwE;QACxE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;IACvD,CAAC,CAAC;SACD,OAAO,EAAE,CAAC;AACf,CAAC"}

+ 528 - 0
async-demo/node_modules/cheerio/dist/browser/api/manipulation.d.ts

@@ -0,0 +1,528 @@
+/**
+ * Methods for modifying the DOM structure.
+ *
+ * @module cheerio/manipulation
+ */
+import { type AnyNode } from 'domhandler';
+import type { Cheerio } from '../cheerio.js';
+import type { BasicAcceptedElems, AcceptedElems } from '../types.js';
+/**
+ * Create an array of nodes, recursing into arrays and parsing strings if
+ * necessary.
+ *
+ * @private
+ * @category Manipulation
+ * @param elem - Elements to make an array of.
+ * @param clone - Optionally clone nodes.
+ * @returns The array of nodes.
+ */
+export declare function _makeDomArray<T extends AnyNode>(this: Cheerio<T>, elem?: BasicAcceptedElems<AnyNode> | BasicAcceptedElems<AnyNode>[], clone?: boolean): AnyNode[];
+/**
+ * Insert every element in the set of matched elements to the end of the target.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('<li class="plum">Plum</li>').appendTo('#fruits');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //      <li class="plum">Plum</li>
+ * //    </ul>
+ * ```
+ *
+ * @param target - Element to append elements to.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/appendTo/}
+ */
+export declare function appendTo<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;
+/**
+ * Insert every element in the set of matched elements to the beginning of the
+ * target.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('<li class="plum">Plum</li>').prependTo('#fruits');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="plum">Plum</li>
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param target - Element to prepend elements to.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/prependTo/}
+ */
+export declare function prependTo<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;
+/**
+ * Inserts content as the _last_ child of each of the selected elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('ul').append('<li class="plum">Plum</li>');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //      <li class="plum">Plum</li>
+ * //    </ul>
+ * ```
+ *
+ * @see {@link https://api.jquery.com/append/}
+ */
+export declare const append: <T extends AnyNode>(this: Cheerio<T>, ...elems: [(this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>] | BasicAcceptedElems<AnyNode>[]) => Cheerio<T>;
+/**
+ * Inserts content as the _first_ child of each of the selected elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('ul').prepend('<li class="plum">Plum</li>');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="plum">Plum</li>
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @see {@link https://api.jquery.com/prepend/}
+ */
+export declare const prepend: <T extends AnyNode>(this: Cheerio<T>, ...elems: [(this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>] | BasicAcceptedElems<AnyNode>[]) => Cheerio<T>;
+/**
+ * The .wrap() function can take any string or object that could be passed to
+ * the $() factory function to specify a DOM structure. This structure may be
+ * nested several levels deep, but should contain only one inmost element. A
+ * copy of this structure will be wrapped around each of the elements in the set
+ * of matched elements. This method returns the original set of elements for
+ * chaining purposes.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * const redFruit = $('<div class="red-fruit"></div>');
+ * $('.apple').wrap(redFruit);
+ *
+ * //=> <ul id="fruits">
+ * //     <div class="red-fruit">
+ * //      <li class="apple">Apple</li>
+ * //     </div>
+ * //     <li class="orange">Orange</li>
+ * //     <li class="plum">Plum</li>
+ * //   </ul>
+ *
+ * const healthy = $('<div class="healthy"></div>');
+ * $('li').wrap(healthy);
+ *
+ * //=> <ul id="fruits">
+ * //     <div class="healthy">
+ * //       <li class="apple">Apple</li>
+ * //     </div>
+ * //     <div class="healthy">
+ * //       <li class="orange">Orange</li>
+ * //     </div>
+ * //     <div class="healthy">
+ * //        <li class="plum">Plum</li>
+ * //     </div>
+ * //   </ul>
+ * ```
+ *
+ * @param wrapper - The DOM structure to wrap around each element in the
+ *   selection.
+ * @see {@link https://api.jquery.com/wrap/}
+ */
+export declare const wrap: <T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<AnyNode>) => Cheerio<T>;
+/**
+ * The .wrapInner() function can take any string or object that could be passed
+ * to the $() factory function to specify a DOM structure. This structure may be
+ * nested several levels deep, but should contain only one inmost element. The
+ * structure will be wrapped around the content of each of the elements in the
+ * set of matched elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * const redFruit = $('<div class="red-fruit"></div>');
+ * $('.apple').wrapInner(redFruit);
+ *
+ * //=> <ul id="fruits">
+ * //     <li class="apple">
+ * //       <div class="red-fruit">Apple</div>
+ * //     </li>
+ * //     <li class="orange">Orange</li>
+ * //     <li class="pear">Pear</li>
+ * //   </ul>
+ *
+ * const healthy = $('<div class="healthy"></div>');
+ * $('li').wrapInner(healthy);
+ *
+ * //=> <ul id="fruits">
+ * //     <li class="apple">
+ * //       <div class="healthy">Apple</div>
+ * //     </li>
+ * //     <li class="orange">
+ * //       <div class="healthy">Orange</div>
+ * //     </li>
+ * //     <li class="pear">
+ * //       <div class="healthy">Pear</div>
+ * //     </li>
+ * //   </ul>
+ * ```
+ *
+ * @param wrapper - The DOM structure to wrap around the content of each element
+ *   in the selection.
+ * @returns The instance itself, for chaining.
+ * @see {@link https://api.jquery.com/wrapInner/}
+ */
+export declare const wrapInner: <T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<AnyNode>) => Cheerio<T>;
+/**
+ * The .unwrap() function, removes the parents of the set of matched elements
+ * from the DOM, leaving the matched elements in their place.
+ *
+ * @category Manipulation
+ * @example <caption>without selector</caption>
+ *
+ * ```js
+ * const $ = cheerio.load(
+ *   '<div id=test>\n  <div><p>Hello</p></div>\n  <div><p>World</p></div>\n</div>',
+ * );
+ * $('#test p').unwrap();
+ *
+ * //=> <div id=test>
+ * //     <p>Hello</p>
+ * //     <p>World</p>
+ * //   </div>
+ * ```
+ *
+ * @example <caption>with selector</caption>
+ *
+ * ```js
+ * const $ = cheerio.load(
+ *   '<div id=test>\n  <p>Hello</p>\n  <b><p>World</p></b>\n</div>',
+ * );
+ * $('#test p').unwrap('b');
+ *
+ * //=> <div id=test>
+ * //     <p>Hello</p>
+ * //     <p>World</p>
+ * //   </div>
+ * ```
+ *
+ * @param selector - A selector to check the parent element against. If an
+ *   element's parent does not match the selector, the element won't be
+ *   unwrapped.
+ * @returns The instance itself, for chaining.
+ * @see {@link https://api.jquery.com/unwrap/}
+ */
+export declare function unwrap<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<T>;
+/**
+ * The .wrapAll() function can take any string or object that could be passed to
+ * the $() function to specify a DOM structure. This structure may be nested
+ * several levels deep, but should contain only one inmost element. The
+ * structure will be wrapped around all of the elements in the set of matched
+ * elements, as a single group.
+ *
+ * @category Manipulation
+ * @example <caption>With markup passed to `wrapAll`</caption>
+ *
+ * ```js
+ * const $ = cheerio.load(
+ *   '<div class="container"><div class="inner">First</div><div class="inner">Second</div></div>',
+ * );
+ * $('.inner').wrapAll("<div class='new'></div>");
+ *
+ * //=> <div class="container">
+ * //     <div class='new'>
+ * //       <div class="inner">First</div>
+ * //       <div class="inner">Second</div>
+ * //     </div>
+ * //   </div>
+ * ```
+ *
+ * @example <caption>With an existing cheerio instance</caption>
+ *
+ * ```js
+ * const $ = cheerio.load(
+ *   '<span>Span 1</span><strong>Strong</strong><span>Span 2</span>',
+ * );
+ * const wrap = $('<div><p><em><b></b></em></p></div>');
+ * $('span').wrapAll(wrap);
+ *
+ * //=> <div>
+ * //     <p>
+ * //       <em>
+ * //         <b>
+ * //           <span>Span 1</span>
+ * //           <span>Span 2</span>
+ * //         </b>
+ * //       </em>
+ * //     </p>
+ * //   </div>
+ * //   <strong>Strong</strong>
+ * ```
+ *
+ * @param wrapper - The DOM structure to wrap around all matched elements in the
+ *   selection.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/wrapAll/}
+ */
+export declare function wrapAll<T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<T>): Cheerio<T>;
+/**
+ * Insert content next to each element in the set of matched elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.apple').after('<li class="plum">Plum</li>');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="plum">Plum</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param elems - HTML string, DOM element, array of DOM elements or Cheerio to
+ *   insert after each element in the set of matched elements.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/after/}
+ */
+export declare function after<T extends AnyNode>(this: Cheerio<T>, ...elems: [(this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;
+/**
+ * Insert every element in the set of matched elements after the target.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('<li class="plum">Plum</li>').insertAfter('.apple');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="plum">Plum</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param target - Element to insert elements after.
+ * @returns The set of newly inserted elements.
+ * @see {@link https://api.jquery.com/insertAfter/}
+ */
+export declare function insertAfter<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;
+/**
+ * Insert content previous to each element in the set of matched elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.apple').before('<li class="plum">Plum</li>');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="plum">Plum</li>
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param elems - HTML string, DOM element, array of DOM elements or Cheerio to
+ *   insert before each element in the set of matched elements.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/before/}
+ */
+export declare function before<T extends AnyNode>(this: Cheerio<T>, ...elems: [(this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;
+/**
+ * Insert every element in the set of matched elements before the target.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('<li class="plum">Plum</li>').insertBefore('.apple');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="plum">Plum</li>
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param target - Element to insert elements before.
+ * @returns The set of newly inserted elements.
+ * @see {@link https://api.jquery.com/insertBefore/}
+ */
+export declare function insertBefore<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;
+/**
+ * Removes the set of matched elements from the DOM and all their children.
+ * `selector` filters the set of matched elements to be removed.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.pear').remove();
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //    </ul>
+ * ```
+ *
+ * @param selector - Optional selector for elements to remove.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/remove/}
+ */
+export declare function remove<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<T>;
+/**
+ * Replaces matched elements with `content`.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * const plum = $('<li class="plum">Plum</li>');
+ * $('.pear').replaceWith(plum);
+ * $.html();
+ * //=> <ul id="fruits">
+ * //     <li class="apple">Apple</li>
+ * //     <li class="orange">Orange</li>
+ * //     <li class="plum">Plum</li>
+ * //   </ul>
+ * ```
+ *
+ * @param content - Replacement for matched elements.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/replaceWith/}
+ */
+export declare function replaceWith<T extends AnyNode>(this: Cheerio<T>, content: AcceptedElems<AnyNode>): Cheerio<T>;
+/**
+ * Removes all children from each item in the selection. Text nodes and comment
+ * nodes are left as is.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('ul').empty();
+ * $.html();
+ * //=>  <ul id="fruits"></ul>
+ * ```
+ *
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/empty/}
+ */
+export declare function empty<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;
+/**
+ * Gets an HTML content string from the first selected element.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.orange').html();
+ * //=> Orange
+ *
+ * $('#fruits').html('<li class="mango">Mango</li>').html();
+ * //=> <li class="mango">Mango</li>
+ * ```
+ *
+ * @returns The HTML content string.
+ * @see {@link https://api.jquery.com/html/}
+ */
+export declare function html<T extends AnyNode>(this: Cheerio<T>): string | null;
+/**
+ * Replaces each selected element's content with the specified content.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.orange').html('<li class="mango">Mango</li>').html();
+ * //=> <li class="mango">Mango</li>
+ * ```
+ *
+ * @param str - The content to replace selection's contents with.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/html/}
+ */
+export declare function html<T extends AnyNode>(this: Cheerio<T>, str: string | Cheerio<T>): Cheerio<T>;
+/**
+ * Turns the collection to a string. Alias for `.html()`.
+ *
+ * @category Manipulation
+ * @returns The rendered document.
+ */
+export declare function toString<T extends AnyNode>(this: Cheerio<T>): string;
+/**
+ * Get the combined text contents of each element in the set of matched
+ * elements, including their descendants.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.orange').text();
+ * //=> Orange
+ *
+ * $('ul').text();
+ * //=>  Apple
+ * //    Orange
+ * //    Pear
+ * ```
+ *
+ * @returns The text contents of the collection.
+ * @see {@link https://api.jquery.com/text/}
+ */
+export declare function text<T extends AnyNode>(this: Cheerio<T>): string;
+/**
+ * Set the content of each element in the set of matched elements to the
+ * specified text.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.orange').text('Orange');
+ * //=> <div class="orange">Orange</div>
+ * ```
+ *
+ * @param str - The text to set as the content of each matched element.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/text/}
+ */
+export declare function text<T extends AnyNode>(this: Cheerio<T>, str: string | ((this: AnyNode, i: number, text: string) => string)): Cheerio<T>;
+/**
+ * Clone the cheerio object.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * const moreFruit = $('#fruits').clone();
+ * ```
+ *
+ * @returns The cloned object.
+ * @see {@link https://api.jquery.com/clone/}
+ */
+export declare function clone<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;
+//# sourceMappingURL=manipulation.d.ts.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/api/manipulation.d.ts.map


+ 829 - 0
async-demo/node_modules/cheerio/dist/browser/api/manipulation.js

@@ -0,0 +1,829 @@
+/**
+ * Methods for modifying the DOM structure.
+ *
+ * @module cheerio/manipulation
+ */
+import { isTag, Text, hasChildren, cloneNode, Document, } from 'domhandler';
+import { update as updateDOM } from '../parse.js';
+import { text as staticText } from '../static.js';
+import { domEach, isHtml, isCheerio } from '../utils.js';
+import { removeElement } from 'domutils';
+/**
+ * Create an array of nodes, recursing into arrays and parsing strings if
+ * necessary.
+ *
+ * @private
+ * @category Manipulation
+ * @param elem - Elements to make an array of.
+ * @param clone - Optionally clone nodes.
+ * @returns The array of nodes.
+ */
+export function _makeDomArray(elem, clone) {
+    if (elem == null) {
+        return [];
+    }
+    if (typeof elem === 'string') {
+        return this._parse(elem, this.options, false, null).children.slice(0);
+    }
+    if ('length' in elem) {
+        if (elem.length === 1) {
+            return this._makeDomArray(elem[0], clone);
+        }
+        const result = [];
+        for (let i = 0; i < elem.length; i++) {
+            const el = elem[i];
+            if (typeof el === 'object') {
+                if (el == null) {
+                    continue;
+                }
+                if (!('length' in el)) {
+                    result.push(clone ? cloneNode(el, true) : el);
+                    continue;
+                }
+            }
+            result.push(...this._makeDomArray(el, clone));
+        }
+        return result;
+    }
+    return [clone ? cloneNode(elem, true) : elem];
+}
+function _insert(concatenator) {
+    return function (...elems) {
+        const lastIdx = this.length - 1;
+        return domEach(this, (el, i) => {
+            if (!hasChildren(el))
+                return;
+            const domSrc = typeof elems[0] === 'function'
+                ? elems[0].call(el, i, this._render(el.children))
+                : elems;
+            const dom = this._makeDomArray(domSrc, i < lastIdx);
+            concatenator(dom, el.children, el);
+        });
+    };
+}
+/**
+ * Modify an array in-place, removing some number of elements and adding new
+ * elements directly following them.
+ *
+ * @private
+ * @category Manipulation
+ * @param array - Target array to splice.
+ * @param spliceIdx - Index at which to begin changing the array.
+ * @param spliceCount - Number of elements to remove from the array.
+ * @param newElems - Elements to insert into the array.
+ * @param parent - The parent of the node.
+ * @returns The spliced array.
+ */
+function uniqueSplice(array, spliceIdx, spliceCount, newElems, parent) {
+    var _a, _b;
+    const spliceArgs = [
+        spliceIdx,
+        spliceCount,
+        ...newElems,
+    ];
+    const prev = spliceIdx === 0 ? null : array[spliceIdx - 1];
+    const next = spliceIdx + spliceCount >= array.length
+        ? null
+        : array[spliceIdx + spliceCount];
+    /*
+     * Before splicing in new elements, ensure they do not already appear in the
+     * current array.
+     */
+    for (let idx = 0; idx < newElems.length; ++idx) {
+        const node = newElems[idx];
+        const oldParent = node.parent;
+        if (oldParent) {
+            const oldSiblings = oldParent.children;
+            const prevIdx = oldSiblings.indexOf(node);
+            if (prevIdx > -1) {
+                oldParent.children.splice(prevIdx, 1);
+                if (parent === oldParent && spliceIdx > prevIdx) {
+                    spliceArgs[0]--;
+                }
+            }
+        }
+        node.parent = parent;
+        if (node.prev) {
+            node.prev.next = (_a = node.next) !== null && _a !== void 0 ? _a : null;
+        }
+        if (node.next) {
+            node.next.prev = (_b = node.prev) !== null && _b !== void 0 ? _b : null;
+        }
+        node.prev = idx === 0 ? prev : newElems[idx - 1];
+        node.next = idx === newElems.length - 1 ? next : newElems[idx + 1];
+    }
+    if (prev) {
+        prev.next = newElems[0];
+    }
+    if (next) {
+        next.prev = newElems[newElems.length - 1];
+    }
+    return array.splice(...spliceArgs);
+}
+/**
+ * Insert every element in the set of matched elements to the end of the target.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('<li class="plum">Plum</li>').appendTo('#fruits');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //      <li class="plum">Plum</li>
+ * //    </ul>
+ * ```
+ *
+ * @param target - Element to append elements to.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/appendTo/}
+ */
+export function appendTo(target) {
+    const appendTarget = isCheerio(target) ? target : this._make(target);
+    appendTarget.append(this);
+    return this;
+}
+/**
+ * Insert every element in the set of matched elements to the beginning of the
+ * target.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('<li class="plum">Plum</li>').prependTo('#fruits');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="plum">Plum</li>
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param target - Element to prepend elements to.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/prependTo/}
+ */
+export function prependTo(target) {
+    const prependTarget = isCheerio(target) ? target : this._make(target);
+    prependTarget.prepend(this);
+    return this;
+}
+/**
+ * Inserts content as the _last_ child of each of the selected elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('ul').append('<li class="plum">Plum</li>');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //      <li class="plum">Plum</li>
+ * //    </ul>
+ * ```
+ *
+ * @see {@link https://api.jquery.com/append/}
+ */
+export const append = _insert((dom, children, parent) => {
+    uniqueSplice(children, children.length, 0, dom, parent);
+});
+/**
+ * Inserts content as the _first_ child of each of the selected elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('ul').prepend('<li class="plum">Plum</li>');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="plum">Plum</li>
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @see {@link https://api.jquery.com/prepend/}
+ */
+export const prepend = _insert((dom, children, parent) => {
+    uniqueSplice(children, 0, 0, dom, parent);
+});
+function _wrap(insert) {
+    return function (wrapper) {
+        const lastIdx = this.length - 1;
+        const lastParent = this.parents().last();
+        for (let i = 0; i < this.length; i++) {
+            const el = this[i];
+            const wrap = typeof wrapper === 'function'
+                ? wrapper.call(el, i, el)
+                : typeof wrapper === 'string' && !isHtml(wrapper)
+                    ? lastParent.find(wrapper).clone()
+                    : wrapper;
+            const [wrapperDom] = this._makeDomArray(wrap, i < lastIdx);
+            if (!wrapperDom || !hasChildren(wrapperDom))
+                continue;
+            let elInsertLocation = wrapperDom;
+            /*
+             * Find the deepest child. Only consider the first tag child of each node
+             * (ignore text); stop if no children are found.
+             */
+            let j = 0;
+            while (j < elInsertLocation.children.length) {
+                const child = elInsertLocation.children[j];
+                if (isTag(child)) {
+                    elInsertLocation = child;
+                    j = 0;
+                }
+                else {
+                    j++;
+                }
+            }
+            insert(el, elInsertLocation, [wrapperDom]);
+        }
+        return this;
+    };
+}
+/**
+ * The .wrap() function can take any string or object that could be passed to
+ * the $() factory function to specify a DOM structure. This structure may be
+ * nested several levels deep, but should contain only one inmost element. A
+ * copy of this structure will be wrapped around each of the elements in the set
+ * of matched elements. This method returns the original set of elements for
+ * chaining purposes.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * const redFruit = $('<div class="red-fruit"></div>');
+ * $('.apple').wrap(redFruit);
+ *
+ * //=> <ul id="fruits">
+ * //     <div class="red-fruit">
+ * //      <li class="apple">Apple</li>
+ * //     </div>
+ * //     <li class="orange">Orange</li>
+ * //     <li class="plum">Plum</li>
+ * //   </ul>
+ *
+ * const healthy = $('<div class="healthy"></div>');
+ * $('li').wrap(healthy);
+ *
+ * //=> <ul id="fruits">
+ * //     <div class="healthy">
+ * //       <li class="apple">Apple</li>
+ * //     </div>
+ * //     <div class="healthy">
+ * //       <li class="orange">Orange</li>
+ * //     </div>
+ * //     <div class="healthy">
+ * //        <li class="plum">Plum</li>
+ * //     </div>
+ * //   </ul>
+ * ```
+ *
+ * @param wrapper - The DOM structure to wrap around each element in the
+ *   selection.
+ * @see {@link https://api.jquery.com/wrap/}
+ */
+export const wrap = _wrap((el, elInsertLocation, wrapperDom) => {
+    const { parent } = el;
+    if (!parent)
+        return;
+    const siblings = parent.children;
+    const index = siblings.indexOf(el);
+    updateDOM([el], elInsertLocation);
+    /*
+     * The previous operation removed the current element from the `siblings`
+     * array, so the `dom` array can be inserted without removing any
+     * additional elements.
+     */
+    uniqueSplice(siblings, index, 0, wrapperDom, parent);
+});
+/**
+ * The .wrapInner() function can take any string or object that could be passed
+ * to the $() factory function to specify a DOM structure. This structure may be
+ * nested several levels deep, but should contain only one inmost element. The
+ * structure will be wrapped around the content of each of the elements in the
+ * set of matched elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * const redFruit = $('<div class="red-fruit"></div>');
+ * $('.apple').wrapInner(redFruit);
+ *
+ * //=> <ul id="fruits">
+ * //     <li class="apple">
+ * //       <div class="red-fruit">Apple</div>
+ * //     </li>
+ * //     <li class="orange">Orange</li>
+ * //     <li class="pear">Pear</li>
+ * //   </ul>
+ *
+ * const healthy = $('<div class="healthy"></div>');
+ * $('li').wrapInner(healthy);
+ *
+ * //=> <ul id="fruits">
+ * //     <li class="apple">
+ * //       <div class="healthy">Apple</div>
+ * //     </li>
+ * //     <li class="orange">
+ * //       <div class="healthy">Orange</div>
+ * //     </li>
+ * //     <li class="pear">
+ * //       <div class="healthy">Pear</div>
+ * //     </li>
+ * //   </ul>
+ * ```
+ *
+ * @param wrapper - The DOM structure to wrap around the content of each element
+ *   in the selection.
+ * @returns The instance itself, for chaining.
+ * @see {@link https://api.jquery.com/wrapInner/}
+ */
+export const wrapInner = _wrap((el, elInsertLocation, wrapperDom) => {
+    if (!hasChildren(el))
+        return;
+    updateDOM(el.children, elInsertLocation);
+    updateDOM(wrapperDom, el);
+});
+/**
+ * The .unwrap() function, removes the parents of the set of matched elements
+ * from the DOM, leaving the matched elements in their place.
+ *
+ * @category Manipulation
+ * @example <caption>without selector</caption>
+ *
+ * ```js
+ * const $ = cheerio.load(
+ *   '<div id=test>\n  <div><p>Hello</p></div>\n  <div><p>World</p></div>\n</div>',
+ * );
+ * $('#test p').unwrap();
+ *
+ * //=> <div id=test>
+ * //     <p>Hello</p>
+ * //     <p>World</p>
+ * //   </div>
+ * ```
+ *
+ * @example <caption>with selector</caption>
+ *
+ * ```js
+ * const $ = cheerio.load(
+ *   '<div id=test>\n  <p>Hello</p>\n  <b><p>World</p></b>\n</div>',
+ * );
+ * $('#test p').unwrap('b');
+ *
+ * //=> <div id=test>
+ * //     <p>Hello</p>
+ * //     <p>World</p>
+ * //   </div>
+ * ```
+ *
+ * @param selector - A selector to check the parent element against. If an
+ *   element's parent does not match the selector, the element won't be
+ *   unwrapped.
+ * @returns The instance itself, for chaining.
+ * @see {@link https://api.jquery.com/unwrap/}
+ */
+export function unwrap(selector) {
+    this.parent(selector)
+        .not('body')
+        .each((_, el) => {
+        this._make(el).replaceWith(el.children);
+    });
+    return this;
+}
+/**
+ * The .wrapAll() function can take any string or object that could be passed to
+ * the $() function to specify a DOM structure. This structure may be nested
+ * several levels deep, but should contain only one inmost element. The
+ * structure will be wrapped around all of the elements in the set of matched
+ * elements, as a single group.
+ *
+ * @category Manipulation
+ * @example <caption>With markup passed to `wrapAll`</caption>
+ *
+ * ```js
+ * const $ = cheerio.load(
+ *   '<div class="container"><div class="inner">First</div><div class="inner">Second</div></div>',
+ * );
+ * $('.inner').wrapAll("<div class='new'></div>");
+ *
+ * //=> <div class="container">
+ * //     <div class='new'>
+ * //       <div class="inner">First</div>
+ * //       <div class="inner">Second</div>
+ * //     </div>
+ * //   </div>
+ * ```
+ *
+ * @example <caption>With an existing cheerio instance</caption>
+ *
+ * ```js
+ * const $ = cheerio.load(
+ *   '<span>Span 1</span><strong>Strong</strong><span>Span 2</span>',
+ * );
+ * const wrap = $('<div><p><em><b></b></em></p></div>');
+ * $('span').wrapAll(wrap);
+ *
+ * //=> <div>
+ * //     <p>
+ * //       <em>
+ * //         <b>
+ * //           <span>Span 1</span>
+ * //           <span>Span 2</span>
+ * //         </b>
+ * //       </em>
+ * //     </p>
+ * //   </div>
+ * //   <strong>Strong</strong>
+ * ```
+ *
+ * @param wrapper - The DOM structure to wrap around all matched elements in the
+ *   selection.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/wrapAll/}
+ */
+export function wrapAll(wrapper) {
+    const el = this[0];
+    if (el) {
+        const wrap = this._make(typeof wrapper === 'function' ? wrapper.call(el, 0, el) : wrapper).insertBefore(el);
+        // If html is given as wrapper, wrap may contain text elements
+        let elInsertLocation;
+        for (let i = 0; i < wrap.length; i++) {
+            if (wrap[i].type === 'tag')
+                elInsertLocation = wrap[i];
+        }
+        let j = 0;
+        /*
+         * Find the deepest child. Only consider the first tag child of each node
+         * (ignore text); stop if no children are found.
+         */
+        while (elInsertLocation && j < elInsertLocation.children.length) {
+            const child = elInsertLocation.children[j];
+            if (child.type === 'tag') {
+                elInsertLocation = child;
+                j = 0;
+            }
+            else {
+                j++;
+            }
+        }
+        if (elInsertLocation)
+            this._make(elInsertLocation).append(this);
+    }
+    return this;
+}
+/**
+ * Insert content next to each element in the set of matched elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.apple').after('<li class="plum">Plum</li>');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="plum">Plum</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param elems - HTML string, DOM element, array of DOM elements or Cheerio to
+ *   insert after each element in the set of matched elements.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/after/}
+ */
+export function after(...elems) {
+    const lastIdx = this.length - 1;
+    return domEach(this, (el, i) => {
+        if (!hasChildren(el) || !el.parent) {
+            return;
+        }
+        const siblings = el.parent.children;
+        const index = siblings.indexOf(el);
+        // If not found, move on
+        /* istanbul ignore next */
+        if (index < 0)
+            return;
+        const domSrc = typeof elems[0] === 'function'
+            ? elems[0].call(el, i, this._render(el.children))
+            : elems;
+        const dom = this._makeDomArray(domSrc, i < lastIdx);
+        // Add element after `this` element
+        uniqueSplice(siblings, index + 1, 0, dom, el.parent);
+    });
+}
+/**
+ * Insert every element in the set of matched elements after the target.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('<li class="plum">Plum</li>').insertAfter('.apple');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="plum">Plum</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param target - Element to insert elements after.
+ * @returns The set of newly inserted elements.
+ * @see {@link https://api.jquery.com/insertAfter/}
+ */
+export function insertAfter(target) {
+    if (typeof target === 'string') {
+        target = this._make(target);
+    }
+    this.remove();
+    const clones = [];
+    for (const el of this._makeDomArray(target)) {
+        const clonedSelf = this.clone().toArray();
+        const { parent } = el;
+        if (!parent) {
+            continue;
+        }
+        const siblings = parent.children;
+        const index = siblings.indexOf(el);
+        // If not found, move on
+        /* istanbul ignore next */
+        if (index < 0)
+            continue;
+        // Add cloned `this` element(s) after target element
+        uniqueSplice(siblings, index + 1, 0, clonedSelf, parent);
+        clones.push(...clonedSelf);
+    }
+    return this._make(clones);
+}
+/**
+ * Insert content previous to each element in the set of matched elements.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.apple').before('<li class="plum">Plum</li>');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="plum">Plum</li>
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param elems - HTML string, DOM element, array of DOM elements or Cheerio to
+ *   insert before each element in the set of matched elements.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/before/}
+ */
+export function before(...elems) {
+    const lastIdx = this.length - 1;
+    return domEach(this, (el, i) => {
+        if (!hasChildren(el) || !el.parent) {
+            return;
+        }
+        const siblings = el.parent.children;
+        const index = siblings.indexOf(el);
+        // If not found, move on
+        /* istanbul ignore next */
+        if (index < 0)
+            return;
+        const domSrc = typeof elems[0] === 'function'
+            ? elems[0].call(el, i, this._render(el.children))
+            : elems;
+        const dom = this._makeDomArray(domSrc, i < lastIdx);
+        // Add element before `el` element
+        uniqueSplice(siblings, index, 0, dom, el.parent);
+    });
+}
+/**
+ * Insert every element in the set of matched elements before the target.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('<li class="plum">Plum</li>').insertBefore('.apple');
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="plum">Plum</li>
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //      <li class="pear">Pear</li>
+ * //    </ul>
+ * ```
+ *
+ * @param target - Element to insert elements before.
+ * @returns The set of newly inserted elements.
+ * @see {@link https://api.jquery.com/insertBefore/}
+ */
+export function insertBefore(target) {
+    const targetArr = this._make(target);
+    this.remove();
+    const clones = [];
+    domEach(targetArr, (el) => {
+        const clonedSelf = this.clone().toArray();
+        const { parent } = el;
+        if (!parent) {
+            return;
+        }
+        const siblings = parent.children;
+        const index = siblings.indexOf(el);
+        // If not found, move on
+        /* istanbul ignore next */
+        if (index < 0)
+            return;
+        // Add cloned `this` element(s) after target element
+        uniqueSplice(siblings, index, 0, clonedSelf, parent);
+        clones.push(...clonedSelf);
+    });
+    return this._make(clones);
+}
+/**
+ * Removes the set of matched elements from the DOM and all their children.
+ * `selector` filters the set of matched elements to be removed.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('.pear').remove();
+ * $.html();
+ * //=>  <ul id="fruits">
+ * //      <li class="apple">Apple</li>
+ * //      <li class="orange">Orange</li>
+ * //    </ul>
+ * ```
+ *
+ * @param selector - Optional selector for elements to remove.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/remove/}
+ */
+export function remove(selector) {
+    // Filter if we have selector
+    const elems = selector ? this.filter(selector) : this;
+    domEach(elems, (el) => {
+        removeElement(el);
+        el.prev = el.next = el.parent = null;
+    });
+    return this;
+}
+/**
+ * Replaces matched elements with `content`.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * const plum = $('<li class="plum">Plum</li>');
+ * $('.pear').replaceWith(plum);
+ * $.html();
+ * //=> <ul id="fruits">
+ * //     <li class="apple">Apple</li>
+ * //     <li class="orange">Orange</li>
+ * //     <li class="plum">Plum</li>
+ * //   </ul>
+ * ```
+ *
+ * @param content - Replacement for matched elements.
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/replaceWith/}
+ */
+export function replaceWith(content) {
+    return domEach(this, (el, i) => {
+        const { parent } = el;
+        if (!parent) {
+            return;
+        }
+        const siblings = parent.children;
+        const cont = typeof content === 'function' ? content.call(el, i, el) : content;
+        const dom = this._makeDomArray(cont);
+        /*
+         * In the case that `dom` contains nodes that already exist in other
+         * structures, ensure those nodes are properly removed.
+         */
+        updateDOM(dom, null);
+        const index = siblings.indexOf(el);
+        // Completely remove old element
+        uniqueSplice(siblings, index, 1, dom, parent);
+        if (!dom.includes(el)) {
+            el.parent = el.prev = el.next = null;
+        }
+    });
+}
+/**
+ * Removes all children from each item in the selection. Text nodes and comment
+ * nodes are left as is.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * $('ul').empty();
+ * $.html();
+ * //=>  <ul id="fruits"></ul>
+ * ```
+ *
+ * @returns The instance itself.
+ * @see {@link https://api.jquery.com/empty/}
+ */
+export function empty() {
+    return domEach(this, (el) => {
+        if (!hasChildren(el))
+            return;
+        for (const child of el.children) {
+            child.next = child.prev = child.parent = null;
+        }
+        el.children.length = 0;
+    });
+}
+export function html(str) {
+    if (str === undefined) {
+        const el = this[0];
+        if (!el || !hasChildren(el))
+            return null;
+        return this._render(el.children);
+    }
+    return domEach(this, (el) => {
+        if (!hasChildren(el))
+            return;
+        for (const child of el.children) {
+            child.next = child.prev = child.parent = null;
+        }
+        const content = isCheerio(str)
+            ? str.toArray()
+            : this._parse(`${str}`, this.options, false, el).children;
+        updateDOM(content, el);
+    });
+}
+/**
+ * Turns the collection to a string. Alias for `.html()`.
+ *
+ * @category Manipulation
+ * @returns The rendered document.
+ */
+export function toString() {
+    return this._render(this);
+}
+export function text(str) {
+    // If `str` is undefined, act as a "getter"
+    if (str === undefined) {
+        return staticText(this);
+    }
+    if (typeof str === 'function') {
+        // Function support
+        return domEach(this, (el, i) => this._make(el).text(str.call(el, i, staticText([el]))));
+    }
+    // Append text node to each selected elements
+    return domEach(this, (el) => {
+        if (!hasChildren(el))
+            return;
+        for (const child of el.children) {
+            child.next = child.prev = child.parent = null;
+        }
+        const textNode = new Text(`${str}`);
+        updateDOM(textNode, el);
+    });
+}
+/**
+ * Clone the cheerio object.
+ *
+ * @category Manipulation
+ * @example
+ *
+ * ```js
+ * const moreFruit = $('#fruits').clone();
+ * ```
+ *
+ * @returns The cloned object.
+ * @see {@link https://api.jquery.com/clone/}
+ */
+export function clone() {
+    const clone = Array.prototype.map.call(this.get(), (el) => cloneNode(el, true));
+    // Add a root node around the cloned nodes
+    const root = new Document(clone);
+    for (const node of clone) {
+        node.parent = root;
+    }
+    return this._make(clone);
+}
+//# sourceMappingURL=manipulation.js.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/api/manipulation.js.map


+ 657 - 0
async-demo/node_modules/cheerio/dist/browser/api/traversing.d.ts

@@ -0,0 +1,657 @@
+/**
+ * Methods for traversing the DOM structure.
+ *
+ * @module cheerio/traversing
+ */
+import { type AnyNode, type Element, type Document } from 'domhandler';
+import type { Cheerio } from '../cheerio.js';
+import type { AcceptedFilters } from '../types.js';
+/**
+ * Get the descendants of each element in the current set of matched elements,
+ * filtered by a selector, jQuery object, or element.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').find('li').length;
+ * //=> 3
+ * $('#fruits').find($('.apple')).length;
+ * //=> 1
+ * ```
+ *
+ * @param selectorOrHaystack - Element to look for.
+ * @returns The found elements.
+ * @see {@link https://api.jquery.com/find/}
+ */
+export declare function find<T extends AnyNode>(this: Cheerio<T>, selectorOrHaystack?: string | Cheerio<Element> | Element): Cheerio<Element>;
+/**
+ * Find elements by a specific selector.
+ *
+ * @private
+ * @category Traversing
+ * @param selector - Selector to filter by.
+ * @param limit - Maximum number of elements to match.
+ * @returns The found elements.
+ */
+export declare function _findBySelector<T extends AnyNode>(this: Cheerio<T>, selector: string, limit: number): Cheerio<Element>;
+/**
+ * Get the parent of each element in the current set of matched elements,
+ * optionally filtered by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').parent().attr('id');
+ * //=> fruits
+ * ```
+ *
+ * @param selector - If specified filter for parent.
+ * @returns The parents.
+ * @see {@link https://api.jquery.com/parent/}
+ */
+export declare const parent: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Get a set of parents filtered by `selector` of each element in the current
+ * set of match elements.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.orange').parents().length;
+ * //=> 2
+ * $('.orange').parents('#fruits').length;
+ * //=> 1
+ * ```
+ *
+ * @param selector - If specified filter for parents.
+ * @returns The parents.
+ * @see {@link https://api.jquery.com/parents/}
+ */
+export declare const parents: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Get the ancestors of each element in the current set of matched elements, up
+ * to but not including the element matched by the selector, DOM node, or
+ * cheerio object.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.orange').parentsUntil('#food').length;
+ * //=> 1
+ * ```
+ *
+ * @param selector - Selector for element to stop at.
+ * @param filterSelector - Optional filter for parents.
+ * @returns The parents.
+ * @see {@link https://api.jquery.com/parentsUntil/}
+ */
+export declare const parentsUntil: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * For each element in the set, get the first element that matches the selector
+ * by testing the element itself and traversing up through its ancestors in the
+ * DOM tree.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.orange').closest();
+ * //=> []
+ *
+ * $('.orange').closest('.apple');
+ * // => []
+ *
+ * $('.orange').closest('li');
+ * //=> [<li class="orange">Orange</li>]
+ *
+ * $('.orange').closest('#fruits');
+ * //=> [<ul id="fruits"> ... </ul>]
+ * ```
+ *
+ * @param selector - Selector for the element to find.
+ * @returns The closest nodes.
+ * @see {@link https://api.jquery.com/closest/}
+ */
+export declare function closest<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<AnyNode>;
+/**
+ * Gets the next sibling of each selected element, optionally filtered by a
+ * selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.apple').next().hasClass('orange');
+ * //=> true
+ * ```
+ *
+ * @param selector - If specified filter for sibling.
+ * @returns The next nodes.
+ * @see {@link https://api.jquery.com/next/}
+ */
+export declare const next: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Gets all the following siblings of the each selected element, optionally
+ * filtered by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.apple').nextAll();
+ * //=> [<li class="orange">Orange</li>, <li class="pear">Pear</li>]
+ * $('.apple').nextAll('.orange');
+ * //=> [<li class="orange">Orange</li>]
+ * ```
+ *
+ * @param selector - If specified filter for siblings.
+ * @returns The next nodes.
+ * @see {@link https://api.jquery.com/nextAll/}
+ */
+export declare const nextAll: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Gets all the following siblings up to but not including the element matched
+ * by the selector, optionally filtered by another selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.apple').nextUntil('.pear');
+ * //=> [<li class="orange">Orange</li>]
+ * ```
+ *
+ * @param selector - Selector for element to stop at.
+ * @param filterSelector - If specified filter for siblings.
+ * @returns The next nodes.
+ * @see {@link https://api.jquery.com/nextUntil/}
+ */
+export declare const nextUntil: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Gets the previous sibling of each selected element optionally filtered by a
+ * selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.orange').prev().hasClass('apple');
+ * //=> true
+ * ```
+ *
+ * @param selector - If specified filter for siblings.
+ * @returns The previous nodes.
+ * @see {@link https://api.jquery.com/prev/}
+ */
+export declare const prev: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Gets all the preceding siblings of each selected element, optionally filtered
+ * by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').prevAll();
+ * //=> [<li class="orange">Orange</li>, <li class="apple">Apple</li>]
+ *
+ * $('.pear').prevAll('.orange');
+ * //=> [<li class="orange">Orange</li>]
+ * ```
+ *
+ * @param selector - If specified filter for siblings.
+ * @returns The previous nodes.
+ * @see {@link https://api.jquery.com/prevAll/}
+ */
+export declare const prevAll: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Gets all the preceding siblings up to but not including the element matched
+ * by the selector, optionally filtered by another selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').prevUntil('.apple');
+ * //=> [<li class="orange">Orange</li>]
+ * ```
+ *
+ * @param selector - Selector for element to stop at.
+ * @param filterSelector - If specified filter for siblings.
+ * @returns The previous nodes.
+ * @see {@link https://api.jquery.com/prevUntil/}
+ */
+export declare const prevUntil: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Get the siblings of each element (excluding the element) in the set of
+ * matched elements, optionally filtered by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').siblings().length;
+ * //=> 2
+ *
+ * $('.pear').siblings('.orange').length;
+ * //=> 1
+ * ```
+ *
+ * @param selector - If specified filter for siblings.
+ * @returns The siblings.
+ * @see {@link https://api.jquery.com/siblings/}
+ */
+export declare const siblings: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Gets the element children of each element in the set of matched elements.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').children().length;
+ * //=> 3
+ *
+ * $('#fruits').children('.pear').text();
+ * //=> Pear
+ * ```
+ *
+ * @param selector - If specified filter for children.
+ * @returns The children.
+ * @see {@link https://api.jquery.com/children/}
+ */
+export declare const children: <T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>) => Cheerio<Element>;
+/**
+ * Gets the children of each element in the set of matched elements, including
+ * text and comment nodes.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').contents().length;
+ * //=> 3
+ * ```
+ *
+ * @returns The children.
+ * @see {@link https://api.jquery.com/contents/}
+ */
+export declare function contents<T extends AnyNode>(this: Cheerio<T>): Cheerio<AnyNode>;
+/**
+ * Iterates over a cheerio object, executing a function for each matched
+ * element. When the callback is fired, the function is fired in the context of
+ * the DOM element, so `this` refers to the current element, which is equivalent
+ * to the function parameter `element`. To break out of the `each` loop early,
+ * return with `false`.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * const fruits = [];
+ *
+ * $('li').each(function (i, elem) {
+ *   fruits[i] = $(this).text();
+ * });
+ *
+ * fruits.join(', ');
+ * //=> Apple, Orange, Pear
+ * ```
+ *
+ * @param fn - Function to execute.
+ * @returns The instance itself, useful for chaining.
+ * @see {@link https://api.jquery.com/each/}
+ */
+export declare function each<T>(this: Cheerio<T>, fn: (this: T, i: number, el: T) => void | boolean): Cheerio<T>;
+/**
+ * Pass each element in the current matched set through a function, producing a
+ * new Cheerio object containing the return values. The function can return an
+ * individual data item or an array of data items to be inserted into the
+ * resulting set. If an array is returned, the elements inside the array are
+ * inserted into the set. If the function returns null or undefined, no element
+ * will be inserted.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li')
+ *   .map(function (i, el) {
+ *     // this === el
+ *     return $(this).text();
+ *   })
+ *   .toArray()
+ *   .join(' ');
+ * //=> "apple orange pear"
+ * ```
+ *
+ * @param fn - Function to execute.
+ * @returns The mapped elements, wrapped in a Cheerio collection.
+ * @see {@link https://api.jquery.com/map/}
+ */
+export declare function map<T, M>(this: Cheerio<T>, fn: (this: T, i: number, el: T) => M[] | M | null | undefined): Cheerio<M>;
+/**
+ * Iterates over a cheerio object, reducing the set of selector elements to
+ * those that match the selector or pass the function's test.
+ *
+ * This is the definition for using type guards; have a look below for other
+ * ways to invoke this method. The function is executed in the context of the
+ * selected element, so `this` refers to the current element.
+ *
+ * @category Traversing
+ * @example <caption>Function</caption>
+ *
+ * ```js
+ * $('li')
+ *   .filter(function (i, el) {
+ *     // this === el
+ *     return $(this).attr('class') === 'orange';
+ *   })
+ *   .attr('class'); //=> orange
+ * ```
+ *
+ * @param match - Value to look for, following the rules above.
+ * @returns The filtered collection.
+ * @see {@link https://api.jquery.com/filter/}
+ */
+export declare function filter<T, S extends T>(this: Cheerio<T>, match: (this: T, index: number, value: T) => value is S): Cheerio<S>;
+/**
+ * Iterates over a cheerio object, reducing the set of selector elements to
+ * those that match the selector or pass the function's test.
+ *
+ * - When a Cheerio selection is specified, return only the elements contained in
+ *   that selection.
+ * - When an element is specified, return only that element (if it is contained in
+ *   the original selection).
+ * - If using the function method, the function is executed in the context of the
+ *   selected element, so `this` refers to the current element.
+ *
+ * @category Traversing
+ * @example <caption>Selector</caption>
+ *
+ * ```js
+ * $('li').filter('.orange').attr('class');
+ * //=> orange
+ * ```
+ *
+ * @example <caption>Function</caption>
+ *
+ * ```js
+ * $('li')
+ *   .filter(function (i, el) {
+ *     // this === el
+ *     return $(this).attr('class') === 'orange';
+ *   })
+ *   .attr('class'); //=> orange
+ * ```
+ *
+ * @param match - Value to look for, following the rules above. See
+ *   {@link AcceptedFilters}.
+ * @returns The filtered collection.
+ * @see {@link https://api.jquery.com/filter/}
+ */
+export declare function filter<T, S extends AcceptedFilters<T>>(this: Cheerio<T>, match: S): Cheerio<S extends string ? Element : T>;
+export declare function filterArray<T>(nodes: T[], match: AcceptedFilters<T>, xmlMode?: boolean, root?: Document): Element[] | T[];
+/**
+ * Checks the current list of elements and returns `true` if _any_ of the
+ * elements match the selector. If using an element or Cheerio selection,
+ * returns `true` if _any_ of the elements match. If using a predicate function,
+ * the function is executed in the context of the selected element, so `this`
+ * refers to the current element.
+ *
+ * @category Traversing
+ * @param selector - Selector for the selection.
+ * @returns Whether or not the selector matches an element of the instance.
+ * @see {@link https://api.jquery.com/is/}
+ */
+export declare function is<T>(this: Cheerio<T>, selector?: AcceptedFilters<T>): boolean;
+/**
+ * Remove elements from the set of matched elements. Given a Cheerio object that
+ * represents a set of DOM elements, the `.not()` method constructs a new
+ * Cheerio object from a subset of the matching elements. The supplied selector
+ * is tested against each element; the elements that don't match the selector
+ * will be included in the result.
+ *
+ * The `.not()` method can take a function as its argument in the same way that
+ * `.filter()` does. Elements for which the function returns `true` are excluded
+ * from the filtered set; all other elements are included.
+ *
+ * @category Traversing
+ * @example <caption>Selector</caption>
+ *
+ * ```js
+ * $('li').not('.apple').length;
+ * //=> 2
+ * ```
+ *
+ * @example <caption>Function</caption>
+ *
+ * ```js
+ * $('li').not(function (i, el) {
+ *   // this === el
+ *   return $(this).attr('class') === 'orange';
+ * }).length; //=> 2
+ * ```
+ *
+ * @param match - Value to look for, following the rules above.
+ * @returns The filtered collection.
+ * @see {@link https://api.jquery.com/not/}
+ */
+export declare function not<T extends AnyNode>(this: Cheerio<T>, match: AcceptedFilters<T>): Cheerio<T>;
+/**
+ * Filters the set of matched elements to only those which have the given DOM
+ * element as a descendant or which have a descendant that matches the given
+ * selector. Equivalent to `.filter(':has(selector)')`.
+ *
+ * @category Traversing
+ * @example <caption>Selector</caption>
+ *
+ * ```js
+ * $('ul').has('.pear').attr('id');
+ * //=> fruits
+ * ```
+ *
+ * @example <caption>Element</caption>
+ *
+ * ```js
+ * $('ul').has($('.pear')[0]).attr('id');
+ * //=> fruits
+ * ```
+ *
+ * @param selectorOrHaystack - Element to look for.
+ * @returns The filtered collection.
+ * @see {@link https://api.jquery.com/has/}
+ */
+export declare function has(this: Cheerio<AnyNode | Element>, selectorOrHaystack: string | Cheerio<Element> | Element): Cheerio<AnyNode | Element>;
+/**
+ * Will select the first element of a cheerio object.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').children().first().text();
+ * //=> Apple
+ * ```
+ *
+ * @returns The first element.
+ * @see {@link https://api.jquery.com/first/}
+ */
+export declare function first<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;
+/**
+ * Will select the last element of a cheerio object.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').children().last().text();
+ * //=> Pear
+ * ```
+ *
+ * @returns The last element.
+ * @see {@link https://api.jquery.com/last/}
+ */
+export declare function last<T>(this: Cheerio<T>): Cheerio<T>;
+/**
+ * Reduce the set of matched elements to the one at the specified index. Use
+ * `.eq(-i)` to count backwards from the last selected element.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').eq(0).text();
+ * //=> Apple
+ *
+ * $('li').eq(-1).text();
+ * //=> Pear
+ * ```
+ *
+ * @param i - Index of the element to select.
+ * @returns The element at the `i`th position.
+ * @see {@link https://api.jquery.com/eq/}
+ */
+export declare function eq<T>(this: Cheerio<T>, i: number): Cheerio<T>;
+/**
+ * Retrieve one of the elements matched by the Cheerio object, at the `i`th
+ * position.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').get(0).tagName;
+ * //=> li
+ * ```
+ *
+ * @param i - Element to retrieve.
+ * @returns The element at the `i`th position.
+ * @see {@link https://api.jquery.com/get/}
+ */
+export declare function get<T>(this: Cheerio<T>, i: number): T | undefined;
+/**
+ * Retrieve all elements matched by the Cheerio object, as an array.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').get().length;
+ * //=> 3
+ * ```
+ *
+ * @returns All elements matched by the Cheerio object.
+ * @see {@link https://api.jquery.com/get/}
+ */
+export declare function get<T>(this: Cheerio<T>): T[];
+/**
+ * Retrieve all the DOM elements contained in the jQuery set as an array.
+ *
+ * @example
+ *
+ * ```js
+ * $('li').toArray();
+ * //=> [ {...}, {...}, {...} ]
+ * ```
+ *
+ * @returns The contained items.
+ */
+export declare function toArray<T>(this: Cheerio<T>): T[];
+/**
+ * Search for a given element from among the matched elements.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').index();
+ * //=> 2 $('.orange').index('li');
+ * //=> 1
+ * $('.apple').index($('#fruit, li'));
+ * //=> 1
+ * ```
+ *
+ * @param selectorOrNeedle - Element to look for.
+ * @returns The index of the element.
+ * @see {@link https://api.jquery.com/index/}
+ */
+export declare function index<T extends AnyNode>(this: Cheerio<T>, selectorOrNeedle?: string | Cheerio<AnyNode> | AnyNode): number;
+/**
+ * Gets the elements matching the specified range (0-based position).
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').slice(1).eq(0).text();
+ * //=> 'Orange'
+ *
+ * $('li').slice(1, 2).length;
+ * //=> 1
+ * ```
+ *
+ * @param start - A position at which the elements begin to be selected. If
+ *   negative, it indicates an offset from the end of the set.
+ * @param end - A position at which the elements stop being selected. If
+ *   negative, it indicates an offset from the end of the set. If omitted, the
+ *   range continues until the end of the set.
+ * @returns The elements matching the specified range.
+ * @see {@link https://api.jquery.com/slice/}
+ */
+export declare function slice<T>(this: Cheerio<T>, start?: number, end?: number): Cheerio<T>;
+/**
+ * End the most recent filtering operation in the current chain and return the
+ * set of matched elements to its previous state.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').eq(0).end().length;
+ * //=> 3
+ * ```
+ *
+ * @returns The previous state of the set of matched elements.
+ * @see {@link https://api.jquery.com/end/}
+ */
+export declare function end<T>(this: Cheerio<T>): Cheerio<AnyNode>;
+/**
+ * Add elements to the set of matched elements.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.apple').add('.orange').length;
+ * //=> 2
+ * ```
+ *
+ * @param other - Elements to add.
+ * @param context - Optionally the context of the new selection.
+ * @returns The combined set.
+ * @see {@link https://api.jquery.com/add/}
+ */
+export declare function add<S extends AnyNode, T extends AnyNode>(this: Cheerio<T>, other: string | Cheerio<S> | S | S[], context?: Cheerio<S> | string): Cheerio<S | T>;
+/**
+ * Add the previous set of elements on the stack to the current set, optionally
+ * filtered by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').eq(0).addBack('.orange').length;
+ * //=> 2
+ * ```
+ *
+ * @param selector - Selector for the elements to add.
+ * @returns The combined set.
+ * @see {@link https://api.jquery.com/addBack/}
+ */
+export declare function addBack<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<AnyNode>;
+//# sourceMappingURL=traversing.d.ts.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/api/traversing.d.ts.map


+ 853 - 0
async-demo/node_modules/cheerio/dist/browser/api/traversing.js

@@ -0,0 +1,853 @@
+/**
+ * Methods for traversing the DOM structure.
+ *
+ * @module cheerio/traversing
+ */
+import { isTag, hasChildren, isDocument, } from 'domhandler';
+import * as select from 'cheerio-select';
+import { domEach, isCheerio } from '../utils.js';
+import { contains } from '../static.js';
+import { getChildren, getSiblings, nextElementSibling, prevElementSibling, uniqueSort, } from 'domutils';
+const reSiblingSelector = /^\s*[+~]/;
+/**
+ * Get the descendants of each element in the current set of matched elements,
+ * filtered by a selector, jQuery object, or element.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').find('li').length;
+ * //=> 3
+ * $('#fruits').find($('.apple')).length;
+ * //=> 1
+ * ```
+ *
+ * @param selectorOrHaystack - Element to look for.
+ * @returns The found elements.
+ * @see {@link https://api.jquery.com/find/}
+ */
+export function find(selectorOrHaystack) {
+    if (!selectorOrHaystack) {
+        return this._make([]);
+    }
+    if (typeof selectorOrHaystack !== 'string') {
+        const haystack = isCheerio(selectorOrHaystack)
+            ? selectorOrHaystack.toArray()
+            : [selectorOrHaystack];
+        const context = this.toArray();
+        return this._make(haystack.filter((elem) => context.some((node) => contains(node, elem))));
+    }
+    return this._findBySelector(selectorOrHaystack, Number.POSITIVE_INFINITY);
+}
+/**
+ * Find elements by a specific selector.
+ *
+ * @private
+ * @category Traversing
+ * @param selector - Selector to filter by.
+ * @param limit - Maximum number of elements to match.
+ * @returns The found elements.
+ */
+export function _findBySelector(selector, limit) {
+    var _a;
+    const context = this.toArray();
+    const elems = reSiblingSelector.test(selector)
+        ? context
+        : this.children().toArray();
+    const options = {
+        context,
+        root: (_a = this._root) === null || _a === void 0 ? void 0 : _a[0],
+        // Pass options that are recognized by `cheerio-select`
+        xmlMode: this.options.xmlMode,
+        lowerCaseTags: this.options.lowerCaseTags,
+        lowerCaseAttributeNames: this.options.lowerCaseAttributeNames,
+        pseudos: this.options.pseudos,
+        quirksMode: this.options.quirksMode,
+    };
+    return this._make(select.select(selector, elems, options, limit));
+}
+/**
+ * Creates a matcher, using a particular mapping function. Matchers provide a
+ * function that finds elements using a generating function, supporting
+ * filtering.
+ *
+ * @private
+ * @param matchMap - Mapping function.
+ * @returns - Function for wrapping generating functions.
+ */
+function _getMatcher(matchMap) {
+    return function (fn, ...postFns) {
+        return function (selector) {
+            var _a;
+            let matched = matchMap(fn, this);
+            if (selector) {
+                matched = filterArray(matched, selector, this.options.xmlMode, (_a = this._root) === null || _a === void 0 ? void 0 : _a[0]);
+            }
+            return this._make(
+            // Post processing is only necessary if there is more than one element.
+            this.length > 1 && matched.length > 1
+                ? postFns.reduce((elems, fn) => fn(elems), matched)
+                : matched);
+        };
+    };
+}
+/** Matcher that adds multiple elements for each entry in the input. */
+const _matcher = _getMatcher((fn, elems) => {
+    let ret = [];
+    for (let i = 0; i < elems.length; i++) {
+        const value = fn(elems[i]);
+        if (value.length > 0)
+            ret = ret.concat(value);
+    }
+    return ret;
+});
+/** Matcher that adds at most one element for each entry in the input. */
+const _singleMatcher = _getMatcher((fn, elems) => {
+    const ret = [];
+    for (let i = 0; i < elems.length; i++) {
+        const value = fn(elems[i]);
+        if (value !== null) {
+            ret.push(value);
+        }
+    }
+    return ret;
+});
+/**
+ * Matcher that supports traversing until a condition is met.
+ *
+ * @param nextElem - Function that returns the next element.
+ * @param postFns - Post processing functions.
+ * @returns A function usable for `*Until` methods.
+ */
+function _matchUntil(nextElem, ...postFns) {
+    // We use a variable here that is used from within the matcher.
+    let matches = null;
+    const innerMatcher = _getMatcher((nextElem, elems) => {
+        const matched = [];
+        domEach(elems, (elem) => {
+            for (let next; (next = nextElem(elem)); elem = next) {
+                // FIXME: `matched` might contain duplicates here and the index is too large.
+                if (matches === null || matches === void 0 ? void 0 : matches(next, matched.length))
+                    break;
+                matched.push(next);
+            }
+        });
+        return matched;
+    })(nextElem, ...postFns);
+    return function (selector, filterSelector) {
+        // Override `matches` variable with the new target.
+        matches =
+            typeof selector === 'string'
+                ? (elem) => select.is(elem, selector, this.options)
+                : selector
+                    ? getFilterFn(selector)
+                    : null;
+        const ret = innerMatcher.call(this, filterSelector);
+        // Set `matches` to `null`, so we don't waste memory.
+        matches = null;
+        return ret;
+    };
+}
+function _removeDuplicates(elems) {
+    return elems.length > 1 ? Array.from(new Set(elems)) : elems;
+}
+/**
+ * Get the parent of each element in the current set of matched elements,
+ * optionally filtered by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').parent().attr('id');
+ * //=> fruits
+ * ```
+ *
+ * @param selector - If specified filter for parent.
+ * @returns The parents.
+ * @see {@link https://api.jquery.com/parent/}
+ */
+export const parent = _singleMatcher(({ parent }) => (parent && !isDocument(parent) ? parent : null), _removeDuplicates);
+/**
+ * Get a set of parents filtered by `selector` of each element in the current
+ * set of match elements.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.orange').parents().length;
+ * //=> 2
+ * $('.orange').parents('#fruits').length;
+ * //=> 1
+ * ```
+ *
+ * @param selector - If specified filter for parents.
+ * @returns The parents.
+ * @see {@link https://api.jquery.com/parents/}
+ */
+export const parents = _matcher((elem) => {
+    const matched = [];
+    while (elem.parent && !isDocument(elem.parent)) {
+        matched.push(elem.parent);
+        elem = elem.parent;
+    }
+    return matched;
+}, uniqueSort, (elems) => elems.reverse());
+/**
+ * Get the ancestors of each element in the current set of matched elements, up
+ * to but not including the element matched by the selector, DOM node, or
+ * cheerio object.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.orange').parentsUntil('#food').length;
+ * //=> 1
+ * ```
+ *
+ * @param selector - Selector for element to stop at.
+ * @param filterSelector - Optional filter for parents.
+ * @returns The parents.
+ * @see {@link https://api.jquery.com/parentsUntil/}
+ */
+export const parentsUntil = _matchUntil(({ parent }) => (parent && !isDocument(parent) ? parent : null), uniqueSort, (elems) => elems.reverse());
+/**
+ * For each element in the set, get the first element that matches the selector
+ * by testing the element itself and traversing up through its ancestors in the
+ * DOM tree.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.orange').closest();
+ * //=> []
+ *
+ * $('.orange').closest('.apple');
+ * // => []
+ *
+ * $('.orange').closest('li');
+ * //=> [<li class="orange">Orange</li>]
+ *
+ * $('.orange').closest('#fruits');
+ * //=> [<ul id="fruits"> ... </ul>]
+ * ```
+ *
+ * @param selector - Selector for the element to find.
+ * @returns The closest nodes.
+ * @see {@link https://api.jquery.com/closest/}
+ */
+export function closest(selector) {
+    var _a;
+    const set = [];
+    if (!selector) {
+        return this._make(set);
+    }
+    const selectOpts = {
+        xmlMode: this.options.xmlMode,
+        root: (_a = this._root) === null || _a === void 0 ? void 0 : _a[0],
+    };
+    const selectFn = typeof selector === 'string'
+        ? (elem) => select.is(elem, selector, selectOpts)
+        : getFilterFn(selector);
+    domEach(this, (elem) => {
+        if (elem && !isDocument(elem) && !isTag(elem)) {
+            elem = elem.parent;
+        }
+        while (elem && isTag(elem)) {
+            if (selectFn(elem, 0)) {
+                // Do not add duplicate elements to the set
+                if (!set.includes(elem)) {
+                    set.push(elem);
+                }
+                break;
+            }
+            elem = elem.parent;
+        }
+    });
+    return this._make(set);
+}
+/**
+ * Gets the next sibling of each selected element, optionally filtered by a
+ * selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.apple').next().hasClass('orange');
+ * //=> true
+ * ```
+ *
+ * @param selector - If specified filter for sibling.
+ * @returns The next nodes.
+ * @see {@link https://api.jquery.com/next/}
+ */
+export const next = _singleMatcher((elem) => nextElementSibling(elem));
+/**
+ * Gets all the following siblings of the each selected element, optionally
+ * filtered by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.apple').nextAll();
+ * //=> [<li class="orange">Orange</li>, <li class="pear">Pear</li>]
+ * $('.apple').nextAll('.orange');
+ * //=> [<li class="orange">Orange</li>]
+ * ```
+ *
+ * @param selector - If specified filter for siblings.
+ * @returns The next nodes.
+ * @see {@link https://api.jquery.com/nextAll/}
+ */
+export const nextAll = _matcher((elem) => {
+    const matched = [];
+    while (elem.next) {
+        elem = elem.next;
+        if (isTag(elem))
+            matched.push(elem);
+    }
+    return matched;
+}, _removeDuplicates);
+/**
+ * Gets all the following siblings up to but not including the element matched
+ * by the selector, optionally filtered by another selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.apple').nextUntil('.pear');
+ * //=> [<li class="orange">Orange</li>]
+ * ```
+ *
+ * @param selector - Selector for element to stop at.
+ * @param filterSelector - If specified filter for siblings.
+ * @returns The next nodes.
+ * @see {@link https://api.jquery.com/nextUntil/}
+ */
+export const nextUntil = _matchUntil((el) => nextElementSibling(el), _removeDuplicates);
+/**
+ * Gets the previous sibling of each selected element optionally filtered by a
+ * selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.orange').prev().hasClass('apple');
+ * //=> true
+ * ```
+ *
+ * @param selector - If specified filter for siblings.
+ * @returns The previous nodes.
+ * @see {@link https://api.jquery.com/prev/}
+ */
+export const prev = _singleMatcher((elem) => prevElementSibling(elem));
+/**
+ * Gets all the preceding siblings of each selected element, optionally filtered
+ * by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').prevAll();
+ * //=> [<li class="orange">Orange</li>, <li class="apple">Apple</li>]
+ *
+ * $('.pear').prevAll('.orange');
+ * //=> [<li class="orange">Orange</li>]
+ * ```
+ *
+ * @param selector - If specified filter for siblings.
+ * @returns The previous nodes.
+ * @see {@link https://api.jquery.com/prevAll/}
+ */
+export const prevAll = _matcher((elem) => {
+    const matched = [];
+    while (elem.prev) {
+        elem = elem.prev;
+        if (isTag(elem))
+            matched.push(elem);
+    }
+    return matched;
+}, _removeDuplicates);
+/**
+ * Gets all the preceding siblings up to but not including the element matched
+ * by the selector, optionally filtered by another selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').prevUntil('.apple');
+ * //=> [<li class="orange">Orange</li>]
+ * ```
+ *
+ * @param selector - Selector for element to stop at.
+ * @param filterSelector - If specified filter for siblings.
+ * @returns The previous nodes.
+ * @see {@link https://api.jquery.com/prevUntil/}
+ */
+export const prevUntil = _matchUntil((el) => prevElementSibling(el), _removeDuplicates);
+/**
+ * Get the siblings of each element (excluding the element) in the set of
+ * matched elements, optionally filtered by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').siblings().length;
+ * //=> 2
+ *
+ * $('.pear').siblings('.orange').length;
+ * //=> 1
+ * ```
+ *
+ * @param selector - If specified filter for siblings.
+ * @returns The siblings.
+ * @see {@link https://api.jquery.com/siblings/}
+ */
+export const siblings = _matcher((elem) => getSiblings(elem).filter((el) => isTag(el) && el !== elem), uniqueSort);
+/**
+ * Gets the element children of each element in the set of matched elements.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').children().length;
+ * //=> 3
+ *
+ * $('#fruits').children('.pear').text();
+ * //=> Pear
+ * ```
+ *
+ * @param selector - If specified filter for children.
+ * @returns The children.
+ * @see {@link https://api.jquery.com/children/}
+ */
+export const children = _matcher((elem) => getChildren(elem).filter(isTag), _removeDuplicates);
+/**
+ * Gets the children of each element in the set of matched elements, including
+ * text and comment nodes.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').contents().length;
+ * //=> 3
+ * ```
+ *
+ * @returns The children.
+ * @see {@link https://api.jquery.com/contents/}
+ */
+export function contents() {
+    const elems = this.toArray().reduce((newElems, elem) => hasChildren(elem) ? newElems.concat(elem.children) : newElems, []);
+    return this._make(elems);
+}
+/**
+ * Iterates over a cheerio object, executing a function for each matched
+ * element. When the callback is fired, the function is fired in the context of
+ * the DOM element, so `this` refers to the current element, which is equivalent
+ * to the function parameter `element`. To break out of the `each` loop early,
+ * return with `false`.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * const fruits = [];
+ *
+ * $('li').each(function (i, elem) {
+ *   fruits[i] = $(this).text();
+ * });
+ *
+ * fruits.join(', ');
+ * //=> Apple, Orange, Pear
+ * ```
+ *
+ * @param fn - Function to execute.
+ * @returns The instance itself, useful for chaining.
+ * @see {@link https://api.jquery.com/each/}
+ */
+export function each(fn) {
+    let i = 0;
+    const len = this.length;
+    while (i < len && fn.call(this[i], i, this[i]) !== false)
+        ++i;
+    return this;
+}
+/**
+ * Pass each element in the current matched set through a function, producing a
+ * new Cheerio object containing the return values. The function can return an
+ * individual data item or an array of data items to be inserted into the
+ * resulting set. If an array is returned, the elements inside the array are
+ * inserted into the set. If the function returns null or undefined, no element
+ * will be inserted.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li')
+ *   .map(function (i, el) {
+ *     // this === el
+ *     return $(this).text();
+ *   })
+ *   .toArray()
+ *   .join(' ');
+ * //=> "apple orange pear"
+ * ```
+ *
+ * @param fn - Function to execute.
+ * @returns The mapped elements, wrapped in a Cheerio collection.
+ * @see {@link https://api.jquery.com/map/}
+ */
+export function map(fn) {
+    let elems = [];
+    for (let i = 0; i < this.length; i++) {
+        const el = this[i];
+        const val = fn.call(el, i, el);
+        if (val != null) {
+            elems = elems.concat(val);
+        }
+    }
+    return this._make(elems);
+}
+/**
+ * Creates a function to test if a filter is matched.
+ *
+ * @param match - A filter.
+ * @returns A function that determines if a filter has been matched.
+ */
+function getFilterFn(match) {
+    if (typeof match === 'function') {
+        return (el, i) => match.call(el, i, el);
+    }
+    if (isCheerio(match)) {
+        return (el) => Array.prototype.includes.call(match, el);
+    }
+    return function (el) {
+        return match === el;
+    };
+}
+export function filter(match) {
+    var _a;
+    return this._make(filterArray(this.toArray(), match, this.options.xmlMode, (_a = this._root) === null || _a === void 0 ? void 0 : _a[0]));
+}
+export function filterArray(nodes, match, xmlMode, root) {
+    return typeof match === 'string'
+        ? select.filter(match, nodes, { xmlMode, root })
+        : nodes.filter(getFilterFn(match));
+}
+/**
+ * Checks the current list of elements and returns `true` if _any_ of the
+ * elements match the selector. If using an element or Cheerio selection,
+ * returns `true` if _any_ of the elements match. If using a predicate function,
+ * the function is executed in the context of the selected element, so `this`
+ * refers to the current element.
+ *
+ * @category Traversing
+ * @param selector - Selector for the selection.
+ * @returns Whether or not the selector matches an element of the instance.
+ * @see {@link https://api.jquery.com/is/}
+ */
+export function is(selector) {
+    const nodes = this.toArray();
+    return typeof selector === 'string'
+        ? select.some(nodes.filter(isTag), selector, this.options)
+        : selector
+            ? nodes.some(getFilterFn(selector))
+            : false;
+}
+/**
+ * Remove elements from the set of matched elements. Given a Cheerio object that
+ * represents a set of DOM elements, the `.not()` method constructs a new
+ * Cheerio object from a subset of the matching elements. The supplied selector
+ * is tested against each element; the elements that don't match the selector
+ * will be included in the result.
+ *
+ * The `.not()` method can take a function as its argument in the same way that
+ * `.filter()` does. Elements for which the function returns `true` are excluded
+ * from the filtered set; all other elements are included.
+ *
+ * @category Traversing
+ * @example <caption>Selector</caption>
+ *
+ * ```js
+ * $('li').not('.apple').length;
+ * //=> 2
+ * ```
+ *
+ * @example <caption>Function</caption>
+ *
+ * ```js
+ * $('li').not(function (i, el) {
+ *   // this === el
+ *   return $(this).attr('class') === 'orange';
+ * }).length; //=> 2
+ * ```
+ *
+ * @param match - Value to look for, following the rules above.
+ * @returns The filtered collection.
+ * @see {@link https://api.jquery.com/not/}
+ */
+export function not(match) {
+    let nodes = this.toArray();
+    if (typeof match === 'string') {
+        const matches = new Set(select.filter(match, nodes, this.options));
+        nodes = nodes.filter((el) => !matches.has(el));
+    }
+    else {
+        const filterFn = getFilterFn(match);
+        nodes = nodes.filter((el, i) => !filterFn(el, i));
+    }
+    return this._make(nodes);
+}
+/**
+ * Filters the set of matched elements to only those which have the given DOM
+ * element as a descendant or which have a descendant that matches the given
+ * selector. Equivalent to `.filter(':has(selector)')`.
+ *
+ * @category Traversing
+ * @example <caption>Selector</caption>
+ *
+ * ```js
+ * $('ul').has('.pear').attr('id');
+ * //=> fruits
+ * ```
+ *
+ * @example <caption>Element</caption>
+ *
+ * ```js
+ * $('ul').has($('.pear')[0]).attr('id');
+ * //=> fruits
+ * ```
+ *
+ * @param selectorOrHaystack - Element to look for.
+ * @returns The filtered collection.
+ * @see {@link https://api.jquery.com/has/}
+ */
+export function has(selectorOrHaystack) {
+    return this.filter(typeof selectorOrHaystack === 'string'
+        ? // Using the `:has` selector here short-circuits searches.
+            `:has(${selectorOrHaystack})`
+        : (_, el) => this._make(el).find(selectorOrHaystack).length > 0);
+}
+/**
+ * Will select the first element of a cheerio object.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').children().first().text();
+ * //=> Apple
+ * ```
+ *
+ * @returns The first element.
+ * @see {@link https://api.jquery.com/first/}
+ */
+export function first() {
+    return this.length > 1 ? this._make(this[0]) : this;
+}
+/**
+ * Will select the last element of a cheerio object.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('#fruits').children().last().text();
+ * //=> Pear
+ * ```
+ *
+ * @returns The last element.
+ * @see {@link https://api.jquery.com/last/}
+ */
+export function last() {
+    return this.length > 0 ? this._make(this[this.length - 1]) : this;
+}
+/**
+ * Reduce the set of matched elements to the one at the specified index. Use
+ * `.eq(-i)` to count backwards from the last selected element.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').eq(0).text();
+ * //=> Apple
+ *
+ * $('li').eq(-1).text();
+ * //=> Pear
+ * ```
+ *
+ * @param i - Index of the element to select.
+ * @returns The element at the `i`th position.
+ * @see {@link https://api.jquery.com/eq/}
+ */
+export function eq(i) {
+    var _a;
+    i = +i;
+    // Use the first identity optimization if possible
+    if (i === 0 && this.length <= 1)
+        return this;
+    if (i < 0)
+        i = this.length + i;
+    return this._make((_a = this[i]) !== null && _a !== void 0 ? _a : []);
+}
+export function get(i) {
+    if (i == null) {
+        return this.toArray();
+    }
+    return this[i < 0 ? this.length + i : i];
+}
+/**
+ * Retrieve all the DOM elements contained in the jQuery set as an array.
+ *
+ * @example
+ *
+ * ```js
+ * $('li').toArray();
+ * //=> [ {...}, {...}, {...} ]
+ * ```
+ *
+ * @returns The contained items.
+ */
+export function toArray() {
+    return Array.prototype.slice.call(this);
+}
+/**
+ * Search for a given element from among the matched elements.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.pear').index();
+ * //=> 2 $('.orange').index('li');
+ * //=> 1
+ * $('.apple').index($('#fruit, li'));
+ * //=> 1
+ * ```
+ *
+ * @param selectorOrNeedle - Element to look for.
+ * @returns The index of the element.
+ * @see {@link https://api.jquery.com/index/}
+ */
+export function index(selectorOrNeedle) {
+    let $haystack;
+    let needle;
+    if (selectorOrNeedle == null) {
+        $haystack = this.parent().children();
+        needle = this[0];
+    }
+    else if (typeof selectorOrNeedle === 'string') {
+        $haystack = this._make(selectorOrNeedle);
+        needle = this[0];
+    }
+    else {
+        // eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment
+        $haystack = this;
+        needle = isCheerio(selectorOrNeedle)
+            ? selectorOrNeedle[0]
+            : selectorOrNeedle;
+    }
+    return Array.prototype.indexOf.call($haystack, needle);
+}
+/**
+ * Gets the elements matching the specified range (0-based position).
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').slice(1).eq(0).text();
+ * //=> 'Orange'
+ *
+ * $('li').slice(1, 2).length;
+ * //=> 1
+ * ```
+ *
+ * @param start - A position at which the elements begin to be selected. If
+ *   negative, it indicates an offset from the end of the set.
+ * @param end - A position at which the elements stop being selected. If
+ *   negative, it indicates an offset from the end of the set. If omitted, the
+ *   range continues until the end of the set.
+ * @returns The elements matching the specified range.
+ * @see {@link https://api.jquery.com/slice/}
+ */
+export function slice(start, end) {
+    return this._make(Array.prototype.slice.call(this, start, end));
+}
+/**
+ * End the most recent filtering operation in the current chain and return the
+ * set of matched elements to its previous state.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').eq(0).end().length;
+ * //=> 3
+ * ```
+ *
+ * @returns The previous state of the set of matched elements.
+ * @see {@link https://api.jquery.com/end/}
+ */
+export function end() {
+    var _a;
+    return (_a = this.prevObject) !== null && _a !== void 0 ? _a : this._make([]);
+}
+/**
+ * Add elements to the set of matched elements.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('.apple').add('.orange').length;
+ * //=> 2
+ * ```
+ *
+ * @param other - Elements to add.
+ * @param context - Optionally the context of the new selection.
+ * @returns The combined set.
+ * @see {@link https://api.jquery.com/add/}
+ */
+export function add(other, context) {
+    const selection = this._make(other, context);
+    const contents = uniqueSort([...this.get(), ...selection.get()]);
+    return this._make(contents);
+}
+/**
+ * Add the previous set of elements on the stack to the current set, optionally
+ * filtered by a selector.
+ *
+ * @category Traversing
+ * @example
+ *
+ * ```js
+ * $('li').eq(0).addBack('.orange').length;
+ * //=> 2
+ * ```
+ *
+ * @param selector - Selector for the elements to add.
+ * @returns The combined set.
+ * @see {@link https://api.jquery.com/addBack/}
+ */
+export function addBack(selector) {
+    return this.prevObject
+        ? this.add(selector ? this.prevObject.filter(selector) : this.prevObject)
+        : this;
+}
+//# sourceMappingURL=traversing.js.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/api/traversing.js.map


+ 85 - 0
async-demo/node_modules/cheerio/dist/browser/cheerio.d.ts

@@ -0,0 +1,85 @@
+import type { InternalOptions } from './options.js';
+import type { AnyNode, Document, ParentNode } from 'domhandler';
+import type { BasicAcceptedElems } from './types.js';
+import * as Attributes from './api/attributes.js';
+import * as Traversing from './api/traversing.js';
+import * as Manipulation from './api/manipulation.js';
+import * as Css from './api/css.js';
+import * as Forms from './api/forms.js';
+import * as Extract from './api/extract.js';
+type MethodsType = typeof Attributes & typeof Traversing & typeof Manipulation & typeof Css & typeof Forms & typeof Extract;
+/**
+ * The cheerio class is the central class of the library. It wraps a set of
+ * elements and provides an API for traversing, modifying, and interacting with
+ * the set.
+ *
+ * Loading a document will return the Cheerio class bound to the root element of
+ * the document. The class will be instantiated when querying the document (when
+ * calling `$('selector')`).
+ *
+ * @example This is the HTML markup we will be using in all of the API examples:
+ *
+ * ```html
+ * <ul id="fruits">
+ *   <li class="apple">Apple</li>
+ *   <li class="orange">Orange</li>
+ *   <li class="pear">Pear</li>
+ * </ul>
+ * ```
+ */
+export declare abstract class Cheerio<T> implements ArrayLike<T> {
+    length: number;
+    [index: number]: T;
+    options: InternalOptions;
+    /**
+     * The root of the document. Can be set by using the `root` argument of the
+     * constructor.
+     *
+     * @private
+     */
+    _root: Cheerio<Document> | null;
+    /**
+     * Instance of cheerio. Methods are specified in the modules. Usage of this
+     * constructor is not recommended. Please use `$.load` instead.
+     *
+     * @private
+     * @param elements - The new selection.
+     * @param root - Sets the root node.
+     * @param options - Options for the instance.
+     */
+    constructor(elements: ArrayLike<T> | undefined, root: Cheerio<Document> | null, options: InternalOptions);
+    prevObject: Cheerio<any> | undefined;
+    /**
+     * Make a cheerio object.
+     *
+     * @private
+     * @param dom - The contents of the new object.
+     * @param context - The context of the new object.
+     * @returns The new cheerio object.
+     */
+    abstract _make<T>(dom: ArrayLike<T> | T | string, context?: BasicAcceptedElems<AnyNode>): Cheerio<T>;
+    /**
+     * Parses some content.
+     *
+     * @private
+     * @param content - Content to parse.
+     * @param options - Options for parsing.
+     * @param isDocument - Allows parser to be switched to fragment mode.
+     * @returns A document containing the `content`.
+     */
+    abstract _parse(content: string | Document | AnyNode | AnyNode[] | Buffer, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document;
+    /**
+     * Render an element or a set of elements.
+     *
+     * @private
+     * @param dom - DOM to render.
+     * @returns The rendered DOM.
+     */
+    abstract _render(dom: AnyNode | ArrayLike<AnyNode>): string;
+}
+export interface Cheerio<T> extends MethodsType, Iterable<T> {
+    cheerio: '[cheerio object]';
+    splice: typeof Array.prototype.splice;
+}
+export {};
+//# sourceMappingURL=cheerio.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/cheerio.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"cheerio.d.ts","sourceRoot":"","sources":["../../src/cheerio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,KAAK,WAAW,GAAG,OAAO,UAAU,GAClC,OAAO,UAAU,GACjB,OAAO,YAAY,GACnB,OAAO,GAAG,GACV,OAAO,KAAK,GACZ,OAAO,OAAO,CAAC;AAEjB;;;;;;;;;;;;;;;;;;GAkBG;AACH,8BAAsB,OAAO,CAAC,CAAC,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IACtD,MAAM,SAAK;IACX,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC;IAEnB,OAAO,EAAE,eAAe,CAAC;IACzB;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAEhC;;;;;;;;OAQG;gBAED,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,EAClC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,EAC9B,OAAO,EAAE,eAAe;IAa1B,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACrC;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,CAAC,EACd,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAC9B,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACpC,OAAO,CAAC,CAAC,CAAC;IAEb;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,CACb,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,MAAM,EACzD,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,OAAO,EACnB,OAAO,EAAE,UAAU,GAAG,IAAI,GACzB,QAAQ;IAEX;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,MAAM;CAC5D;AAED,MAAM,WAAW,OAAO,CAAC,CAAC,CAAE,SAAQ,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1D,OAAO,EAAE,kBAAkB,CAAC;IAE5B,MAAM,EAAE,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;CACvC"}

+ 58 - 0
async-demo/node_modules/cheerio/dist/browser/cheerio.js

@@ -0,0 +1,58 @@
+import * as Attributes from './api/attributes.js';
+import * as Traversing from './api/traversing.js';
+import * as Manipulation from './api/manipulation.js';
+import * as Css from './api/css.js';
+import * as Forms from './api/forms.js';
+import * as Extract from './api/extract.js';
+/**
+ * The cheerio class is the central class of the library. It wraps a set of
+ * elements and provides an API for traversing, modifying, and interacting with
+ * the set.
+ *
+ * Loading a document will return the Cheerio class bound to the root element of
+ * the document. The class will be instantiated when querying the document (when
+ * calling `$('selector')`).
+ *
+ * @example This is the HTML markup we will be using in all of the API examples:
+ *
+ * ```html
+ * <ul id="fruits">
+ *   <li class="apple">Apple</li>
+ *   <li class="orange">Orange</li>
+ *   <li class="pear">Pear</li>
+ * </ul>
+ * ```
+ */
+export class Cheerio {
+    /**
+     * Instance of cheerio. Methods are specified in the modules. Usage of this
+     * constructor is not recommended. Please use `$.load` instead.
+     *
+     * @private
+     * @param elements - The new selection.
+     * @param root - Sets the root node.
+     * @param options - Options for the instance.
+     */
+    constructor(elements, root, options) {
+        this.length = 0;
+        this.options = options;
+        this._root = root;
+        if (elements) {
+            for (let idx = 0; idx < elements.length; idx++) {
+                this[idx] = elements[idx];
+            }
+            this.length = elements.length;
+        }
+    }
+}
+/** Set a signature of the object. */
+Cheerio.prototype.cheerio = '[cheerio object]';
+/*
+ * Make cheerio an array-like object
+ */
+Cheerio.prototype.splice = Array.prototype.splice;
+// Support for (const element of $(...)) iteration:
+Cheerio.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
+// Plug in the API
+Object.assign(Cheerio.prototype, Attributes, Traversing, Manipulation, Css, Forms, Extract);
+//# sourceMappingURL=cheerio.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/cheerio.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"cheerio.js","sourceRoot":"","sources":["../../src/cheerio.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAS5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAgB,OAAO;IAa3B;;;;;;;;OAQG;IACH,YACE,QAAkC,EAClC,IAA8B,EAC9B,OAAwB;QAxB1B,WAAM,GAAG,CAAC,CAAC;QA0BT,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,IAAI,QAAQ,EAAE,CAAC;YACb,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;gBAC/C,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC5B,CAAC;YACD,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAChC,CAAC;IACH,CAAC;CAwCF;AAQD,qCAAqC;AACrC,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,kBAAkB,CAAC;AAE/C;;GAEG;AACH,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;AAElD,mDAAmD;AACnD,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEtE,kBAAkB;AAClB,MAAM,CAAC,MAAM,CACX,OAAO,CAAC,SAAS,EACjB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,GAAG,EACH,KAAK,EACL,OAAO,CACR,CAAC"}

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/index-browser.d.mts.map

@@ -0,0 +1 @@
+{"version":3,"file":"index-browser.d.mts","sourceRoot":"","sources":["../../src/index-browser.mts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAC;AAChC,YAAY,EACV,OAAO,EACP,UAAU,EACV,cAAc,EACd,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9C,cAAc,iBAAiB,CAAC"}

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/index-browser.mjs.map

@@ -0,0 +1 @@
+{"version":3,"file":"index-browser.mjs","sourceRoot":"","sources":["../../src/index-browser.mts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9C,cAAc,iBAAiB,CAAC"}

+ 5 - 0
async-demo/node_modules/cheerio/dist/browser/index.d.ts

@@ -0,0 +1,5 @@
+export type * from './types.js';
+export type { Cheerio, CheerioAPI, CheerioOptions, HTMLParser2Options, } from './slim.js';
+export { contains, merge } from './static.js';
+export * from './load-parse.js';
+//# sourceMappingURL=index-browser.d.mts.map

+ 3 - 0
async-demo/node_modules/cheerio/dist/browser/index.js

@@ -0,0 +1,3 @@
+export { contains, merge } from './static.js';
+export * from './load-parse.js';
+//# sourceMappingURL=index-browser.mjs.map

+ 20 - 0
async-demo/node_modules/cheerio/dist/browser/load-parse.d.ts

@@ -0,0 +1,20 @@
+import { type CheerioAPI } from './load.js';
+import type { CheerioOptions } from './options.js';
+import type { AnyNode } from 'domhandler';
+/**
+ * Create a querying function, bound to a document created from the provided
+ * markup.
+ *
+ * Note that similar to web browser contexts, this operation may introduce
+ * `<html>`, `<head>`, and `<body>` elements; set `isDocument` to `false` to
+ * switch to fragment mode and disable this.
+ *
+ * @category Loading
+ * @param content - Markup to be loaded.
+ * @param options - Options for the created instance.
+ * @param isDocument - Allows parser to be switched to fragment mode.
+ * @returns The loaded document.
+ * @see {@link https://cheerio.js.org#loading} for additional usage information.
+ */
+export declare const load: (content: string | AnyNode | AnyNode[] | Buffer, options?: CheerioOptions | null, isDocument?: boolean) => CheerioAPI;
+//# sourceMappingURL=load-parse.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/load-parse.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"load-parse.d.ts","sourceRoot":"","sources":["../../src/load-parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAW,MAAM,WAAW,CAAC;AAGrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAS1C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,IAAI,EAAE,CACjB,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,MAAM,EAC9C,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,EAC/B,UAAU,CAAC,EAAE,OAAO,KACjB,UAIJ,CAAC"}

+ 28 - 0
async-demo/node_modules/cheerio/dist/browser/load-parse.js

@@ -0,0 +1,28 @@
+import { getLoad } from './load.js';
+import { getParse } from './parse.js';
+import { renderWithParse5, parseWithParse5 } from './parsers/parse5-adapter.js';
+import renderWithHtmlparser2 from 'dom-serializer';
+import { parseDocument as parseWithHtmlparser2 } from 'htmlparser2';
+const parse = getParse((content, options, isDocument, context) => options._useHtmlParser2
+    ? parseWithHtmlparser2(content, options)
+    : parseWithParse5(content, options, isDocument, context));
+// Duplicate docs due to https://github.com/TypeStrong/typedoc/issues/1616
+/**
+ * Create a querying function, bound to a document created from the provided
+ * markup.
+ *
+ * Note that similar to web browser contexts, this operation may introduce
+ * `<html>`, `<head>`, and `<body>` elements; set `isDocument` to `false` to
+ * switch to fragment mode and disable this.
+ *
+ * @category Loading
+ * @param content - Markup to be loaded.
+ * @param options - Options for the created instance.
+ * @param isDocument - Allows parser to be switched to fragment mode.
+ * @returns The loaded document.
+ * @see {@link https://cheerio.js.org#loading} for additional usage information.
+ */
+export const load = getLoad(parse, (dom, options) => options._useHtmlParser2
+    ? renderWithHtmlparser2(dom, options)
+    : renderWithParse5(dom));
+//# sourceMappingURL=load-parse.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/load-parse.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"load-parse.js","sourceRoot":"","sources":["../../src/load-parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,OAAO,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEhF,OAAO,qBAAqB,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGpE,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAC/D,OAAO,CAAC,eAAe;IACrB,CAAC,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC;IACxC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAC3D,CAAC;AAEF,0EAA0E;AAC1E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,IAAI,GAIC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAChD,OAAO,CAAC,eAAe;IACrB,CAAC,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,CAAC;IACrC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAC1B,CAAC"}

+ 91 - 0
async-demo/node_modules/cheerio/dist/browser/load.d.ts

@@ -0,0 +1,91 @@
+import { type CheerioOptions, type InternalOptions } from './options.js';
+import * as staticMethods from './static.js';
+import { Cheerio } from './cheerio.js';
+import type { AnyNode, Document, Element } from 'domhandler';
+import type { SelectorType, BasicAcceptedElems } from './types.js';
+type StaticType = typeof staticMethods;
+/**
+ * A querying function, bound to a document created from the provided markup.
+ *
+ * Also provides several helper methods for dealing with the document as a
+ * whole.
+ */
+export interface CheerioAPI extends StaticType {
+    /**
+     * This selector method is the starting point for traversing and manipulating
+     * the document. Like jQuery, it's the primary method for selecting elements
+     * in the document.
+     *
+     * `selector` searches within the `context` scope, which searches within the
+     * `root` scope.
+     *
+     * @example
+     *
+     * ```js
+     * $('ul .pear').attr('class');
+     * //=> pear
+     *
+     * $('li[class=orange]').html();
+     * //=> Orange
+     *
+     * $('.apple', '#fruits').text();
+     * //=> Apple
+     * ```
+     *
+     * Optionally, you can also load HTML by passing the string as the selector:
+     *
+     * ```js
+     * $('<ul id="fruits">...</ul>');
+     * ```
+     *
+     * Or the context:
+     *
+     * ```js
+     * $('ul', '<ul id="fruits">...</ul>');
+     * ```
+     *
+     * Or as the root:
+     *
+     * ```js
+     * $('li', 'ul', '<ul id="fruits">...</ul>');
+     * ```
+     *
+     * @param selector - Either a selector to look for within the document, or the
+     *   contents of a new Cheerio instance.
+     * @param context - Either a selector to look for within the root, or the
+     *   contents of the document to query.
+     * @param root - Optional HTML document string.
+     */
+    <T extends AnyNode, S extends string>(selector?: S | BasicAcceptedElems<T>, context?: BasicAcceptedElems<AnyNode> | null, root?: BasicAcceptedElems<Document>, options?: CheerioOptions): Cheerio<S extends SelectorType ? Element : T>;
+    /**
+     * The root the document was originally loaded with.
+     *
+     * @private
+     */
+    _root: Document;
+    /**
+     * The options the document was originally loaded with.
+     *
+     * @private
+     */
+    _options: InternalOptions;
+    /** Mimic jQuery's prototype alias for plugin authors. */
+    fn: typeof Cheerio.prototype;
+    /**
+     * The `.load` static method defined on the "loaded" Cheerio factory function
+     * is deprecated. Users are encouraged to instead use the `load` function
+     * exported by the Cheerio module.
+     *
+     * @deprecated Use the `load` function exported by the Cheerio module.
+     * @category Deprecated
+     * @example
+     *
+     * ```js
+     * const $ = cheerio.load('<h1>Hello, <span>world</span>.</h1>');
+     * ```
+     */
+    load: ReturnType<typeof getLoad>;
+}
+export declare function getLoad(parse: typeof Cheerio.prototype._parse, render: (dom: AnyNode | ArrayLike<AnyNode>, options: InternalOptions) => string): (content: string | AnyNode | AnyNode[] | Buffer, options?: CheerioOptions | null, isDocument?: boolean) => CheerioAPI;
+export {};
+//# sourceMappingURL=load.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/load.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/load.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EAErB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,aAAa,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAc,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEnE,KAAK,UAAU,GAAG,OAAO,aAAa,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACH,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,MAAM,EAClC,QAAQ,CAAC,EAAE,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,EACpC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,IAAI,EAC5C,IAAI,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,SAAS,YAAY,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC;IAEjD;;;;OAIG;IACH,KAAK,EAAE,QAAQ,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B,yDAAyD;IACzD,EAAE,EAAE,OAAO,OAAO,CAAC,SAAS,CAAC;IAE7B;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC;AAED,wBAAgB,OAAO,CACrB,KAAK,EAAE,OAAO,OAAO,CAAC,SAAS,CAAC,MAAM,EACtC,MAAM,EAAE,CACN,GAAG,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,EACjC,OAAO,EAAE,eAAe,KACrB,MAAM,aAiBA,MAAM,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,MAAM,YACpC,cAAc,GAAG,IAAI,2BAE9B,UAAU,CAyId"}

+ 123 - 0
async-demo/node_modules/cheerio/dist/browser/load.js

@@ -0,0 +1,123 @@
+import { flattenOptions, } from './options.js';
+import * as staticMethods from './static.js';
+import { Cheerio } from './cheerio.js';
+import { isHtml, isCheerio } from './utils.js';
+export function getLoad(parse, render) {
+    /**
+     * Create a querying function, bound to a document created from the provided
+     * markup.
+     *
+     * Note that similar to web browser contexts, this operation may introduce
+     * `<html>`, `<head>`, and `<body>` elements; set `isDocument` to `false` to
+     * switch to fragment mode and disable this.
+     *
+     * @param content - Markup to be loaded.
+     * @param options - Options for the created instance.
+     * @param isDocument - Allows parser to be switched to fragment mode.
+     * @returns The loaded document.
+     * @see {@link https://cheerio.js.org#loading} for additional usage information.
+     */
+    return function load(content, options, isDocument = true) {
+        if (content == null) {
+            throw new Error('cheerio.load() expects a string');
+        }
+        const internalOpts = flattenOptions(options);
+        const initialRoot = parse(content, internalOpts, isDocument, null);
+        /**
+         * Create an extended class here, so that extensions only live on one
+         * instance.
+         */
+        class LoadedCheerio extends Cheerio {
+            _make(selector, context) {
+                const cheerio = initialize(selector, context);
+                cheerio.prevObject = this;
+                return cheerio;
+            }
+            _parse(content, options, isDocument, context) {
+                return parse(content, options, isDocument, context);
+            }
+            _render(dom) {
+                return render(dom, this.options);
+            }
+        }
+        function initialize(selector, context, root = initialRoot, opts) {
+            // $($)
+            if (selector && isCheerio(selector))
+                return selector;
+            const options = flattenOptions(opts, internalOpts);
+            const r = typeof root === 'string'
+                ? [parse(root, options, false, null)]
+                : 'length' in root
+                    ? root
+                    : [root];
+            const rootInstance = isCheerio(r)
+                ? r
+                : new LoadedCheerio(r, null, options);
+            // Add a cyclic reference, so that calling methods on `_root` never fails.
+            rootInstance._root = rootInstance;
+            // $(), $(null), $(undefined), $(false)
+            if (!selector) {
+                return new LoadedCheerio(undefined, rootInstance, options);
+            }
+            const elements = typeof selector === 'string' && isHtml(selector)
+                ? // $(<html>)
+                    parse(selector, options, false, null).children
+                : isNode(selector)
+                    ? // $(dom)
+                        [selector]
+                    : Array.isArray(selector)
+                        ? // $([dom])
+                            selector
+                        : undefined;
+            const instance = new LoadedCheerio(elements, rootInstance, options);
+            if (elements) {
+                return instance;
+            }
+            if (typeof selector !== 'string') {
+                throw new TypeError('Unexpected type of selector');
+            }
+            // We know that our selector is a string now.
+            let search = selector;
+            const searchContext = context
+                ? // If we don't have a context, maybe we have a root, from loading
+                    typeof context === 'string'
+                        ? isHtml(context)
+                            ? // $('li', '<ul>...</ul>')
+                                new LoadedCheerio([parse(context, options, false, null)], rootInstance, options)
+                            : // $('li', 'ul')
+                                ((search = `${context} ${search}`), rootInstance)
+                        : isCheerio(context)
+                            ? // $('li', $)
+                                context
+                            : // $('li', node), $('li', [nodes])
+                                new LoadedCheerio(Array.isArray(context) ? context : [context], rootInstance, options)
+                : rootInstance;
+            // If we still don't have a context, return
+            if (!searchContext)
+                return instance;
+            /*
+             * #id, .class, tag
+             */
+            return searchContext.find(search);
+        }
+        // Add in static methods & properties
+        Object.assign(initialize, staticMethods, {
+            load,
+            // `_root` and `_options` are used in static methods.
+            _root: initialRoot,
+            _options: internalOpts,
+            // Add `fn` for plugins
+            fn: LoadedCheerio.prototype,
+            // Add the prototype here to maintain `instanceof` behavior.
+            prototype: LoadedCheerio.prototype,
+        });
+        return initialize;
+    };
+}
+function isNode(obj) {
+    return (!!obj.name ||
+        obj.type === 'root' ||
+        obj.type === 'text' ||
+        obj.type === 'comment');
+}
+//# sourceMappingURL=load.js.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/load.js.map


+ 95 - 0
async-demo/node_modules/cheerio/dist/browser/options.d.ts

@@ -0,0 +1,95 @@
+import type { DomHandlerOptions } from 'domhandler';
+import type { ParserOptions as HTMLParser2ParserOptions } from 'htmlparser2';
+import type { ParserOptions as Parse5ParserOptions } from 'parse5';
+import type { Htmlparser2TreeAdapterMap } from 'parse5-htmlparser2-tree-adapter';
+import type { Options as SelectOptions } from 'cheerio-select';
+/**
+ * Options accepted by htmlparser2, the default parser for XML.
+ *
+ * @see https://github.com/fb55/htmlparser2/wiki/Parser-options
+ */
+export interface HTMLParser2Options extends DomHandlerOptions, HTMLParser2ParserOptions {
+}
+/**
+ * Options accepted by Cheerio.
+ *
+ * Please note that parser-specific options are _only recognized_ if the
+ * relevant parser is used.
+ */
+export interface CheerioOptions extends Parse5ParserOptions<Htmlparser2TreeAdapterMap> {
+    /**
+     * Recommended way of configuring htmlparser2 when wanting to parse XML.
+     *
+     * This will switch Cheerio to use htmlparser2.
+     *
+     * @default false
+     */
+    xml?: HTMLParser2Options | boolean;
+    /**
+     * Enable xml mode, which will switch Cheerio to use htmlparser2.
+     *
+     * @deprecated Please use the `xml` option instead.
+     * @default false
+     */
+    xmlMode?: boolean;
+    /** The base URI for the document. Used to resolve the `href` and `src` props. */
+    baseURI?: string | URL;
+    /**
+     * Is the document in quirks mode?
+     *
+     * This will lead to `.className` and `#id` being case-insensitive.
+     *
+     * @default false
+     */
+    quirksMode?: SelectOptions['quirksMode'];
+    /**
+     * Extension point for pseudo-classes.
+     *
+     * Maps from names to either strings of functions.
+     *
+     * - A string value is a selector that the element must match to be selected.
+     * - A function is called with the element as its first argument, and optional
+     *   parameters second. If it returns true, the element is selected.
+     *
+     * @example
+     *
+     * ```js
+     * const $ = cheerio.load(
+     *   '<div class="foo"></div><div data-bar="boo"></div>',
+     *   {
+     *     pseudos: {
+     *       // `:foo` is an alias for `div.foo`
+     *       foo: 'div.foo',
+     *       // `:bar(val)` is equivalent to `[data-bar=val s]`
+     *       bar: (el, val) => el.attribs['data-bar'] === val,
+     *     },
+     *   },
+     * );
+     *
+     * $(':foo').length; // 1
+     * $('div:bar(boo)').length; // 1
+     * $('div:bar(baz)').length; // 0
+     * ```
+     */
+    pseudos?: SelectOptions['pseudos'];
+}
+/** Internal options for Cheerio. */
+export interface InternalOptions extends HTMLParser2Options, Omit<CheerioOptions, 'xml'> {
+    /**
+     * Whether to use htmlparser2.
+     *
+     * This is set to true if `xml` is set to true.
+     */
+    _useHtmlParser2?: boolean;
+}
+/**
+ * Flatten the options for Cheerio.
+ *
+ * This will set `_useHtmlParser2` to true if `xml` is set to true.
+ *
+ * @param options - The options to flatten.
+ * @param baseOptions - The base options to use.
+ * @returns The flattened options.
+ */
+export declare function flattenOptions(options?: CheerioOptions | null, baseOptions?: InternalOptions): InternalOptions;
+//# sourceMappingURL=options.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/options.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,IAAI,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,kBACf,SAAQ,iBAAiB,EACvB,wBAAwB;CAAG;AAE/B;;;;;GAKG;AACH,MAAM,WAAW,cACf,SAAQ,mBAAmB,CAAC,yBAAyB,CAAC;IACtD;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEvB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACpC;AAED,oCAAoC;AACpC,MAAM,WAAW,eACf,SAAQ,kBAAkB,EACxB,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC;IAC7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAMD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,EAC/B,WAAW,CAAC,EAAE,eAAe,GAC5B,eAAe,CAuBjB"}

+ 34 - 0
async-demo/node_modules/cheerio/dist/browser/options.js

@@ -0,0 +1,34 @@
+const defaultOpts = {
+    _useHtmlParser2: false,
+};
+/**
+ * Flatten the options for Cheerio.
+ *
+ * This will set `_useHtmlParser2` to true if `xml` is set to true.
+ *
+ * @param options - The options to flatten.
+ * @param baseOptions - The base options to use.
+ * @returns The flattened options.
+ */
+export function flattenOptions(options, baseOptions) {
+    if (!options) {
+        return baseOptions !== null && baseOptions !== void 0 ? baseOptions : defaultOpts;
+    }
+    const opts = {
+        _useHtmlParser2: !!options.xmlMode,
+        ...baseOptions,
+        ...options,
+    };
+    if (options.xml) {
+        opts._useHtmlParser2 = true;
+        opts.xmlMode = true;
+        if (options.xml !== true) {
+            Object.assign(opts, options.xml);
+        }
+    }
+    else if (options.xmlMode) {
+        opts._useHtmlParser2 = true;
+    }
+    return opts;
+}
+//# sourceMappingURL=options.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/options.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AA+FA,MAAM,WAAW,GAAoB;IACnC,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA+B,EAC/B,WAA6B;IAE7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,WAAW,CAAC;IACpC,CAAC;IAED,MAAM,IAAI,GAAoB;QAC5B,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO;QAClC,GAAG,WAAW;QACd,GAAG,OAAO;KACX,CAAC;IAEF,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,IAAI,OAAO,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;YACzB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}

+ 3 - 0
async-demo/node_modules/cheerio/dist/browser/package.json

@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}

+ 18 - 0
async-demo/node_modules/cheerio/dist/browser/parse.d.ts

@@ -0,0 +1,18 @@
+import { type AnyNode, Document, type ParentNode } from 'domhandler';
+import type { InternalOptions } from './options.js';
+/**
+ * Get the parse function with options.
+ *
+ * @param parser - The parser function.
+ * @returns The parse function with options.
+ */
+export declare function getParse(parser: (content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null) => Document): (content: string | Document | AnyNode | AnyNode[] | Buffer, options: InternalOptions, isDocument: boolean, context: ParentNode | null) => Document;
+/**
+ * Update the dom structure, for one changed layer.
+ *
+ * @param newChilds - The new children.
+ * @param parent - The new parent.
+ * @returns The parent node.
+ */
+export declare function update(newChilds: AnyNode[] | AnyNode, parent: ParentNode | null): ParentNode | null;
+//# sourceMappingURL=parse.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/parse.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/parse.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EACZ,QAAQ,EACR,KAAK,UAAU,EAEhB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,CACN,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,OAAO,EACnB,OAAO,EAAE,UAAU,GAAG,IAAI,KACvB,QAAQ,aAYF,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,MAAM,WAChD,eAAe,cACZ,OAAO,WACV,UAAU,GAAG,IAAI,KACzB,QAAQ,CAwBZ;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,EAC9B,MAAM,EAAE,UAAU,GAAG,IAAI,GACxB,UAAU,GAAG,IAAI,CA+BnB"}

+ 73 - 0
async-demo/node_modules/cheerio/dist/browser/parse.js

@@ -0,0 +1,73 @@
+import { removeElement } from 'domutils';
+import { Document, isDocument as checkIsDocument, } from 'domhandler';
+/**
+ * Get the parse function with options.
+ *
+ * @param parser - The parser function.
+ * @returns The parse function with options.
+ */
+export function getParse(parser) {
+    /**
+     * Parse a HTML string or a node.
+     *
+     * @param content - The HTML string or node.
+     * @param options - The parser options.
+     * @param isDocument - If `content` is a document.
+     * @param context - The context node in the DOM tree.
+     * @returns The parsed document node.
+     */
+    return function parse(content, options, isDocument, context) {
+        if (typeof Buffer !== 'undefined' && Buffer.isBuffer(content)) {
+            content = content.toString();
+        }
+        if (typeof content === 'string') {
+            return parser(content, options, isDocument, context);
+        }
+        const doc = content;
+        if (!Array.isArray(doc) && checkIsDocument(doc)) {
+            // If `doc` is already a root, just return it
+            return doc;
+        }
+        // Add conent to new root element
+        const root = new Document([]);
+        // Update the DOM using the root
+        update(doc, root);
+        return root;
+    };
+}
+/**
+ * Update the dom structure, for one changed layer.
+ *
+ * @param newChilds - The new children.
+ * @param parent - The new parent.
+ * @returns The parent node.
+ */
+export function update(newChilds, parent) {
+    // Normalize
+    const arr = Array.isArray(newChilds) ? newChilds : [newChilds];
+    // Update parent
+    if (parent) {
+        parent.children = arr;
+    }
+    else {
+        parent = null;
+    }
+    // Update neighbors
+    for (let i = 0; i < arr.length; i++) {
+        const node = arr[i];
+        // Cleanly remove existing nodes from their previous structures.
+        if (node.parent && node.parent.children !== arr) {
+            removeElement(node);
+        }
+        if (parent) {
+            node.prev = arr[i - 1] || null;
+            node.next = arr[i + 1] || null;
+        }
+        else {
+            node.prev = node.next = null;
+        }
+        node.parent = parent;
+    }
+    return parent;
+}
+//# sourceMappingURL=parse.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/parse.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAEL,QAAQ,EAER,UAAU,IAAI,eAAe,GAC9B,MAAM,YAAY,CAAC;AAGpB;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CACtB,MAKa;IAEb;;;;;;;;OAQG;IACH,OAAO,SAAS,KAAK,CACnB,OAAyD,EACzD,OAAwB,EACxB,UAAmB,EACnB,OAA0B;QAE1B,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC/B,CAAC;QAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,GAAG,GAAG,OAAyC,CAAC;QAEtD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,6CAA6C;YAC7C,OAAO,GAAG,CAAC;QACb,CAAC;QAED,iCAAiC;QACjC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;QAE9B,gCAAgC;QAChC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAElB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CACpB,SAA8B,EAC9B,MAAyB;IAEzB,YAAY;IACZ,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE/D,gBAAgB;IAChB,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC;IACxB,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IAED,mBAAmB;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEpB,gEAAgE;QAChE,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,GAAG,EAAE,CAAC;YAChD,aAAa,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;YAC/B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAC/B,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}

+ 20 - 0
async-demo/node_modules/cheerio/dist/browser/parsers/parse5-adapter.d.ts

@@ -0,0 +1,20 @@
+import { type AnyNode, type Document, type ParentNode } from 'domhandler';
+import type { InternalOptions } from '../options.js';
+/**
+ * Parse the content with `parse5` in the context of the given `ParentNode`.
+ *
+ * @param content - The content to parse.
+ * @param options - A set of options to use to parse.
+ * @param isDocument - Whether to parse the content as a full HTML document.
+ * @param context - The context in which to parse the content.
+ * @returns The parsed content.
+ */
+export declare function parseWithParse5(content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document;
+/**
+ * Renders the given DOM tree with `parse5` and returns the result as a string.
+ *
+ * @param dom - The DOM tree to render.
+ * @returns The rendered document.
+ */
+export declare function renderWithParse5(dom: AnyNode | ArrayLike<AnyNode>): string;
+//# sourceMappingURL=parse5-adapter.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/parsers/parse5-adapter.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"parse5-adapter.d.ts","sourceRoot":"","sources":["../../../src/parsers/parse5-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,UAAU,EAEhB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,OAAO,EACnB,OAAO,EAAE,UAAU,GAAG,IAAI,GACzB,QAAQ,CAUV;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,MAAM,CAqB1E"}

+ 50 - 0
async-demo/node_modules/cheerio/dist/browser/parsers/parse5-adapter.js

@@ -0,0 +1,50 @@
+import { isDocument, } from 'domhandler';
+import { parse as parseDocument, parseFragment, serializeOuter } from 'parse5';
+import { adapter as htmlparser2Adapter } from 'parse5-htmlparser2-tree-adapter';
+/**
+ * Parse the content with `parse5` in the context of the given `ParentNode`.
+ *
+ * @param content - The content to parse.
+ * @param options - A set of options to use to parse.
+ * @param isDocument - Whether to parse the content as a full HTML document.
+ * @param context - The context in which to parse the content.
+ * @returns The parsed content.
+ */
+export function parseWithParse5(content, options, isDocument, context) {
+    var _a;
+    (_a = options.treeAdapter) !== null && _a !== void 0 ? _a : (options.treeAdapter = htmlparser2Adapter);
+    if (options.scriptingEnabled !== false) {
+        options.scriptingEnabled = true;
+    }
+    return isDocument
+        ? parseDocument(content, options)
+        : parseFragment(context, content, options);
+}
+const renderOpts = { treeAdapter: htmlparser2Adapter };
+/**
+ * Renders the given DOM tree with `parse5` and returns the result as a string.
+ *
+ * @param dom - The DOM tree to render.
+ * @returns The rendered document.
+ */
+export function renderWithParse5(dom) {
+    /*
+     * `dom-serializer` passes over the special "root" node and renders the
+     * node's children in its place. To mimic this behavior with `parse5`, an
+     * equivalent operation must be applied to the input array.
+     */
+    const nodes = 'length' in dom ? dom : [dom];
+    for (let index = 0; index < nodes.length; index += 1) {
+        const node = nodes[index];
+        if (isDocument(node)) {
+            Array.prototype.splice.call(nodes, index, 1, ...node.children);
+        }
+    }
+    let result = '';
+    for (let index = 0; index < nodes.length; index += 1) {
+        const node = nodes[index];
+        result += serializeOuter(node, renderOpts);
+    }
+    return result;
+}
+//# sourceMappingURL=parse5-adapter.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/parsers/parse5-adapter.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"parse5-adapter.js","sourceRoot":"","sources":["../../../src/parsers/parse5-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,OAAwB,EACxB,UAAmB,EACnB,OAA0B;;IAE1B,MAAA,OAAO,CAAC,WAAW,oCAAnB,OAAO,CAAC,WAAW,GAAK,kBAAkB,EAAC;IAE3C,IAAI,OAAO,CAAC,gBAAgB,KAAK,KAAK,EAAE,CAAC;QACvC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAClC,CAAC;IAED,OAAO,UAAU;QACf,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC;QACjC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,GAAG,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAiC;IAChE;;;;OAIG;IACH,MAAM,KAAK,GAAG,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC5C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,IAAI,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}

+ 25 - 0
async-demo/node_modules/cheerio/dist/browser/slim.d.ts

@@ -0,0 +1,25 @@
+/**
+ * @file Alternative entry point for Cheerio that always uses htmlparser2. This
+ *   way, parse5 won't be loaded, saving some memory.
+ */
+import { type CheerioAPI } from './load.js';
+import { type CheerioOptions } from './options.js';
+import type { AnyNode } from 'domhandler';
+export { contains, merge } from './static.js';
+export type * from './types.js';
+export type { Cheerio } from './cheerio.js';
+export type { CheerioOptions, HTMLParser2Options } from './options.js';
+export type { CheerioAPI } from './load.js';
+/**
+ * Create a querying function, bound to a document created from the provided
+ * markup.
+ *
+ * @param content - Markup to be loaded.
+ * @param options - Options for the created instance.
+ * @param isDocument - Always `false` here, as we are always using
+ *   `htmlparser2`.
+ * @returns The loaded document.
+ * @see {@link https://cheerio.js.org#loading} for additional usage information.
+ */
+export declare const load: (content: string | AnyNode | AnyNode[] | Buffer, options?: CheerioOptions | null, isDocument?: boolean) => CheerioAPI;
+//# sourceMappingURL=slim.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/slim.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"slim.d.ts","sourceRoot":"","sources":["../../src/slim.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,UAAU,EAAW,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC9C,mBAAmB,YAAY,CAAC;AAChC,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,EAAE,CACjB,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,MAAM,EAC9C,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,EAC/B,UAAU,CAAC,EAAE,OAAO,KACjB,UAAqD,CAAC"}

+ 22 - 0
async-demo/node_modules/cheerio/dist/browser/slim.js

@@ -0,0 +1,22 @@
+/**
+ * @file Alternative entry point for Cheerio that always uses htmlparser2. This
+ *   way, parse5 won't be loaded, saving some memory.
+ */
+import { getLoad } from './load.js';
+import { getParse } from './parse.js';
+import render from 'dom-serializer';
+import { parseDocument } from 'htmlparser2';
+export { contains, merge } from './static.js';
+/**
+ * Create a querying function, bound to a document created from the provided
+ * markup.
+ *
+ * @param content - Markup to be loaded.
+ * @param options - Options for the created instance.
+ * @param isDocument - Always `false` here, as we are always using
+ *   `htmlparser2`.
+ * @returns The loaded document.
+ * @see {@link https://cheerio.js.org#loading} for additional usage information.
+ */
+export const load = getLoad(getParse(parseDocument), render);
+//# sourceMappingURL=slim.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/slim.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"slim.js","sourceRoot":"","sources":["../../src/slim.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAmB,OAAO,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAM9C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,IAAI,GAIC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC"}

+ 112 - 0
async-demo/node_modules/cheerio/dist/browser/static.d.ts

@@ -0,0 +1,112 @@
+import type { BasicAcceptedElems } from './types.js';
+import type { CheerioAPI } from './load.js';
+import type { Cheerio } from './cheerio.js';
+import type { AnyNode, Document } from 'domhandler';
+import { type CheerioOptions } from './options.js';
+import type { ExtractedMap, ExtractMap } from './api/extract.js';
+/**
+ * Renders the document.
+ *
+ * @category Static
+ * @param options - Options for the renderer.
+ * @returns The rendered document.
+ */
+export declare function html(this: CheerioAPI, options?: CheerioOptions): string;
+/**
+ * Renders the document.
+ *
+ * @category Static
+ * @param dom - Element to render.
+ * @param options - Options for the renderer.
+ * @returns The rendered document.
+ */
+export declare function html(this: CheerioAPI, dom?: BasicAcceptedElems<AnyNode>, options?: CheerioOptions): string;
+/**
+ * Render the document as XML.
+ *
+ * @category Static
+ * @param dom - Element to render.
+ * @returns THe rendered document.
+ */
+export declare function xml(this: CheerioAPI, dom?: BasicAcceptedElems<AnyNode>): string;
+/**
+ * Render the document as text.
+ *
+ * This returns the `textContent` of the passed elements. The result will
+ * include the contents of `<script>` and `<style>` elements. To avoid this, use
+ * `.prop('innerText')` instead.
+ *
+ * @category Static
+ * @param elements - Elements to render.
+ * @returns The rendered document.
+ */
+export declare function text(this: CheerioAPI | void, elements?: ArrayLike<AnyNode>): string;
+/**
+ * Parses a string into an array of DOM nodes. The `context` argument has no
+ * meaning for Cheerio, but it is maintained for API compatibility with jQuery.
+ *
+ * @category Static
+ * @param data - Markup that will be parsed.
+ * @param context - Will be ignored. If it is a boolean it will be used as the
+ *   value of `keepScripts`.
+ * @param keepScripts - If false all scripts will be removed.
+ * @returns The parsed DOM.
+ * @alias Cheerio.parseHTML
+ * @see {@link https://api.jquery.com/jQuery.parseHTML/}
+ */
+export declare function parseHTML(this: CheerioAPI, data: string, context?: unknown | boolean, keepScripts?: boolean): AnyNode[];
+export declare function parseHTML(this: CheerioAPI, data?: '' | null): null;
+/**
+ * Sometimes you need to work with the top-level root element. To query it, you
+ * can use `$.root()`.
+ *
+ * @category Static
+ * @example
+ *
+ * ```js
+ * $.root().append('<ul id="vegetables"></ul>').html();
+ * //=> <ul id="fruits">...</ul><ul id="vegetables"></ul>
+ * ```
+ *
+ * @returns Cheerio instance wrapping the root node.
+ * @alias Cheerio.root
+ */
+export declare function root(this: CheerioAPI): Cheerio<Document>;
+/**
+ * Checks to see if the `contained` DOM element is a descendant of the
+ * `container` DOM element.
+ *
+ * @category Static
+ * @param container - Potential parent node.
+ * @param contained - Potential child node.
+ * @returns Indicates if the nodes contain one another.
+ * @alias Cheerio.contains
+ * @see {@link https://api.jquery.com/jQuery.contains/}
+ */
+export declare function contains(container: AnyNode, contained: AnyNode): boolean;
+/**
+ * Extract multiple values from a document, and store them in an object.
+ *
+ * @category Static
+ * @param map - An object containing key-value pairs. The keys are the names of
+ *   the properties to be created on the object, and the values are the
+ *   selectors to be used to extract the values.
+ * @returns An object containing the extracted values.
+ */
+export declare function extract<M extends ExtractMap>(this: CheerioAPI, map: M): ExtractedMap<M>;
+type Writable<T> = {
+    -readonly [P in keyof T]: T[P];
+};
+/**
+ * $.merge().
+ *
+ * @category Static
+ * @param arr1 - First array.
+ * @param arr2 - Second array.
+ * @returns `arr1`, with elements of `arr2` inserted.
+ * @alias Cheerio.merge
+ * @see {@link https://api.jquery.com/jQuery.merge/}
+ */
+export declare function merge<T>(arr1: Writable<ArrayLike<T>>, arr2: ArrayLike<T>): ArrayLike<T> | undefined;
+export {};
+//# sourceMappingURL=static.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/static.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/static.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAwCjE;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;AACzE;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAClB,IAAI,EAAE,UAAU,EAChB,GAAG,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,MAAM,CAAC;AA0BV;;;;;;GAMG;AACH,wBAAgB,GAAG,CACjB,IAAI,EAAE,UAAU,EAChB,GAAG,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAChC,MAAM,CAIR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAClB,IAAI,EAAE,UAAU,GAAG,IAAI,EACvB,QAAQ,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAC5B,MAAM,CAUR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,EAC3B,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,EAAE,CAAC;AACb,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AA8BpE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAExD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAmBxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,UAAU,EAC1C,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,CAAC,GACL,YAAY,CAAC,CAAC,CAAC,CAEjB;AAED,KAAK,QAAQ,CAAC,CAAC,IAAI;IAAE,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEtD;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,CAAC,EACrB,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC5B,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GACjB,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAY1B"}

+ 204 - 0
async-demo/node_modules/cheerio/dist/browser/static.js

@@ -0,0 +1,204 @@
+import { textContent } from 'domutils';
+import { flattenOptions as flattenOptions, } from './options.js';
+/**
+ * Helper function to render a DOM.
+ *
+ * @param that - Cheerio instance to render.
+ * @param dom - The DOM to render. Defaults to `that`'s root.
+ * @param options - Options for rendering.
+ * @returns The rendered document.
+ */
+function render(that, dom, options) {
+    if (!that)
+        return '';
+    return that(dom !== null && dom !== void 0 ? dom : that._root.children, null, undefined, options).toString();
+}
+/**
+ * Checks if a passed object is an options object.
+ *
+ * @param dom - Object to check if it is an options object.
+ * @param options - Options object.
+ * @returns Whether the object is an options object.
+ */
+function isOptions(dom, options) {
+    return (!options &&
+        typeof dom === 'object' &&
+        dom != null &&
+        !('length' in dom) &&
+        !('type' in dom));
+}
+export function html(dom, options) {
+    /*
+     * Be flexible about parameters, sometimes we call html(),
+     * with options as only parameter
+     * check dom argument for dom element specific properties
+     * assume there is no 'length' or 'type' properties in the options object
+     */
+    const toRender = isOptions(dom) ? ((options = dom), undefined) : dom;
+    /*
+     * Sometimes `$.html()` is used without preloading html,
+     * so fallback non-existing options to the default ones.
+     */
+    const opts = {
+        ...this === null || this === void 0 ? void 0 : this._options,
+        ...flattenOptions(options),
+    };
+    return render(this, toRender, opts);
+}
+/**
+ * Render the document as XML.
+ *
+ * @category Static
+ * @param dom - Element to render.
+ * @returns THe rendered document.
+ */
+export function xml(dom) {
+    const options = { ...this._options, xmlMode: true };
+    return render(this, dom, options);
+}
+/**
+ * Render the document as text.
+ *
+ * This returns the `textContent` of the passed elements. The result will
+ * include the contents of `<script>` and `<style>` elements. To avoid this, use
+ * `.prop('innerText')` instead.
+ *
+ * @category Static
+ * @param elements - Elements to render.
+ * @returns The rendered document.
+ */
+export function text(elements) {
+    const elems = elements !== null && elements !== void 0 ? elements : (this ? this.root() : []);
+    let ret = '';
+    for (let i = 0; i < elems.length; i++) {
+        ret += textContent(elems[i]);
+    }
+    return ret;
+}
+export function parseHTML(data, context, keepScripts = typeof context === 'boolean' ? context : false) {
+    if (!data || typeof data !== 'string') {
+        return null;
+    }
+    if (typeof context === 'boolean') {
+        keepScripts = context;
+    }
+    const parsed = this.load(data, this._options, false);
+    if (!keepScripts) {
+        parsed('script').remove();
+    }
+    /*
+     * The `children` array is used by Cheerio internally to group elements that
+     * share the same parents. When nodes created through `parseHTML` are
+     * inserted into previously-existing DOM structures, they will be removed
+     * from the `children` array. The results of `parseHTML` should remain
+     * constant across these operations, so a shallow copy should be returned.
+     */
+    return [...parsed.root()[0].children];
+}
+/**
+ * Sometimes you need to work with the top-level root element. To query it, you
+ * can use `$.root()`.
+ *
+ * @category Static
+ * @example
+ *
+ * ```js
+ * $.root().append('<ul id="vegetables"></ul>').html();
+ * //=> <ul id="fruits">...</ul><ul id="vegetables"></ul>
+ * ```
+ *
+ * @returns Cheerio instance wrapping the root node.
+ * @alias Cheerio.root
+ */
+export function root() {
+    return this(this._root);
+}
+/**
+ * Checks to see if the `contained` DOM element is a descendant of the
+ * `container` DOM element.
+ *
+ * @category Static
+ * @param container - Potential parent node.
+ * @param contained - Potential child node.
+ * @returns Indicates if the nodes contain one another.
+ * @alias Cheerio.contains
+ * @see {@link https://api.jquery.com/jQuery.contains/}
+ */
+export function contains(container, contained) {
+    // According to the jQuery API, an element does not "contain" itself
+    if (contained === container) {
+        return false;
+    }
+    /*
+     * Step up the descendants, stopping when the root element is reached
+     * (signaled by `.parent` returning a reference to the same object)
+     */
+    let next = contained;
+    while (next && next !== next.parent) {
+        next = next.parent;
+        if (next === container) {
+            return true;
+        }
+    }
+    return false;
+}
+/**
+ * Extract multiple values from a document, and store them in an object.
+ *
+ * @category Static
+ * @param map - An object containing key-value pairs. The keys are the names of
+ *   the properties to be created on the object, and the values are the
+ *   selectors to be used to extract the values.
+ * @returns An object containing the extracted values.
+ */
+export function extract(map) {
+    return this.root().extract(map);
+}
+/**
+ * $.merge().
+ *
+ * @category Static
+ * @param arr1 - First array.
+ * @param arr2 - Second array.
+ * @returns `arr1`, with elements of `arr2` inserted.
+ * @alias Cheerio.merge
+ * @see {@link https://api.jquery.com/jQuery.merge/}
+ */
+export function merge(arr1, arr2) {
+    if (!isArrayLike(arr1) || !isArrayLike(arr2)) {
+        return;
+    }
+    let newLength = arr1.length;
+    const len = +arr2.length;
+    for (let i = 0; i < len; i++) {
+        arr1[newLength++] = arr2[i];
+    }
+    arr1.length = newLength;
+    return arr1;
+}
+/**
+ * Checks if an object is array-like.
+ *
+ * @category Static
+ * @param item - Item to check.
+ * @returns Indicates if the item is array-like.
+ */
+function isArrayLike(item) {
+    if (Array.isArray(item)) {
+        return true;
+    }
+    if (typeof item !== 'object' ||
+        item === null ||
+        !('length' in item) ||
+        typeof item.length !== 'number' ||
+        item.length < 0) {
+        return false;
+    }
+    for (let i = 0; i < item.length; i++) {
+        if (!(i in item)) {
+            return false;
+        }
+    }
+    return true;
+}
+//# sourceMappingURL=static.js.map

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
async-demo/node_modules/cheerio/dist/browser/static.js.map


+ 21 - 0
async-demo/node_modules/cheerio/dist/browser/types.d.ts

@@ -0,0 +1,21 @@
+/** @file Types used in signatures of Cheerio methods. */
+type LowercaseLetters = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z';
+type AlphaNumeric = LowercaseLetters | Uppercase<LowercaseLetters> | `${number}`;
+type SelectorSpecial = '.' | '#' | ':' | '|' | '>' | '+' | '~' | '[';
+/**
+ * Type for identifying selectors. Allows us to "upgrade" queries using
+ * selectors to return `Element`s.
+ */
+export type SelectorType = `${SelectorSpecial}${AlphaNumeric}${string}` | `${AlphaNumeric}${string}`;
+import type { Cheerio } from './cheerio.js';
+import type { AnyNode } from 'domhandler';
+/** Elements that can be passed to manipulation methods. */
+export type BasicAcceptedElems<T extends AnyNode> = ArrayLike<T> | T | string;
+/** Elements that can be passed to manipulation methods, including functions. */
+export type AcceptedElems<T extends AnyNode> = BasicAcceptedElems<T> | ((this: T, i: number, el: T) => BasicAcceptedElems<T>);
+/** Function signature, for traversal methods. */
+export type FilterFunction<T> = (this: T, i: number, el: T) => boolean;
+/** Supported filter types, for traversal methods. */
+export type AcceptedFilters<T> = string | FilterFunction<T> | T | Cheerio<T>;
+export {};
+//# sourceMappingURL=types.d.ts.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/types.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,KAAK,gBAAgB,GACjB,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAER,KAAK,YAAY,GACb,gBAAgB,GAChB,SAAS,CAAC,gBAAgB,CAAC,GAC3B,GAAG,MAAM,EAAE,CAAC;AAEhB,KAAK,eAAe,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACrE;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,GAAG,eAAe,GAAG,YAAY,GAAG,MAAM,EAAE,GAC5C,GAAG,YAAY,GAAG,MAAM,EAAE,CAAC;AAE/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,2DAA2D;AAC3D,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC9E,gFAAgF;AAChF,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,OAAO,IACvC,kBAAkB,CAAC,CAAC,CAAC,GACrB,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D,iDAAiD;AACjD,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC;AACvE,qDAAqD;AACrD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC"}

+ 3 - 0
async-demo/node_modules/cheerio/dist/browser/types.js

@@ -0,0 +1,3 @@
+/** @file Types used in signatures of Cheerio methods. */
+export {};
+//# sourceMappingURL=types.js.map

+ 1 - 0
async-demo/node_modules/cheerio/dist/browser/types.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,yDAAyD"}

+ 55 - 0
async-demo/node_modules/cheerio/dist/browser/utils.d.ts

@@ -0,0 +1,55 @@
+import type { AnyNode } from 'domhandler';
+import type { Cheerio } from './cheerio.js';
+/**
+ * Checks if an object is a Cheerio instance.
+ *
+ * @category Utils
+ * @param maybeCheerio - The object to check.
+ * @returns Whether the object is a Cheerio instance.
+ */
+export declare function isCheerio<T>(maybeCheerio: any): maybeCheerio is Cheerio<T>;
+/**
+ * Convert a string to camel case notation.
+ *
+ * @private
+ * @category Utils
+ * @param str - The string to be converted.
+ * @returns String in camel case notation.
+ */
+export declare function camelCase(str: string): string;
+/**
+ * Convert a string from camel case to "CSS case", where word boundaries are
+ * described by hyphens ("-") and all characters are lower-case.
+ *
+ * @private
+ * @category Utils
+ * @param str - The string to be converted.
+ * @returns String in "CSS case".
+ */
+export declare function cssCase(str: string): string;
+/**
+ * Iterate over each DOM element without creating intermediary Cheerio
+ * instances.
+ *
+ * This is indented for use internally to avoid otherwise unnecessary memory
+ * pressure introduced by _make.
+ *
+ * @category Utils
+ * @param array - The array to iterate over.
+ * @param fn - Function to call.
+ * @returns The original instance.
+ */
+export declare function domEach<T extends AnyNode, Arr extends ArrayLike<T> = Cheerio<T>>(array: Arr, fn: (elem: T, index: number) => void): Arr;
+/**
+ * Check if string is HTML.
+ *
+ * Tests for a `<` within a string, immediate followed by a letter and
+ * eventually followed by a `>`.
+ *
+ * @private
+ * @category Utils
+ * @param str - The string to check.
+ * @returns Indicates if `str` is HTML.
+ */
+export declare function isHtml(str: string): boolean;
+//# sourceMappingURL=utils.d.ts.map

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است