uawdijnntqw1x1x1
IP : 216.73.216.86
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
www
/
node_modules
/
jquery
/
..
/
jquery
/
..
/
..
/
4d695
/
json-parse-even-better-errors.tar
/
/
package.json000064400000003312151701431000007021 0ustar00{ "_id": "json-parse-even-better-errors@3.0.2", "_inBundle": true, "_location": "/npm/json-parse-even-better-errors", "_phantomChildren": {}, "_requiredBy": [ "/npm", "/npm/@npmcli/arborist", "/npm/@npmcli/metavuln-calculator", "/npm/@npmcli/package-json", "/npm/libnpmversion", "/npm/parse-conflict-json", "/npm/read-package-json-fast" ], "author": { "name": "GitHub Inc." }, "bugs": { "url": "https://github.com/npm/json-parse-even-better-errors/issues" }, "description": "JSON.parse with context information on error", "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/template-oss": "4.22.0", "tap": "^16.3.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" }, "files": [ "bin/", "lib/" ], "homepage": "https://github.com/npm/json-parse-even-better-errors#readme", "keywords": [ "JSON", "parser" ], "license": "MIT", "main": "lib/index.js", "name": "json-parse-even-better-errors", "repository": { "type": "git", "url": "git+https://github.com/npm/json-parse-even-better-errors.git" }, "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "npm run lint -- --fix", "postlint": "template-oss-check", "posttest": "npm run lint", "snap": "tap", "template-oss-apply": "template-oss-apply --force", "test": "tap" }, "tap": { "check-coverage": true, "nyc-arg": [ "--exclude", "tap-snapshots/**" ] }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "version": "4.22.0", "publish": true }, "version": "3.0.2" } lib/index.js000064400000010107151701431000006746 0ustar00'use strict' const INDENT = Symbol.for('indent') const NEWLINE = Symbol.for('newline') const DEFAULT_NEWLINE = '\n' const DEFAULT_INDENT = ' ' const BOM = /^\uFEFF/ // only respect indentation if we got a line break, otherwise squash it // things other than objects and arrays aren't indented, so ignore those // Important: in both of these regexps, the $1 capture group is the newline // or undefined, and the $2 capture group is the indent, or undefined. const FORMAT = /^\s*[{[]((?:\r?\n)+)([\s\t]*)/ const EMPTY = /^(?:\{\}|\[\])((?:\r?\n)+)?$/ // Node 20 puts single quotes around the token and a comma after it const UNEXPECTED_TOKEN = /^Unexpected token '?(.)'?(,)? /i const hexify = (char) => { const h = char.charCodeAt(0).toString(16).toUpperCase() return `0x${h.length % 2 ? '0' : ''}${h}` } // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) // because the buffer-to-string conversion in `fs.readFileSync()` // translates it to FEFF, the UTF-16 BOM. const stripBOM = (txt) => String(txt).replace(BOM, '') const makeParsedError = (msg, parsing, position = 0) => ({ message: `${msg} while parsing ${parsing}`, position, }) const parseError = (e, txt, context = 20) => { let msg = e.message if (!txt) { return makeParsedError(msg, 'empty string') } const badTokenMatch = msg.match(UNEXPECTED_TOKEN) const badIndexMatch = msg.match(/ position\s+(\d+)/i) if (badTokenMatch) { msg = msg.replace( UNEXPECTED_TOKEN, `Unexpected token ${JSON.stringify(badTokenMatch[1])} (${hexify(badTokenMatch[1])})$2 ` ) } let errIdx if (badIndexMatch) { errIdx = +badIndexMatch[1] } else /* istanbul ignore next - doesnt happen in Node 22 */ if ( msg.match(/^Unexpected end of JSON.*/i) ) { errIdx = txt.length - 1 } if (errIdx == null) { return makeParsedError(msg, `'${txt.slice(0, context * 2)}'`) } const start = errIdx <= context ? 0 : errIdx - context const end = errIdx + context >= txt.length ? txt.length : errIdx + context const slice = `${start ? '...' : ''}${txt.slice(start, end)}${end === txt.length ? '' : '...'}` return makeParsedError( msg, `${txt === slice ? '' : 'near '}${JSON.stringify(slice)}`, errIdx ) } class JSONParseError extends SyntaxError { constructor (er, txt, context, caller) { const metadata = parseError(er, txt, context) super(metadata.message) Object.assign(this, metadata) this.code = 'EJSONPARSE' this.systemError = er Error.captureStackTrace(this, caller || this.constructor) } get name () { return this.constructor.name } set name (n) {} get [Symbol.toStringTag] () { return this.constructor.name } } const parseJson = (txt, reviver) => { const result = JSON.parse(txt, reviver) if (result && typeof result === 'object') { // get the indentation so that we can save it back nicely // if the file starts with {" then we have an indent of '', ie, none // otherwise, pick the indentation of the next line after the first \n If the // pattern doesn't match, then it means no indentation. JSON.stringify ignores // symbols, so this is reasonably safe. if the string is '{}' or '[]', then // use the default 2-space indent. const match = txt.match(EMPTY) || txt.match(FORMAT) || [null, '', ''] result[NEWLINE] = match[1] ?? DEFAULT_NEWLINE result[INDENT] = match[2] ?? DEFAULT_INDENT } return result } const parseJsonError = (raw, reviver, context) => { const txt = stripBOM(raw) try { return parseJson(txt, reviver) } catch (e) { if (typeof raw !== 'string' && !Buffer.isBuffer(raw)) { const msg = Array.isArray(raw) && raw.length === 0 ? 'an empty array' : String(raw) throw Object.assign( new TypeError(`Cannot parse ${msg}`), { code: 'EJSONPARSE', systemError: e } ) } throw new JSONParseError(e, txt, context, parseJsonError) } } module.exports = parseJsonError parseJsonError.JSONParseError = JSONParseError parseJsonError.noExceptions = (raw, reviver) => { try { return parseJson(stripBOM(raw), reviver) } catch { // no exceptions } } LICENSE.md000064400000002271151701431000006142 0ustar00Copyright 2017 Kat Marchán Copyright npm, Inc. 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. --- This library is a fork of 'better-json-errors' by Kat Marchán, extended and distributed under the terms of the MIT license above.
/home/emeraadmin/www/node_modules/jquery/../jquery/../../4d695/json-parse-even-better-errors.tar