diff --git a/about.md b/about.md deleted file mode 100644 index 70cd374..0000000 --- a/about.md +++ /dev/null @@ -1,58 +0,0 @@ -## About Library Map - -This project maps data from public libraries across the Australia and the external Australian Territories of Christmas Island and the Cocos (Keeling) Islands. In the long term I hope to include more data that can be combined and cross-referenced, e.g. library funding from local and state governments, HILDA data etc. - -You should be able to find: - -* the location of every public library in Australia territory, plus -* the standard loan period for each libary service, and -* whether they charge overdue fines, and -* which integrated library system (ILS/LMS) each library service uses - -### Why this data? - -When I worked as a systems librarian in public libraries I often wondered how the social networks of decision makers - most obviously reflected by geography and state borders - affected decision making on things like library sofware procurement. I thought mapping systems visually might reveal things that are less obvious on a simple table or list. - -Rules about **loan periods** are arbitrary. I thought it might be interesting to see whether there are any regional trends. I'm surprised by some of the results — do some libraries really have a standard loan period of six weeks? Seems kind of long. Why do so many rural libraries only lend items for two weeks? Is it because country people read faster, or something to do with limited book stock? 🤔 - -**Fines for overdue library books** are inefficient, ineffective, perverse, and regressive. "Punishable by fine" simply means "legal for rich people". Mapping library fine regimes provides a view of any regional patterns, helps library managers to identify nearby colleagues who have already made their library fine-free and may be able to provide advice, and also allows activists to identify which libraries and local councils would benefit from some encouragement. - -### Definitions - -#### Overdue fines - -A library service is classified as charging fines for overdue items if any kind of non-refundable fee is charged prior to **28 days overdue**. This period has been chosen because some libraries declare an item "lost" around that time, and invoice the borrower for a *replacement fee*. Designating these libraries as "not charging overdue fines" and others that charge e.g. a "notice fee" at the same cutoff time as "charging overdue fines" starts to get a bit weird. - -#### Fines for children - -Some libraries charge fines or fees for late-returned items, but exempt members who are under the age of (variously) 12, 16, 17, or 18; and/or for items designated as "for children". Rather than creating my own specific definition I classify all libraries with a fine regime like this as "no fines for children". Wouldn't it be better if they just didn't charge overdue fines at all? - -#### Standard loan period - -The "standard loan period" is the loan period applied to an ordinary book, and may apply to other items or indeed all items held in a library. Data for Western Australia is provisional and in some cases has been rounded to the nearest "week" (e.g. a 19 day loan period is recorded as 3 weeks). - -#### Indigenous Knowledge Centre - -Currently, only libraries classified as *Indigenous Knowledge Centres* by the State Library of Queensland are classified as such on this map. In future there may be other centres so identified. - -### Caveats - -Most of the data for the map comes from government open data sources. As such it is subject to government bias, and may be out of date or over/under sampled. I make no claim or warranty that the data being complete, accurate, or up to date — though I aim for it to be all of those things. If in doubt, always check with the library directly. - -### Nomenclature - -Library locations are classified into four types. In general mode these are: - -* Settler Knowledge Centres -* Indigenous Knowledge Centres -* Mechanics Institutes -* Colonial Knowledge Centres - -If this naming convention is confusing, you may view the map in *Colonial mode*, in which case the names are: - -* Public Libraries -* Indigenous Knowledge Centres -* Mechanics Institutes -* National & State Libraries - -Standard Mode invites you to think about the work these institutions do to normalise certain types of knowledge and not others. diff --git a/contributing.md b/contributing.md deleted file mode 100644 index e8e1ed9..0000000 --- a/contributing.md +++ /dev/null @@ -1,63 +0,0 @@ -## Contributing - -I'd love your help to make *Library Map* as accurate and useful as possible. - -### How to contribute your idea, bug report or improvement - -1. Look at the [current GitHub issues tagged `help wanted`](https://github.com/hughrun/public_library_map/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) to see if you can help. Most of these will be to do with updating data, like finding street addresses or other information. -2. You can [create a new issue](https://github.com/hughrun/public_library_map/issues) on GitHub. -3. You can [send a pull request](https://docs.github.com/en/github/.collaborating-with-issues-and-pull-requests/about-pull-requests) — though it is *strongly preferred* that you either ask to be assigned to an existing issue (so everyone knows you're working on it), or create a new issue, first. -4. You can just send an email to `librarymap`@`hugh`.`run` and ask me to fix/add something. - -### If you have not used Git or GitHub before - -There is a class outline for an [introduction to Git and GitHub aimed at librarians](https://librarycarpentry.org/lc-git/) at `librarycarpentry.org`. This assumes you are using the command line. If you create or already have a GitHub account, you can also [edit files directly in the browser](https://docs.github.com/en/github/managing-files-in-a-repository/editing-files-in-another-users-repository), or use [GitHub Desktop](https://desktop.github.com/) - both of which are probably less intimidating options if you don't have any desire to learn how to use a command line/shell interface, or just want to make a single minor update. - -### Which files to update - -To update information about library *services* (e.g. fines info, loan period etc) you should edit `website/data/library_services_information.csv`. - -To update information about library *locations* (e.g. street address, phone number, coordinates) you should edit the relevant csv location file: - -* `website/data/indigenous_knowledge_centre_locations.csv` -* `website/data/mechanics_institute_locations.csv` -* `website/data/nsla_library_locations.csv` -* `website/data/public_library_locations.csv` - -After your Pull Request is merged, a script will automatically merge data from `website/data/library_services_information.csv` into `website/data/boundaries.topo.json`. Please do not edit the `topo.json` file directly. - -### Citing and crediting data sources - -If you are adding a lot of data and have a new source for it, make sure it is cited. You should update the list of sources at both `sources.md` *and* `website/sources/index.html`. If your source is "I just know because it's my local library" or "I looked it up on their website" you don't need to add that to the list of sources. If your source is "I found a PDF listing every public library on the State Library website", you do. - -### Missing or inaccurate data - -Currently we're missing data for some library services in relation to **standard loan periods** and **fines for overdue items**. Any acurate and specific information about fines for South and Western Australia would be particularly helpful. - -It's likely that some **library location data** is inaccurate — especially for New South Wales. It's also possible that the address data is wrong (even though the location shown may be correct), and in some cases it is missing. - -It's possible that some of the **fines data for Queensland** is a little off. This came from the State Library of Queensland but some of the data was wrong (e.g. Gold Coast Libraries does not charge overdue fines, but the SLQ report says it does). - -I am particularly interested if you know of data sources for entire regions, states, or Australia — especially if they're reliably kept up to date. - -If you can fill in any of these blanks, please update the relevant CSV file and send a pull request. If your data is coming from somewhere in particular, you should also add that to `sources.md` in the relevant table. - -### Ideas for additional data - -You might have an idea for library data that would be useful to map. I'm really happy to hear about these ideas! It's possible that the information you want to map is unavailable, or just really hard to get, or maybe I will disagree that it's useful. That's ok - please ask anyway, especially if you know where to find the data. - -### Improvements to documentation - -I'm always — *always* — happy to hear how I can improve documentation. Even better if you make the edit and then send a pull request. - -### Improvements to the website design, layout, or information - -You might have an idea for an improvement that's not about the data per se, but rather about the website. Maybe there's some accessibility improvements I can make. Let me know! - -### Licensing and copyright - -By contributing to this project you agree to license your work under the following licenses: - -**/website/data/\***: [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/) - -**everything else**: [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/fines.md b/fines.md deleted file mode 100644 index 75da6cd..0000000 --- a/fines.md +++ /dev/null @@ -1,26 +0,0 @@ -## Library fines punish the poor and don't work - -Library fines are a flat charge disproportionately impacting people who are most likely to have difficulty maintaining a reliably-scheduled life and least likely to be able to pay — that is, people with insecure work and housing. - -There have been few studies on the effectiveness of library fines in the last decade, and most were in academic libraries. They tend to indicate either a very minor statistically significant effect on rates of items being returned on time, or no correlation at all. On the other hand, libraries that remove overdue fines anecdotally report: - -* Large increases in borrowing and general use of the library; -* Significant improvements in the public perception of and satisfaction with the library. - -So the onus should be on those arguing to retain fines to prove that _fining people for returning items late actually works_ as an effective incentive for timely return of items compared to other less punitive approaches. - -"Removing overdue fines" does not equal "No consequences for returning items late or not returning them at all". Equally, "Fining for overdues" does not equal "All items are eventually returned". - -Every library, regardless of whether they impose fines or not, has a level of "shrinkage" in the collection that has to eventually be written off. Typically libraries that have removed fines (and indeed also those that haven't) use some or all of the following techniques to get things flowing through the system: - -* reminder notices (via email, SMS and sometimes post) just before and at various points after the due date; -* limits on total loans so that people can't take out hundreds of items and disappear; -* restrictions on new borrowing if any items are overdue; -* restrictions on use of all library services (e.g. WiFi, PCs, placing a hold on an item) if any items are overdue; -* items declared lost and a "lost item" invoice sent after they are due for a certain number of days (typically 60, sometimes as low as 30); -* incentives such as increased borrowing or reservation limits for borrowers who do not have any overdues for a certain period of time (e.g. in the previous year). - -### Further reading - -- Ayre, Lori Bowen (2019), [Cents and Sensibility: Late fees do not belong in public libraries](https://digitalcommons.du.edu/collaborativelibrarianship/vol11/iss2/3/), _Collaborative Librarianship_: Vol. 11 : Iss. 2; -- Unrein, Sabrina. (2020). [Overdue Fines: Advantages, Disadvantages, and How Eliminating Them Can Benefit Public Libraries.](https://ischool.syr.edu/wp-content/uploads/2020/06/Overdue-Fines-Advantages-Disadvantages-and-How-Eliminating-Them-Can-Benefit-Public-Libraries.pdf) Syracuse, NY: iSchool Public Libraries Initiative at Syracuse University. \ No newline at end of file diff --git a/node_modules/.bin/css-beautify b/node_modules/.bin/css-beautify deleted file mode 120000 index d9b8ee2..0000000 --- a/node_modules/.bin/css-beautify +++ /dev/null @@ -1 +0,0 @@ -../js-beautify/js/bin/css-beautify.js \ No newline at end of file diff --git a/node_modules/.bin/editorconfig b/node_modules/.bin/editorconfig deleted file mode 120000 index a151e0b..0000000 --- a/node_modules/.bin/editorconfig +++ /dev/null @@ -1 +0,0 @@ -../editorconfig/bin/editorconfig \ No newline at end of file diff --git a/node_modules/.bin/html-beautify b/node_modules/.bin/html-beautify deleted file mode 120000 index c17c69c..0000000 --- a/node_modules/.bin/html-beautify +++ /dev/null @@ -1 +0,0 @@ -../js-beautify/js/bin/html-beautify.js \ No newline at end of file diff --git a/node_modules/.bin/js-beautify b/node_modules/.bin/js-beautify deleted file mode 120000 index 548ddf4..0000000 --- a/node_modules/.bin/js-beautify +++ /dev/null @@ -1 +0,0 @@ -../js-beautify/js/bin/js-beautify.js \ No newline at end of file diff --git a/node_modules/.bin/nopt b/node_modules/.bin/nopt deleted file mode 120000 index 6b6566e..0000000 --- a/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver deleted file mode 120000 index 317eb29..0000000 --- a/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver \ No newline at end of file diff --git a/node_modules/abbrev/LICENSE b/node_modules/abbrev/LICENSE deleted file mode 100644 index 9bcfa9d..0000000 --- a/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -This software is dual-licensed under the ISC and MIT licenses. -You may use this software under EITHER of the following licenses. - ----------- - -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ----------- - -Copyright Isaac Z. Schlueter and Contributors -All rights reserved. - -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. diff --git a/node_modules/abbrev/README.md b/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe..0000000 --- a/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# abbrev-js - -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). - -Usage: - - var abbrev = require("abbrev"); - abbrev("foo", "fool", "folding", "flop"); - - // returns: - { fl: 'flop' - , flo: 'flop' - , flop: 'flop' - , fol: 'folding' - , fold: 'folding' - , foldi: 'folding' - , foldin: 'folding' - , folding: 'folding' - , foo: 'foo' - , fool: 'fool' - } - -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/node_modules/abbrev/abbrev.js b/node_modules/abbrev/abbrev.js deleted file mode 100644 index 7b1dc5d..0000000 --- a/node_modules/abbrev/abbrev.js +++ /dev/null @@ -1,61 +0,0 @@ -module.exports = exports = abbrev.abbrev = abbrev - -abbrev.monkeyPatch = monkeyPatch - -function monkeyPatch () { - Object.defineProperty(Array.prototype, 'abbrev', { - value: function () { return abbrev(this) }, - enumerable: false, configurable: true, writable: true - }) - - Object.defineProperty(Object.prototype, 'abbrev', { - value: function () { return abbrev(Object.keys(this)) }, - enumerable: false, configurable: true, writable: true - }) -} - -function abbrev (list) { - if (arguments.length !== 1 || !Array.isArray(list)) { - list = Array.prototype.slice.call(arguments, 0) - } - for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { - args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) - } - - // sort them lexicographically, so that they're next to their nearest kin - args = args.sort(lexSort) - - // walk through each, seeing how much it has in common with the next and previous - var abbrevs = {} - , prev = "" - for (var i = 0, l = args.length ; i < l ; i ++) { - var current = args[i] - , next = args[i + 1] || "" - , nextMatches = true - , prevMatches = true - if (current === next) continue - for (var j = 0, cl = current.length ; j < cl ; j ++) { - var curChar = current.charAt(j) - nextMatches = nextMatches && curChar === next.charAt(j) - prevMatches = prevMatches && curChar === prev.charAt(j) - if (!nextMatches && !prevMatches) { - j ++ - break - } - } - prev = current - if (j === cl) { - abbrevs[current] = current - continue - } - for (var a = current.substr(0, j) ; j <= cl ; j ++) { - abbrevs[a] = current - a += current.charAt(j) - } - } - return abbrevs -} - -function lexSort (a, b) { - return a === b ? 0 : a > b ? 1 : -1 -} diff --git a/node_modules/abbrev/package.json b/node_modules/abbrev/package.json deleted file mode 100644 index bf4e801..0000000 --- a/node_modules/abbrev/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "abbrev", - "version": "1.1.1", - "description": "Like ruby's abbrev module, but in js", - "author": "Isaac Z. Schlueter ", - "main": "abbrev.js", - "scripts": { - "test": "tap test.js --100", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "repository": "http://github.com/isaacs/abbrev-js", - "license": "ISC", - "devDependencies": { - "tap": "^10.1" - }, - "files": [ - "abbrev.js" - ] -} diff --git a/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/balanced-match/.github/FUNDING.yml deleted file mode 100644 index cea8b16..0000000 --- a/node_modules/balanced-match/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -tidelift: "npm/balanced-match" -patreon: juliangruber diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e4..0000000 --- a/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. diff --git a/node_modules/balanced-match/README.md b/node_modules/balanced-match/README.md deleted file mode 100644 index d2a48b6..0000000 --- a/node_modules/balanced-match/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. diff --git a/node_modules/balanced-match/index.js b/node_modules/balanced-match/index.js deleted file mode 100644 index c67a646..0000000 --- a/node_modules/balanced-match/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - if(a===b) { - return [ai, bi]; - } - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json deleted file mode 100644 index ce6073e..0000000 --- a/node_modules/balanced-match/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "1.0.2", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "tape test/test.js", - "bench": "matcha test/bench.js" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/boolbase/README.md b/node_modules/boolbase/README.md deleted file mode 100644 index 85eefa5..0000000 --- a/node_modules/boolbase/README.md +++ /dev/null @@ -1,10 +0,0 @@ -#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. \ No newline at end of file diff --git a/node_modules/boolbase/index.js b/node_modules/boolbase/index.js deleted file mode 100644 index 8799fd9..0000000 --- a/node_modules/boolbase/index.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - trueFunc: function trueFunc(){ - return true; - }, - falseFunc: function falseFunc(){ - return false; - } -}; \ No newline at end of file diff --git a/node_modules/boolbase/package.json b/node_modules/boolbase/package.json deleted file mode 100644 index 78330a8..0000000 --- a/node_modules/boolbase/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "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 ", - "license": "ISC", - "bugs": { - "url": "https://github.com/fb55/boolbase/issues" - }, - "homepage": "https://github.com/fb55/boolbase" -} diff --git a/node_modules/brace-expansion/LICENSE b/node_modules/brace-expansion/LICENSE deleted file mode 100644 index de32266..0000000 --- a/node_modules/brace-expansion/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 Julian Gruber - -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. diff --git a/node_modules/brace-expansion/README.md b/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e1..0000000 --- a/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be8..0000000 --- a/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json deleted file mode 100644 index a18faa8..0000000 --- a/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh", - "bench": "matcha test/perf/bench.js" - }, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/cheerio-select/LICENSE b/node_modules/cheerio-select/LICENSE deleted file mode 100644 index c464f86..0000000 --- a/node_modules/cheerio-select/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -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. diff --git a/node_modules/cheerio-select/README.md b/node_modules/cheerio-select/README.md deleted file mode 100644 index 140a661..0000000 --- a/node_modules/cheerio-select/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# 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. diff --git a/node_modules/cheerio-select/lib/helpers.d.ts b/node_modules/cheerio-select/lib/helpers.d.ts deleted file mode 100644 index 13dba26..0000000 --- a/node_modules/cheerio-select/lib/helpers.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -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 \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/helpers.d.ts.map b/node_modules/cheerio-select/lib/helpers.d.ts.map deleted file mode 100644 index 689bf8d..0000000 --- a/node_modules/cheerio-select/lib/helpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/helpers.js b/node_modules/cheerio-select/lib/helpers.js deleted file mode 100644 index f996a6c..0000000 --- a/node_modules/cheerio-select/lib/helpers.js +++ /dev/null @@ -1,26 +0,0 @@ -"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 \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/index.d.ts b/node_modules/cheerio-select/lib/index.d.ts deleted file mode 100644 index 9b6baff..0000000 --- a/node_modules/cheerio-select/lib/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -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 { - /** 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 \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/index.d.ts.map b/node_modules/cheerio-select/lib/index.d.ts.map deleted file mode 100644 index 4127f83..0000000 --- a/node_modules/cheerio-select/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/index.js b/node_modules/cheerio-select/lib/index.js deleted file mode 100644 index 9366d71..0000000 --- a/node_modules/cheerio-select/lib/index.js +++ /dev/null @@ -1,302 +0,0 @@ -"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 \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/positionals.d.ts b/node_modules/cheerio-select/lib/positionals.d.ts deleted file mode 100644 index 5315dd3..0000000 --- a/node_modules/cheerio-select/lib/positionals.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -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; -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 \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/positionals.d.ts.map b/node_modules/cheerio-select/lib/positionals.d.ts.map deleted file mode 100644 index 0e0db37..0000000 --- a/node_modules/cheerio-select/lib/positionals.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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"} \ No newline at end of file diff --git a/node_modules/cheerio-select/lib/positionals.js b/node_modules/cheerio-select/lib/positionals.js deleted file mode 100644 index 754bb25..0000000 --- a/node_modules/cheerio-select/lib/positionals.js +++ /dev/null @@ -1,52 +0,0 @@ -"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 \ No newline at end of file diff --git a/node_modules/cheerio-select/package.json b/node_modules/cheerio-select/package.json deleted file mode 100644 index 96b34cb..0000000 --- a/node_modules/cheerio-select/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "cheerio-select", - "description": "CSS selector engine supporting jQuery selectors", - "version": "2.1.0", - "author": "Felix Boehm ", - "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 - } -} diff --git a/node_modules/cheerio/LICENSE b/node_modules/cheerio/LICENSE deleted file mode 100644 index b0c8b19..0000000 --- a/node_modules/cheerio/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/node_modules/cheerio/Readme.md b/node_modules/cheerio/Readme.md deleted file mode 100644 index 2fba04f..0000000 --- a/node_modules/cheerio/Readme.md +++ /dev/null @@ -1,357 +0,0 @@ -

cheerio

- -
Fast, flexible & lean implementation of core jQuery designed specifically for the server.
- -
- -
- -[中文文档 (Chinese Readme)](https://github.com/cheeriojs/cheerio/wiki/Chinese-README) - -```js -const cheerio = require('cheerio'); -const $ = cheerio.load('

Hello world

'); - -$('h2.title').text('Hello there!'); -$('h2').addClass('welcome'); - -$.html(); -//=>

Hello there!

-``` - -## Note - -We are currently working on the 1.0.0 release of cheerio on the `main` branch. The source code for the last published version, `0.22.0`, can be found [here](https://github.com/cheeriojs/cheerio/tree/aa90399c9c02f12432bfff97b8f1c7d8ece7c307). - -## Installation - -`npm install cheerio` - -## Features - -**❤ Familiar 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. - -**ϟ Blazingly fast:** -Cheerio works with a very simple, consistent DOM model. As a result parsing, manipulating, and rendering are incredibly efficient. - -**❁ Incredibly flexible:** -Cheerio wraps around [parse5](https://github.com/inikulin/parse5) parser and can optionally use @FB55's forgiving [htmlparser2](https://github.com/fb55/htmlparser2/). Cheerio can parse nearly any HTML or XML document. - -## Cheerio is not a web browser - -Cheerio parses markup and provides an API for traversing/manipulating the resulting data structure. It does not interpret the result as a web browser does. Specifically, it does _not_ produce a visual rendering, apply CSS, load external resources, or execute JavaScript which is common for a SPA (single page application). This makes Cheerio **much, much faster than other solutions**. If your use case requires any of this functionality, you should consider browser automation software like [Puppeteer](https://github.com/puppeteer/puppeteer) and [Playwright](https://github.com/microsoft/playwright) or DOM emulation projects like [JSDom](https://github.com/jsdom/jsdom). - -## API - -### Markup example we'll be using: - -```html -
    -
  • Apple
  • -
  • Orange
  • -
  • Pear
  • -
-``` - -This is the HTML markup we will be using in all of the API examples. - -### 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. - -This is the _preferred_ method: - -```js -// ES6 or TypeScript: -import * as cheerio from 'cheerio'; - -// In other environments: -const cheerio = require('cheerio'); - -const $ = cheerio.load('
    ...
'); - -$.html(); -//=>
    ...
-``` - -Similar to web browser contexts, `load` will introduce ``, ``, and `` elements if they are not already present. You can set `load`'s third argument to `false` to disable this. - -```js -const $ = cheerio.load('
    ...
', null, false); - -$.html(); -//=> '
    ...
' -``` - -Optionally, you can also load in the HTML by passing the string as the context: - -```js -$('ul', '
    ...
'); -``` - -Or as the root: - -```js -$('li', 'ul', '
    ...
'); -``` - -If you need to modify parsing options for XML input, you may pass an extra -object to `.load()`: - -```js -const $ = cheerio.load('
    ...
', { - xml: { - normalizeWhitespace: true, - }, -}); -``` - -The options in the `xml` object are taken directly from [htmlparser2](https://github.com/fb55/htmlparser2/wiki/Parser-options), therefore any options that can be used in `htmlparser2` are valid in cheerio as well. When `xml` is set, the default options are: - -```js -{ - xmlMode: true, - decodeEntities: true, // Decode HTML entities. - withStartIndices: false, // Add a `startIndex` property to nodes. - withEndIndices: false, // Add an `endIndex` property to nodes. -} -``` - -For a full list of options and their effects, see [domhandler](https://github.com/fb55/DomHandler) and -[htmlparser2's options](https://github.com/fb55/htmlparser2/wiki/Parser-options). - -#### Using `htmlparser2` - -Cheerio ships with two parsers, `parse5` and `htmlparser2`. The -former is the default for HTML, the latter the default for XML. - -Some users may wish to parse markup with the `htmlparser2` library, and -traverse/manipulate the resulting structure with Cheerio. This may be the case -for those upgrading from pre-1.0 releases of Cheerio (which relied on -`htmlparser2`), for those dealing with invalid markup (because `htmlparser2` is -more forgiving), or for those operating in performance-critical situations -(because `htmlparser2` may be faster in some cases). Note that "more forgiving" -means `htmlparser2` has error-correcting mechanisms that aren't always a match -for the standards observed by web browsers. This behavior may be useful when -parsing non-HTML content. - -To support these cases, `load` also accepts a `htmlparser2`-compatible data -structure as its first argument. Users may install `htmlparser2`, use it to -parse input, and pass the result to `load`: - -```js -// Usage as of htmlparser2 version 6: -const htmlparser2 = require('htmlparser2'); -const dom = htmlparser2.parseDocument(document, options); - -const $ = cheerio.load(dom); -``` - -If you want to save some bytes, you can use Cheerio's _slim_ export, which -always uses `htmlparser2`: - -```js -const cheerio = require('cheerio/lib/slim'); -``` - -### Selectors - -Cheerio's selector implementation is nearly identical to jQuery's, so the API is very similar. - -#### \$( 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` is typically the HTML document string. - -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. - -```js -$('.apple', '#fruits').text(); -//=> Apple - -$('ul .pear').attr('class'); -//=> pear - -$('li[class=orange]').html(); -//=> Orange -``` - -##### XML Namespaces - -You can select with XML Namespaces but [due to the CSS specification](https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#attribute-selectors), the colon (`:`) needs to be escaped for the selector to be valid. - -```js -$('[xml\\:id="main"'); -``` - -### Rendering - -When you're ready to render the document, you can call the `html` method on the "root" selection: - -```js -$.root().html(); -//=> -// -// -//
    -//
  • Apple
  • -//
  • Orange
  • -//
  • Pear
  • -//
-// -// -``` - -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 `html` utility functon: - -```js -cheerio.html($('.pear')); -//=>
  • Pear
  • -``` - -You may also render the text content of a Cheerio object using the `text` static method: - -```js -const $ = cheerio.load('This is content.'); -cheerio.text($('body')); -//=> This is content. -``` - -### Plugins - -Once you have loaded a document, you may extend the prototype or the equivalent `fn` property with custom plugin methods: - -```js -const $ = cheerio.load('Hello, world!'); -$.prototype.logHtml = function () { - console.log(this.html()); -}; - -$('body').logHtml(); // logs "Hello, world!" to the console -``` - -If you're using TypeScript, you should add a type definition for your new method: - -```ts -declare module 'cheerio' { - interface Cheerio { - logHtml(this: Cheerio): void; - } -} -``` - -### 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. - - - - - GitHub - - - CryptoCasinos - - - Casinoonlineaams.com - - - Casinofiables.com - - - Apify - - - Free Bets - - - Casino utan svensk licens - - - Casino utan svensk licens - - - - -## 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. - - - - - Airbnb - - - Vasy Kafidoff - - - Espen Klem - - - Jarrod Davis - - - Nishant Singh - - - Gautham Chandra - - - Charles Severance - - - - -## Special Thanks - -This library stands on the shoulders of some incredible developers. A special thanks to: - -**• @FB55 for node-htmlparser2 & CSSSelect:** -Felix has a knack for writing speedy parsing engines. He completely re-wrote both @tautologistic's `node-htmlparser` and @harry's `node-soupselect` from the ground up, making both of them much faster and more flexible. Cheerio would not be possible without his foundational work - -**• @jQuery team for jQuery:** -The core API is the best of its class and despite dealing with all the browser inconsistencies the code base is extremely clean and easy to follow. Much of cheerio's implementation and documentation is from jQuery. Thanks guys. - -**• @visionmedia:** -The style, the structure, the open-source"-ness" of this library comes from studying TJ's style and using many of his libraries. This dude consistently pumps out high-quality libraries and has always been more than willing to help or answer questions. You rock TJ. - -## License - -MIT diff --git a/node_modules/cheerio/lib/api/attributes.d.ts b/node_modules/cheerio/lib/api/attributes.d.ts deleted file mode 100644 index a310693..0000000 --- a/node_modules/cheerio/lib/api/attributes.d.ts +++ /dev/null @@ -1,332 +0,0 @@ -/** - * Methods for getting and modifying attributes. - * - * @module cheerio/attributes - */ -import type { AnyNode, 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(this: Cheerio, 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(this: Cheerio): Record | 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(); - * //=>
  • Apple
  • - * ``` - * - * @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(this: Cheerio, name: string, value?: string | null | ((this: Element, i: number, attrib: string) => string | null)): Cheerio; -/** - * 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(); - * //=>
  • Apple
  • - * ``` - * - * @param values - Map of attribute names and values. - * @returns The instance itself. - * @see {@link https://api.jquery.com/attr/} - */ -export declare function attr(this: Cheerio, values: Record): Cheerio; -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. - * @param value - If specified set the property to this. - * @returns If `value` is specified the instance itself, otherwise the prop's value. - * @see {@link https://api.jquery.com/prop/} - */ -export declare function prop(this: Cheerio, name: 'tagName' | 'nodeName'): T extends Element ? string : undefined; -export declare function prop(this: Cheerio, name: 'innerHTML' | 'outerHTML' | 'innerText' | 'textContent'): string | null; -/** Get a parsed CSS style object. */ -export declare function prop(this: Cheerio, 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 - * $('').prop('src'); - * //=> 'https://example.com/image.png' - * ``` - */ -export declare function prop(this: Cheerio, name: 'href' | 'src'): string | undefined; -/** Get a property of an element. */ -export declare function prop(this: Cheerio, name: K): Element[K]; -/** Set a property of an element. */ -export declare function prop(this: Cheerio, name: K, value: Element[K] | ((this: Element, i: number, prop: K) => Element[keyof Element])): Cheerio; -export declare function prop(this: Cheerio, name: Record): Cheerio; -export declare function prop(this: Cheerio, name: string, value: string | boolean | null | ((this: Element, i: number, prop: string) => string | boolean)): Cheerio; -export declare function prop(this: Cheerio, name: string): string; -/** - * Method for getting data attributes, for only the first element in the matched set. - * - * @category Attributes - * @example - * - * ```js - * $('
    ').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(this: Cheerio, 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 - * $('
    ').data(); - * //=> { appleColor: 'red' } - * ``` - * - * @returns A map with all of the data attributes. - * @see {@link https://api.jquery.com/data/} - */ -export declare function data(this: Cheerio): Record; -/** - * 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(this: Cheerio, name: string, value: unknown): Cheerio; -/** - * 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(this: Cheerio, values: Record): Cheerio; -/** - * 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(this: Cheerio): 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(); - * //=> - * ``` - * - * @param value - The new value. - * @returns The instance itself. - * @see {@link https://api.jquery.com/val/} - */ -export declare function val(this: Cheerio, value: string | string[]): Cheerio; -/** - * Method for removing attributes by `name`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').removeAttr('class').html(); - * //=>
  • Pear
  • - * - * $('.apple').attr('id', 'favorite'); - * $('.apple').removeAttr('id class').html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the attribute. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeAttr/} - */ -export declare function removeAttr(this: Cheerio, name: string): Cheerio; -/** - * 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(this: Cheerio, className: string): boolean; -/** - * Adds class(es) to all of the matched elements. Also accepts a `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').addClass('fruit').html(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('fruit red').html(); - * //=>
  • Apple
  • - * ``` - * - * @param value - Name of new class. - * @returns The instance itself. - * @see {@link https://api.jquery.com/addClass/} - */ -export declare function addClass>(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(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('red').removeClass().html(); - * //=>
  • Apple
  • - * ``` - * - * @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>(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(); - * //=>
  • Apple
  • - * - * $('.apple.green').toggleClass('fruit green red', true).html(); - * //=>
  • Apple
  • - * ``` - * - * @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>(this: R, value?: string | ((this: Element, i: number, className: string, stateVal?: boolean) => string), stateVal?: boolean): R; -export {}; -//# sourceMappingURL=attributes.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio/lib/api/attributes.d.ts.map b/node_modules/cheerio/lib/api/attributes.d.ts.map deleted file mode 100644 index d333c5d..0000000 --- a/node_modules/cheerio/lib/api/attributes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attributes.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio/d1cbc66d53392ce8bf6cd0068f675836372d2bf3/src/","sources":["api/attributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AA8F7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAAC;AACtB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;AACtC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EACF,MAAM,GACN,IAAI,GACJ,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC,GAChE,OAAO,CAAC,CAAC,CAAC,CAAC;AACd;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,GACpC,OAAO,CAAC,CAAC,CAAC,CAAC;AAmFd,UAAU,SAAS;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,SAAS,GAAG,UAAU,GAC3B,CAAC,SAAS,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAC1C,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAC5D,MAAM,GAAG,IAAI,CAAC;AACjB,qCAAqC;AACrC,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,OAAO,GACZ,SAAS,GAAG,SAAS,CAAC;AACzB;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,GAAG,KAAK,GACnB,MAAM,GAAG,SAAS,CAAC;AACtB,oCAAoC;AACpC,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,MAAM,OAAO,EAC7D,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,CAAC,GACN,OAAO,CAAC,CAAC,CAAC,CAAC;AACd,oCAAoC;AACpC,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,MAAM,OAAO,EAC7D,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,CAAC,EACP,KAAK,EACD,OAAO,CAAC,CAAC,CAAC,GACV,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,GAClE,OAAO,CAAC,CAAC,CAAC,CAAC;AACd,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,OAAO,CAAC,GAC9D,OAAO,CAAC,CAAC,CAAC,CAAC;AACd,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EACD,MAAM,GACN,OAAO,GACP,IAAI,GACJ,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,GACjE,OAAO,CAAC,CAAC,CAAC,CAAC;AACd,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;AAwMhF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,GAAG,SAAS,CAAC;AACvB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC3B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,CAAC,CAAC,CAAC;AACd;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,OAAO,EACpC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,CAAC,CAAC,CAAC;AAmCd;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GACf,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAAC;AACjC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,EACnC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GACvB,OAAO,CAAC,CAAC,CAAC,CAAC;AAoEd;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,EAC1C,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,CAAC,CAUZ;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,EACxC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAoBT;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EAChE,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EACF,MAAM,GACN,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GACxE,CAAC,CAyCH;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EACnE,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EACD,MAAM,GACN,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GACxE,CAAC,CA2CH;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EACnE,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EACF,MAAM,GACN,CAAC,CACC,IAAI,EAAE,OAAO,EACb,CAAC,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,OAAO,KACf,MAAM,CAAC,EAChB,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,CA+CH"} \ No newline at end of file diff --git a/node_modules/cheerio/lib/api/attributes.js b/node_modules/cheerio/lib/api/attributes.js deleted file mode 100644 index ab93c6d..0000000 --- a/node_modules/cheerio/lib/api/attributes.js +++ /dev/null @@ -1,622 +0,0 @@ -"use strict"; -/** - * Methods for getting and modifying attributes. - * - * @module cheerio/attributes - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toggleClass = exports.removeClass = exports.addClass = exports.hasClass = exports.removeAttr = exports.val = exports.data = exports.prop = exports.attr = void 0; -var static_js_1 = require("../static.js"); -var utils_js_1 = require("../utils.js"); -var domutils_1 = require("domutils"); -var hasOwn = Object.prototype.hasOwnProperty; -var rspace = /\s+/; -var dataAttrPrefix = 'data-'; -/* - * Lookup table for coercing string data-* attributes to their corresponding - * JavaScript primitives - */ -var primitives = { - null: null, - true: true, - false: false, -}; -// Attributes that are booleans -var 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 -var rbrace = /^{[^]*}$|^\[[^]*]$/; -function getAttr(elem, name, xmlMode) { - var _a; - if (!elem || !(0, utils_js_1.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 (0, static_js_1.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] = "".concat(value); - } -} -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 (0, utils_js_1.domEach)(this, function (el, i) { - if ((0, utils_js_1.isTag)(el)) - setAttr(el, name, value.call(el, i, el.attribs[name])); - }); - } - return (0, utils_js_1.domEach)(this, function (el) { - if (!(0, utils_js_1.isTag)(el)) - return; - if (typeof name === 'object') { - Object.keys(name).forEach(function (objName) { - var objValue = name[objName]; - setAttr(el, objName, objValue); - }); - } - else { - setAttr(el, name, value); - } - }); - } - return arguments.length > 1 - ? this - : getAttr(this[0], name, this.options.xmlMode); -} -exports.attr = attr; -/** - * Gets a node's prop. - * - * @private - * @category Attributes - * @param el - Element to get the prop of. - * @param name - Name of the prop. - * @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. - */ -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) : "".concat(value)); - } -} -function prop(name, value) { - var _this = this; - var _a; - if (typeof name === 'string' && value === undefined) { - var el = this[0]; - if (!el || !(0, utils_js_1.isTag)(el)) - return undefined; - switch (name) { - case 'style': { - var property_1 = this.css(); - var keys = Object.keys(property_1); - keys.forEach(function (p, i) { - property_1[i] = p; - }); - property_1.length = keys.length; - return property_1; - } - case 'tagName': - case 'nodeName': { - return el.name.toUpperCase(); - } - case 'href': - case 'src': { - var prop_1 = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a[name]; - /* eslint-disable node/no-unsupported-features/node-builtins */ - if (typeof URL !== 'undefined' && - ((name === 'href' && (el.tagName === 'a' || el.name === 'link')) || - (name === 'src' && - (el.tagName === 'img' || - el.tagName === 'iframe' || - el.tagName === 'audio' || - el.tagName === 'video' || - el.tagName === 'source'))) && - prop_1 !== undefined && - this.options.baseURI) { - return new URL(prop_1, this.options.baseURI).href; - } - /* eslint-enable node/no-unsupported-features/node-builtins */ - return prop_1; - } - case 'innerText': { - return (0, domutils_1.innerText)(el); - } - case 'textContent': { - return (0, domutils_1.textContent)(el); - } - case 'outerHTML': - return this.clone().wrap('').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 Error('Bad combination of arguments.'); - } - return (0, utils_js_1.domEach)(this, function (el, i) { - if ((0, utils_js_1.isTag)(el)) { - setProp(el, name, value.call(el, i, getProp(el, name, _this.options.xmlMode)), _this.options.xmlMode); - } - }); - } - return (0, utils_js_1.domEach)(this, function (el) { - if (!(0, utils_js_1.isTag)(el)) - return; - if (typeof name === 'object') { - Object.keys(name).forEach(function (key) { - var val = name[key]; - setProp(el, key, val, _this.options.xmlMode); - }); - } - else { - setProp(el, name, value, _this.options.xmlMode); - } - }); - } - return undefined; -} -exports.prop = prop; -/** - * Sets the value of a data attribute. - * - * @private - * @param el - The element to set the data attribute on. - * @param name - The data attribute's name. - * @param value - The data attribute's value. - */ -function setData(el, name, value) { - var _a; - var elem = el; - (_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 the specified attribute from the equivalent HTML5 `data-*` attribute, - * and (if present) cache the value in the node's internal data store. If no - * attribute name is specified, read _all_ HTML5 `data-*` attributes in this manner. - * - * @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, or a map with all of the data attributes. - */ -function readData(el, name) { - var domNames; - var jsNames; - var value; - if (name == null) { - domNames = Object.keys(el.attribs).filter(function (attrName) { - return attrName.startsWith(dataAttrPrefix); - }); - jsNames = domNames.map(function (domName) { - return (0, utils_js_1.camelCase)(domName.slice(dataAttrPrefix.length)); - }); - } - else { - domNames = [dataAttrPrefix + (0, utils_js_1.cssCase)(name)]; - jsNames = [name]; - } - for (var idx = 0; idx < domNames.length; ++idx) { - var domName = domNames[idx]; - var jsName = jsNames[idx]; - if (hasOwn.call(el.attribs, domName) && - !hasOwn.call(el.data, jsName)) { - value = el.attribs[domName]; - if (hasOwn.call(primitives, value)) { - value = primitives[value]; - } - else if (value === String(Number(value))) { - value = Number(value); - } - else if (rbrace.test(value)) { - try { - value = JSON.parse(value); - } - catch (e) { - /* Ignore */ - } - } - el.data[jsName] = value; - } - } - return name == null ? el.data : value; -} -function data(name, value) { - var _a; - var elem = this[0]; - if (!elem || !(0, utils_js_1.isTag)(elem)) - return; - var dataEl = elem; - (_a = dataEl.data) !== null && _a !== void 0 ? _a : (dataEl.data = {}); - // Return the entire data object if no data specified - if (!name) { - return readData(dataEl); - } - // Set the value (with attr map support) - if (typeof name === 'object' || value !== undefined) { - (0, utils_js_1.domEach)(this, function (el) { - if ((0, utils_js_1.isTag)(el)) { - if (typeof name === 'object') - setData(el, name); - else - setData(el, name, value); - } - }); - return this; - } - if (hasOwn.call(dataEl.data, name)) { - return dataEl.data[name]; - } - return readData(dataEl, name); -} -exports.data = data; -function val(value) { - var querying = arguments.length === 0; - var element = this[0]; - if (!element || !(0, utils_js_1.isTag)(element)) - return querying ? undefined : this; - switch (element.name) { - case 'textarea': - return this.text(value); - case 'select': { - var option = this.find('option:selected'); - if (!querying) { - if (this.attr('multiple') == null && typeof value === 'object') { - return this; - } - this.find('option').removeAttr('selected'); - var values = typeof value !== 'object' ? [value] : value; - for (var i = 0; i < values.length; i++) { - this.find("option[value=\"".concat(values[i], "\"]")).attr('selected', ''); - } - return this; - } - return this.attr('multiple') - ? option.toArray().map(function (el) { return (0, static_js_1.text)(el.children); }) - : option.attr('value'); - } - case 'input': - case 'option': - return querying - ? this.attr('value') - : this.attr('value', value); - } - return undefined; -} -exports.val = val; -/** - * 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(); - * //=>
  • Pear
  • - * - * $('.apple').attr('id', 'favorite'); - * $('.apple').removeAttr('id class').html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the attribute. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeAttr/} - */ -function removeAttr(name) { - var attrNames = splitNames(name); - var _loop_1 = function (i) { - (0, utils_js_1.domEach)(this_1, function (elem) { - if ((0, utils_js_1.isTag)(elem)) - removeAttribute(elem, attrNames[i]); - }); - }; - var this_1 = this; - for (var i = 0; i < attrNames.length; i++) { - _loop_1(i); - } - return this; -} -exports.removeAttr = removeAttr; -/** - * 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/} - */ -function hasClass(className) { - return this.toArray().some(function (elem) { - var clazz = (0, utils_js_1.isTag)(elem) && elem.attribs['class']; - var idx = -1; - if (clazz && className.length) { - while ((idx = clazz.indexOf(className, idx + 1)) > -1) { - var end = idx + className.length; - if ((idx === 0 || rspace.test(clazz[idx - 1])) && - (end === clazz.length || rspace.test(clazz[end]))) { - return true; - } - } - } - return false; - }); -} -exports.hasClass = hasClass; -/** - * Adds class(es) to all of the matched elements. Also accepts a `function`. - * - * @category Attributes - * @example - * - * ```js - * $('.pear').addClass('fruit').html(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('fruit red').html(); - * //=>
  • Apple
  • - * ``` - * - * @param value - Name of new class. - * @returns The instance itself. - * @see {@link https://api.jquery.com/addClass/} - */ -function addClass(value) { - // Support functions - if (typeof value === 'function') { - return (0, utils_js_1.domEach)(this, function (el, i) { - if ((0, utils_js_1.isTag)(el)) { - var 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; - var classNames = value.split(rspace); - var numElements = this.length; - for (var i = 0; i < numElements; i++) { - var el = this[i]; - // If selected element isn't a tag, move on - if (!(0, utils_js_1.isTag)(el)) - continue; - // If we don't already have classes — always set xmlMode to false here, as it doesn't matter for classes - var className = getAttr(el, 'class', false); - if (!className) { - setAttr(el, 'class', classNames.join(' ').trim()); - } - else { - var setClass = " ".concat(className, " "); - // Check if class already exists - for (var j = 0; j < classNames.length; j++) { - var appendClass = "".concat(classNames[j], " "); - if (!setClass.includes(" ".concat(appendClass))) - setClass += appendClass; - } - setAttr(el, 'class', setClass.trim()); - } - } - return this; -} -exports.addClass = addClass; -/** - * 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(); - * //=>
  • Pear
  • - * - * $('.apple').addClass('red').removeClass().html(); - * //=>
  • Apple
  • - * ``` - * - * @param name - Name of the class. If not specified, removes all elements. - * @returns The instance itself. - * @see {@link https://api.jquery.com/removeClass/} - */ -function removeClass(name) { - // Handle if value is a function - if (typeof name === 'function') { - return (0, utils_js_1.domEach)(this, function (el, i) { - if ((0, utils_js_1.isTag)(el)) { - removeClass.call([el], name.call(el, i, el.attribs['class'] || '')); - } - }); - } - var classes = splitNames(name); - var numClasses = classes.length; - var removeAll = arguments.length === 0; - return (0, utils_js_1.domEach)(this, function (el) { - if (!(0, utils_js_1.isTag)(el)) - return; - if (removeAll) { - // Short circuit the remove all case as this is the nice one - el.attribs['class'] = ''; - } - else { - var elClasses = splitNames(el.attribs['class']); - var changed = false; - for (var j = 0; j < numClasses; j++) { - var 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(' '); - } - } - }); -} -exports.removeClass = removeClass; -/** - * 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(); - * //=>
  • Apple
  • - * - * $('.apple.green').toggleClass('fruit green red', true).html(); - * //=>
  • Apple
  • - * ``` - * - * @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/} - */ -function toggleClass(value, stateVal) { - // Support functions - if (typeof value === 'function') { - return (0, utils_js_1.domEach)(this, function (el, i) { - if ((0, utils_js_1.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; - var classNames = value.split(rspace); - var numClasses = classNames.length; - var state = typeof stateVal === 'boolean' ? (stateVal ? 1 : -1) : 0; - var numElements = this.length; - for (var i = 0; i < numElements; i++) { - var el = this[i]; - // If selected element isn't a tag, move on - if (!(0, utils_js_1.isTag)(el)) - continue; - var elementClasses = splitNames(el.attribs['class']); - // Check if class already exists - for (var j = 0; j < numClasses; j++) { - // Check if the class name is currently defined - var 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; -} -exports.toggleClass = toggleClass; -//# sourceMappingURL=attributes.js.map \ No newline at end of file diff --git a/node_modules/cheerio/lib/api/css.d.ts b/node_modules/cheerio/lib/api/css.d.ts deleted file mode 100644 index 4ff2510..0000000 --- a/node_modules/cheerio/lib/api/css.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { Element, 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(this: Cheerio, names?: string[]): Record | undefined; -/** - * Get the value of a style property for the first element in the set of matched elements. - * - * @category CSS - * @param names - The name of the property. - * @returns The property value for the given name. - * @see {@link https://api.jquery.com/css/} - */ -export declare function css(this: Cheerio, 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(this: Cheerio, prop: string, val: string | ((this: Element, i: number, style: string) => string | undefined)): Cheerio; -/** - * 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(this: Cheerio, map: Record): Cheerio; -//# sourceMappingURL=css.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio/lib/api/css.d.ts.map b/node_modules/cheerio/lib/api/css.d.ts.map deleted file mode 100644 index f10b6c8..0000000 --- a/node_modules/cheerio/lib/api/css.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"css.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio/d1cbc66d53392ce8bf6cd0068f675836372d2bf3/src/","sources":["api/css.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;GAOG;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;;;;;;;GAOG;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"} \ No newline at end of file diff --git a/node_modules/cheerio/lib/api/css.js b/node_modules/cheerio/lib/api/css.js deleted file mode 100644 index 9389c29..0000000 --- a/node_modules/cheerio/lib/api/css.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.css = void 0; -var utils_js_1 = require("../utils.js"); -/** - * 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/} - */ -function css(prop, val) { - if ((prop != null && val != null) || - // When `prop` is a "plain" object - (typeof prop === 'object' && !Array.isArray(prop))) { - return (0, utils_js_1.domEach)(this, function (el, i) { - if ((0, utils_js_1.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); -} -exports.css = css; -/** - * 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') { - var styles = getCss(el); - var 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') { - Object.keys(prop).forEach(function (k, i) { - setCss(el, k, prop[k], i); - }); - } -} -function getCss(el, prop) { - if (!el || !(0, utils_js_1.isTag)(el)) - return; - var styles = parse(el.attribs['style']); - if (typeof prop === 'string') { - return styles[prop]; - } - if (Array.isArray(prop)) { - var newStyles_1 = {}; - prop.forEach(function (item) { - if (styles[item] != null) { - newStyles_1[item] = styles[item]; - } - }); - return newStyles_1; - } - 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(function (str, prop) { return "".concat(str).concat(str ? ' ' : '').concat(prop, ": ").concat(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 {}; - var obj = {}; - var key; - for (var _i = 0, _a = styles.split(';'); _i < _a.length; _i++) { - var str = _a[_i]; - var 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) { - var trimmed = str.trimEnd(); - if (trimmed.length > 0 && key !== undefined) { - obj[key] += ";".concat(trimmed); - } - } - else { - key = str.slice(0, n).trim(); - obj[key] = str.slice(n + 1).trim(); - } - } - return obj; -} -//# sourceMappingURL=css.js.map \ No newline at end of file diff --git a/node_modules/cheerio/lib/api/forms.d.ts b/node_modules/cheerio/lib/api/forms.d.ts deleted file mode 100644 index 3b11493..0000000 --- a/node_modules/cheerio/lib/api/forms.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -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 - * $('
    ').serialize(); - * //=> 'foo=bar' - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serialize/} - */ -export declare function serialize(this: Cheerio): string; -interface SerializedField { - name: string; - value: string; -} -/** - * Encode a set of form elements as an array of names and values. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serializeArray(); - * //=> [ { name: 'foo', value: 'bar' } ] - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serializeArray/} - */ -export declare function serializeArray(this: Cheerio): SerializedField[]; -export {}; -//# sourceMappingURL=forms.d.ts.map \ No newline at end of file diff --git a/node_modules/cheerio/lib/api/forms.d.ts.map b/node_modules/cheerio/lib/api/forms.d.ts.map deleted file mode 100644 index d27b568..0000000 --- a/node_modules/cheerio/lib/api/forms.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"forms.d.ts","sourceRoot":"https://raw.githubusercontent.com/cheeriojs/cheerio/d1cbc66d53392ce8bf6cd0068f675836372d2bf3/src/","sources":["api/forms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAW7C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAYrE;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,OAAO,EAC9C,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GACf,eAAe,EAAE,CAsCnB"} \ No newline at end of file diff --git a/node_modules/cheerio/lib/api/forms.js b/node_modules/cheerio/lib/api/forms.js deleted file mode 100644 index a9f84a7..0000000 --- a/node_modules/cheerio/lib/api/forms.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.serializeArray = exports.serialize = void 0; -var utils_js_1 = require("../utils.js"); -/* - * 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 - */ -var submittableSelector = 'input,select,textarea,keygen'; -var r20 = /%20/g; -var rCRLF = /\r?\n/g; -/** - * Encode a set of form elements as a string for submission. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serialize(); - * //=> 'foo=bar' - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serialize/} - */ -function serialize() { - // Convert form elements into name/value objects - var arr = this.serializeArray(); - // Serialize each element into a key/value string - var retArr = arr.map(function (data) { - return "".concat(encodeURIComponent(data.name), "=").concat(encodeURIComponent(data.value)); - }); - // Return the resulting serialization - return retArr.join('&').replace(r20, '+'); -} -exports.serialize = serialize; -/** - * Encode a set of form elements as an array of names and values. - * - * @category Forms - * @example - * - * ```js - * $('
    ').serializeArray(); - * //=> [ { name: 'foo', value: 'bar' } ] - * ``` - * - * @returns The serialized form. - * @see {@link https://api.jquery.com/serializeArray/} - */ -function serializeArray() { - var _this = this; - // Resolve all form elements from either forms or collections of form elements - return this.map(function (_, elem) { - var $elem = _this._make(elem); - if ((0, utils_js_1.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))' - // Convert each of the elements to its value(s) - ) - .map(function (_, elem) { - var _a; - var $elem = _this._make(elem); - var 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 - var value = (_a = $elem.val()) !== null && _a !== void 0 ? _a : ''; - // If we have an array of values (e.g. `
    - - Build Status - - - Coverage - - - OpenCollective backers - - - OpenCollective sponsors - -