summaryrefslogtreecommitdiff
path: root/includes/external/addressbook/node_modules/cheerio/lib/utils.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/addressbook/node_modules/cheerio/lib/utils.js
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/addressbook/node_modules/cheerio/lib/utils.js')
-rw-r--r--includes/external/addressbook/node_modules/cheerio/lib/utils.js122
1 files changed, 0 insertions, 122 deletions
diff --git a/includes/external/addressbook/node_modules/cheerio/lib/utils.js b/includes/external/addressbook/node_modules/cheerio/lib/utils.js
deleted file mode 100644
index b10f17f..0000000
--- a/includes/external/addressbook/node_modules/cheerio/lib/utils.js
+++ /dev/null
@@ -1,122 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.isHtml = exports.cloneDom = exports.domEach = exports.cssCase = exports.camelCase = exports.isCheerio = exports.isTag = void 0;
-var domhandler_1 = require("domhandler");
-/**
- * Check if the DOM element is a tag.
- *
- * `isTag(type)` includes `<script>` and `<style>` tags.
- *
- * @private
- * @category Utils
- * @param type - The DOM node to check.
- * @returns Whether the node is a tag.
- */
-var domhandler_2 = require("domhandler");
-Object.defineProperty(exports, "isTag", { enumerable: true, get: function () { return domhandler_2.isTag; } });
-/**
- * Checks if an object is a Cheerio instance.
- *
- * @category Utils
- * @param maybeCheerio - The object to check.
- * @returns Whether the object is a Cheerio instance.
- */
-function isCheerio(maybeCheerio) {
- return maybeCheerio.cheerio != null;
-}
-exports.isCheerio = isCheerio;
-/**
- * Convert a string to camel case notation.
- *
- * @private
- * @category Utils
- * @param str - The string to be converted.
- * @returns String in camel case notation.
- */
-function camelCase(str) {
- return str.replace(/[_.-](\w|$)/g, function (_, x) { return x.toUpperCase(); });
-}
-exports.camelCase = camelCase;
-/**
- * Convert a string from camel case to "CSS case", where word boundaries are
- * described by hyphens ("-") and all characters are lower-case.
- *
- * @private
- * @category Utils
- * @param str - The string to be converted.
- * @returns String in "CSS case".
- */
-function cssCase(str) {
- return str.replace(/[A-Z]/g, '-$&').toLowerCase();
-}
-exports.cssCase = cssCase;
-/**
- * Iterate over each DOM element without creating intermediary Cheerio instances.
- *
- * This is indented for use internally to avoid otherwise unnecessary memory
- * pressure introduced by _make.
- *
- * @category Utils
- * @param array - The array to iterate over.
- * @param fn - Function to call.
- * @returns The original instance.
- */
-function domEach(array, fn) {
- var len = array.length;
- for (var i = 0; i < len; i++)
- fn(array[i], i);
- return array;
-}
-exports.domEach = domEach;
-/**
- * Create a deep copy of the given DOM structure. Sets the parents of the copies
- * of the passed nodes to `null`.
- *
- * @private
- * @category Utils
- * @param dom - The domhandler-compliant DOM structure.
- * @returns - The cloned DOM.
- */
-function cloneDom(dom) {
- var clone = 'length' in dom
- ? Array.prototype.map.call(dom, function (el) { return (0, domhandler_1.cloneNode)(el, true); })
- : [(0, domhandler_1.cloneNode)(dom, true)];
- // Add a root node around the cloned nodes
- var root = new domhandler_1.Document(clone);
- clone.forEach(function (node) {
- node.parent = root;
- });
- return clone;
-}
-exports.cloneDom = cloneDom;
-var CharacterCodes;
-(function (CharacterCodes) {
- CharacterCodes[CharacterCodes["LowerA"] = 97] = "LowerA";
- CharacterCodes[CharacterCodes["LowerZ"] = 122] = "LowerZ";
- CharacterCodes[CharacterCodes["UpperA"] = 65] = "UpperA";
- CharacterCodes[CharacterCodes["UpperZ"] = 90] = "UpperZ";
- CharacterCodes[CharacterCodes["Exclamation"] = 33] = "Exclamation";
-})(CharacterCodes || (CharacterCodes = {}));
-/**
- * Check if string is HTML.
- *
- * Tests for a `<` within a string, immediate followed by a letter and
- * eventually followed by a `>`.
- *
- * @private
- * @category Utils
- * @param str - The string to check.
- * @returns Indicates if `str` is HTML.
- */
-function isHtml(str) {
- var tagStart = str.indexOf('<');
- if (tagStart < 0 || tagStart > str.length - 3)
- return false;
- var tagChar = str.charCodeAt(tagStart + 1);
- return (((tagChar >= CharacterCodes.LowerA && tagChar <= CharacterCodes.LowerZ) ||
- (tagChar >= CharacterCodes.UpperA && tagChar <= CharacterCodes.UpperZ) ||
- tagChar === CharacterCodes.Exclamation) &&
- str.includes('>', tagStart + 2));
-}
-exports.isHtml = isHtml;
-//# sourceMappingURL=utils.js.map \ No newline at end of file