This commit is contained in:
2025-05-09 05:30:08 +02:00
parent 7bb10e7df4
commit 73367bad9e
5322 changed files with 1266973 additions and 313 deletions

View File

@@ -0,0 +1,8 @@
import { Parser } from "../index.js";
export declare const parsers: {
angular: Parser;
html: Parser;
lwc: Parser;
vue: Parser;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"not-found.js","sources":["../../src/not-found.tsx"],"sourcesContent":["import * as React from 'react'\nimport { isNotFound } from '@tanstack/router-core'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouterState } from './useRouterState'\nimport type { ErrorInfo } from 'react'\nimport type { NotFoundError } from '@tanstack/router-core'\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => React.ReactElement\n onCatch?: (error: Error, errorInfo: ErrorInfo) => void\n children: React.ReactNode\n}) {\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const resetKey = useRouterState({\n select: (s) => `not-found-${s.location.pathname}-${s.status}`,\n })\n\n return (\n <CatchBoundary\n getResetKey={() => resetKey}\n onCatch={(error, errorInfo) => {\n if (isNotFound(error)) {\n props.onCatch?.(error, errorInfo)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }: { error: Error }) => {\n if (isNotFound(error)) {\n return props.fallback?.(error)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"names":[],"mappings":";;;;AAOO,SAAS,cAAc,OAI3B;AAED,QAAM,WAAW,eAAe;AAAA,IAC9B,QAAQ,CAAC,MAAM,aAAa,EAAE,SAAS,QAAQ,IAAI,EAAE,MAAM;AAAA,EAAA,CAC5D;AAGC,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAa,MAAM;AAAA,MACnB,SAAS,CAAC,OAAO,cAAc;;AACzB,YAAA,WAAW,KAAK,GAAG;AACf,sBAAA,YAAA,+BAAU,OAAO;AAAA,QAAS,OAC3B;AACC,gBAAA;AAAA,QAAA;AAAA,MAEV;AAAA,MACA,gBAAgB,CAAC,EAAE,YAA8B;;AAC3C,YAAA,WAAW,KAAK,GAAG;AACd,kBAAA,WAAM,aAAN,+BAAiB;AAAA,QAAK,OACxB;AACC,gBAAA;AAAA,QAAA;AAAA,MAEV;AAAA,MAEC,UAAM,MAAA;AAAA,IAAA;AAAA,EACT;AAEJ;AAEO,SAAS,wBAAwB;AAC/B,SAAA,oBAAC,OAAE,UAAS,YAAA,CAAA;AACrB;"}

View File

@@ -0,0 +1,108 @@
/**
* @fileoverview A rule to disallow duplicate name in class members.
* @author Toru Nagashima
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow duplicate class members",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-dupe-class-members",
},
schema: [],
messages: {
unexpected: "Duplicate name '{{name}}'.",
},
},
create(context) {
let stack = [];
/**
* Gets state of a given member name.
* @param {string} name A name of a member.
* @param {boolean} isStatic A flag which specifies that is a static member.
* @returns {Object} A state of a given member name.
* - retv.init {boolean} A flag which shows the name is declared as normal member.
* - retv.get {boolean} A flag which shows the name is declared as getter.
* - retv.set {boolean} A flag which shows the name is declared as setter.
*/
function getState(name, isStatic) {
const stateMap = stack.at(-1);
const key = `$${name}`; // to avoid "__proto__".
if (!stateMap[key]) {
stateMap[key] = {
nonStatic: { init: false, get: false, set: false },
static: { init: false, get: false, set: false },
};
}
return stateMap[key][isStatic ? "static" : "nonStatic"];
}
return {
// Initializes the stack of state of member declarations.
Program() {
stack = [];
},
// Initializes state of member declarations for the class.
ClassBody() {
stack.push(Object.create(null));
},
// Disposes the state for the class.
"ClassBody:exit"() {
stack.pop();
},
// Reports the node if its name has been declared already.
"MethodDefinition, PropertyDefinition"(node) {
const name = astUtils.getStaticPropertyName(node);
const kind =
node.type === "MethodDefinition" ? node.kind : "field";
if (name === null || kind === "constructor") {
return;
}
const state = getState(name, node.static);
let isDuplicate;
if (kind === "get") {
isDuplicate = state.init || state.get;
state.get = true;
} else if (kind === "set") {
isDuplicate = state.init || state.set;
state.set = true;
} else {
isDuplicate = state.init || state.get || state.set;
state.init = true;
}
if (isDuplicate) {
context.report({
node,
messageId: "unexpected",
data: { name },
});
}
},
};
},
};

View File

@@ -0,0 +1,22 @@
/// <reference types="node"/>
import {IncomingMessage} from 'http';
/**
Decompress a HTTP response if needed.
@param response - The HTTP incoming stream with compressed data.
@returns The decompressed HTTP response stream.
@example
```
import {http} from 'http';
import decompressResponse = require('decompress-response');
http.get('https://sindresorhus.com', response => {
response = decompressResponse(response);
});
```
*/
declare function decompressResponse(response: IncomingMessage): IncomingMessage;
export = decompressResponse;

View File

@@ -0,0 +1,170 @@
/*
Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
Copyright (C) 2013 Alex Seville <hi@alexanderseville.com>
Copyright (C) 2014 Thiago de Arruda <tpadilha84@gmail.com>
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 SOFTWARE 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 <COPYRIGHT HOLDER> 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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Escope (<a href="http://github.com/estools/escope">escope</a>) is an <a
* href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMAScript</a>
* scope analyzer extracted from the <a
* href="http://github.com/estools/esmangle">esmangle project</a/>.
* <p>
* <em>escope</em> finds lexical scopes in a source program, i.e. areas of that
* program where different occurrences of the same identifier refer to the same
* variable. With each scope the contained variables are collected, and each
* identifier reference in code is linked to its corresponding variable (if
* possible).
* <p>
* <em>escope</em> works on a syntax tree of the parsed source code which has
* to adhere to the <a
* href="https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API">
* Mozilla Parser API</a>. E.g. <a href="https://github.com/eslint/espree">espree</a> is a parser
* that produces such syntax trees.
* <p>
* The main interface is the {@link analyze} function.
* @module escope
*/
import { assert } from "./assert.js";
import ScopeManager from "./scope-manager.js";
import Referencer from "./referencer.js";
import Reference from "./reference.js";
import Variable from "./variable.js";
import eslintScopeVersion from "./version.js";
/**
* Set the default options
* @returns {Object} options
*/
function defaultOptions() {
return {
optimistic: false,
nodejsScope: false,
impliedStrict: false,
sourceType: "script", // one of ['script', 'module', 'commonjs']
ecmaVersion: 5,
childVisitorKeys: null,
fallback: "iteration"
};
}
/**
* Preform deep update on option object
* @param {Object} target Options
* @param {Object} override Updates
* @returns {Object} Updated options
*/
function updateDeeply(target, override) {
/**
* Is hash object
* @param {Object} value Test value
* @returns {boolean} Result
*/
function isHashObject(value) {
return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
}
for (const key in override) {
if (Object.hasOwn(override, key)) {
const val = override[key];
if (isHashObject(val)) {
if (isHashObject(target[key])) {
updateDeeply(target[key], val);
} else {
target[key] = updateDeeply({}, val);
}
} else {
target[key] = val;
}
}
}
return target;
}
/**
* Main interface function. Takes an Espree syntax tree and returns the
* analyzed scopes.
* @function analyze
* @param {espree.Tree} tree Abstract Syntax Tree
* @param {Object} providedOptions Options that tailor the scope analysis
* @param {boolean} [providedOptions.optimistic=false] the optimistic flag
* @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
* @param {boolean} [providedOptions.nodejsScope=false] whether the whole
* script is executed under node.js environment. When enabled, escope adds
* a function scope immediately following the global scope.
* @param {boolean} [providedOptions.impliedStrict=false] implied strict mode
* (if ecmaVersion >= 5).
* @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs'
* @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
* @param {boolean} [providedOptions.jsx=false] support JSX references
* @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
* @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
* @returns {ScopeManager} ScopeManager
*/
function analyze(tree, providedOptions) {
const options = updateDeeply(defaultOptions(), providedOptions);
const scopeManager = new ScopeManager(options);
const referencer = new Referencer(options, scopeManager);
referencer.visit(tree);
assert(scopeManager.__currentScope === null, "currentScope should be null.");
return scopeManager;
}
export {
/** @name module:escope.version */
eslintScopeVersion as version,
/** @name module:escope.Reference */
Reference,
/** @name module:escope.Variable */
Variable,
/** @name module:escope.ScopeManager */
ScopeManager,
/** @name module:escope.Referencer */
Referencer,
analyze
};
/** @name module:escope.Definition */
export { Definition } from "./definition.js";
/** @name module:escope.PatternVisitor */
export { default as PatternVisitor } from "./pattern-visitor.js";
/** @name module:escope.Scope */
export { Scope } from "./scope.js";
/* vim: set sw=4 ts=4 et tw=80 : */

View File

@@ -0,0 +1,16 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
exports.deprecate = (fn, msg) => {
let once = true;
return function() {
if (once) {
console.warn("DeprecationWarning: " + msg);
once = false;
}
return fn.apply(this, arguments);
};
};

View File

@@ -0,0 +1,701 @@
/**
* @fileoverview Rule to enforce spacing before and after keywords.
* @author Toru Nagashima
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils"),
keywords = require("./utils/keywords");
//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------
const PREV_TOKEN = /^[)\]}>]$/u;
const NEXT_TOKEN = /^(?:[([{<~!]|\+\+?|--?)$/u;
const PREV_TOKEN_M = /^[)\]}>*]$/u;
const NEXT_TOKEN_M = /^[{*]$/u;
const TEMPLATE_OPEN_PAREN = /\$\{$/u;
const TEMPLATE_CLOSE_PAREN = /^\}/u;
const CHECK_TYPE =
/^(?:JSXElement|RegularExpression|String|Template|PrivateIdentifier)$/u;
const KEYS = keywords.concat([
"as",
"async",
"await",
"from",
"get",
"let",
"of",
"set",
"yield",
]);
// check duplications.
(function () {
KEYS.sort();
for (let i = 1; i < KEYS.length; ++i) {
if (KEYS[i] === KEYS[i - 1]) {
throw new Error(
`Duplication was found in the keyword list: ${KEYS[i]}`,
);
}
}
})();
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks whether or not a given token is a "Template" token ends with "${".
* @param {Token} token A token to check.
* @returns {boolean} `true` if the token is a "Template" token ends with "${".
*/
function isOpenParenOfTemplate(token) {
return token.type === "Template" && TEMPLATE_OPEN_PAREN.test(token.value);
}
/**
* Checks whether or not a given token is a "Template" token starts with "}".
* @param {Token} token A token to check.
* @returns {boolean} `true` if the token is a "Template" token starts with "}".
*/
function isCloseParenOfTemplate(token) {
return token.type === "Template" && TEMPLATE_CLOSE_PAREN.test(token.value);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "10.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin-js",
url: "https://eslint.style/packages/js",
},
rule: {
name: "keyword-spacing",
url: "https://eslint.style/rules/js/keyword-spacing",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent spacing before and after keywords",
recommended: false,
url: "https://eslint.org/docs/latest/rules/keyword-spacing",
},
fixable: "whitespace",
schema: [
{
type: "object",
properties: {
before: { type: "boolean", default: true },
after: { type: "boolean", default: true },
overrides: {
type: "object",
properties: KEYS.reduce((retv, key) => {
retv[key] = {
type: "object",
properties: {
before: { type: "boolean" },
after: { type: "boolean" },
},
additionalProperties: false,
};
return retv;
}, {}),
additionalProperties: false,
},
},
additionalProperties: false,
},
],
messages: {
expectedBefore: 'Expected space(s) before "{{value}}".',
expectedAfter: 'Expected space(s) after "{{value}}".',
unexpectedBefore: 'Unexpected space(s) before "{{value}}".',
unexpectedAfter: 'Unexpected space(s) after "{{value}}".',
},
},
create(context) {
const sourceCode = context.sourceCode;
const tokensToIgnore = new WeakSet();
/**
* Reports a given token if there are not space(s) before the token.
* @param {Token} token A token to report.
* @param {RegExp} pattern A pattern of the previous token to check.
* @returns {void}
*/
function expectSpaceBefore(token, pattern) {
const prevToken = sourceCode.getTokenBefore(token);
if (
prevToken &&
(CHECK_TYPE.test(prevToken.type) ||
pattern.test(prevToken.value)) &&
!isOpenParenOfTemplate(prevToken) &&
!tokensToIgnore.has(prevToken) &&
astUtils.isTokenOnSameLine(prevToken, token) &&
!sourceCode.isSpaceBetweenTokens(prevToken, token)
) {
context.report({
loc: token.loc,
messageId: "expectedBefore",
data: token,
fix(fixer) {
return fixer.insertTextBefore(token, " ");
},
});
}
}
/**
* Reports a given token if there are space(s) before the token.
* @param {Token} token A token to report.
* @param {RegExp} pattern A pattern of the previous token to check.
* @returns {void}
*/
function unexpectSpaceBefore(token, pattern) {
const prevToken = sourceCode.getTokenBefore(token);
if (
prevToken &&
(CHECK_TYPE.test(prevToken.type) ||
pattern.test(prevToken.value)) &&
!isOpenParenOfTemplate(prevToken) &&
!tokensToIgnore.has(prevToken) &&
astUtils.isTokenOnSameLine(prevToken, token) &&
sourceCode.isSpaceBetweenTokens(prevToken, token)
) {
context.report({
loc: { start: prevToken.loc.end, end: token.loc.start },
messageId: "unexpectedBefore",
data: token,
fix(fixer) {
return fixer.removeRange([
prevToken.range[1],
token.range[0],
]);
},
});
}
}
/**
* Reports a given token if there are not space(s) after the token.
* @param {Token} token A token to report.
* @param {RegExp} pattern A pattern of the next token to check.
* @returns {void}
*/
function expectSpaceAfter(token, pattern) {
const nextToken = sourceCode.getTokenAfter(token);
if (
nextToken &&
(CHECK_TYPE.test(nextToken.type) ||
pattern.test(nextToken.value)) &&
!isCloseParenOfTemplate(nextToken) &&
!tokensToIgnore.has(nextToken) &&
astUtils.isTokenOnSameLine(token, nextToken) &&
!sourceCode.isSpaceBetweenTokens(token, nextToken)
) {
context.report({
loc: token.loc,
messageId: "expectedAfter",
data: token,
fix(fixer) {
return fixer.insertTextAfter(token, " ");
},
});
}
}
/**
* Reports a given token if there are space(s) after the token.
* @param {Token} token A token to report.
* @param {RegExp} pattern A pattern of the next token to check.
* @returns {void}
*/
function unexpectSpaceAfter(token, pattern) {
const nextToken = sourceCode.getTokenAfter(token);
if (
nextToken &&
(CHECK_TYPE.test(nextToken.type) ||
pattern.test(nextToken.value)) &&
!isCloseParenOfTemplate(nextToken) &&
!tokensToIgnore.has(nextToken) &&
astUtils.isTokenOnSameLine(token, nextToken) &&
sourceCode.isSpaceBetweenTokens(token, nextToken)
) {
context.report({
loc: { start: token.loc.end, end: nextToken.loc.start },
messageId: "unexpectedAfter",
data: token,
fix(fixer) {
return fixer.removeRange([
token.range[1],
nextToken.range[0],
]);
},
});
}
}
/**
* Parses the option object and determines check methods for each keyword.
* @param {Object|undefined} options The option object to parse.
* @returns {Object} - Normalized option object.
* Keys are keywords (there are for every keyword).
* Values are instances of `{"before": function, "after": function}`.
*/
function parseOptions(options = {}) {
const before = options.before !== false;
const after = options.after !== false;
const defaultValue = {
before: before ? expectSpaceBefore : unexpectSpaceBefore,
after: after ? expectSpaceAfter : unexpectSpaceAfter,
};
const overrides = (options && options.overrides) || {};
const retv = Object.create(null);
for (let i = 0; i < KEYS.length; ++i) {
const key = KEYS[i];
const override = overrides[key];
if (override) {
const thisBefore =
"before" in override ? override.before : before;
const thisAfter =
"after" in override ? override.after : after;
retv[key] = {
before: thisBefore
? expectSpaceBefore
: unexpectSpaceBefore,
after: thisAfter
? expectSpaceAfter
: unexpectSpaceAfter,
};
} else {
retv[key] = defaultValue;
}
}
return retv;
}
const checkMethodMap = parseOptions(context.options[0]);
/**
* Reports a given token if usage of spacing followed by the token is
* invalid.
* @param {Token} token A token to report.
* @param {RegExp} [pattern] Optional. A pattern of the previous
* token to check.
* @returns {void}
*/
function checkSpacingBefore(token, pattern) {
checkMethodMap[token.value].before(token, pattern || PREV_TOKEN);
}
/**
* Reports a given token if usage of spacing preceded by the token is
* invalid.
* @param {Token} token A token to report.
* @param {RegExp} [pattern] Optional. A pattern of the next
* token to check.
* @returns {void}
*/
function checkSpacingAfter(token, pattern) {
checkMethodMap[token.value].after(token, pattern || NEXT_TOKEN);
}
/**
* Reports a given token if usage of spacing around the token is invalid.
* @param {Token} token A token to report.
* @returns {void}
*/
function checkSpacingAround(token) {
checkSpacingBefore(token);
checkSpacingAfter(token);
}
/**
* Reports the first token of a given node if the first token is a keyword
* and usage of spacing around the token is invalid.
* @param {ASTNode|null} node A node to report.
* @returns {void}
*/
function checkSpacingAroundFirstToken(node) {
const firstToken = node && sourceCode.getFirstToken(node);
if (firstToken && firstToken.type === "Keyword") {
checkSpacingAround(firstToken);
}
}
/**
* Reports the first token of a given node if the first token is a keyword
* and usage of spacing followed by the token is invalid.
*
* This is used for unary operators (e.g. `typeof`), `function`, and `super`.
* Other rules are handling usage of spacing preceded by those keywords.
* @param {ASTNode|null} node A node to report.
* @returns {void}
*/
function checkSpacingBeforeFirstToken(node) {
const firstToken = node && sourceCode.getFirstToken(node);
if (firstToken && firstToken.type === "Keyword") {
checkSpacingBefore(firstToken);
}
}
/**
* Reports the previous token of a given node if the token is a keyword and
* usage of spacing around the token is invalid.
* @param {ASTNode|null} node A node to report.
* @returns {void}
*/
function checkSpacingAroundTokenBefore(node) {
if (node) {
const token = sourceCode.getTokenBefore(
node,
astUtils.isKeywordToken,
);
checkSpacingAround(token);
}
}
/**
* Reports `async` or `function` keywords of a given node if usage of
* spacing around those keywords is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForFunction(node) {
const firstToken = node && sourceCode.getFirstToken(node);
if (
firstToken &&
((firstToken.type === "Keyword" &&
firstToken.value === "function") ||
firstToken.value === "async")
) {
checkSpacingBefore(firstToken);
}
}
/**
* Reports `class` and `extends` keywords of a given node if usage of
* spacing around those keywords is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForClass(node) {
checkSpacingAroundFirstToken(node);
checkSpacingAroundTokenBefore(node.superClass);
}
/**
* Reports `if` and `else` keywords of a given node if usage of spacing
* around those keywords is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForIfStatement(node) {
checkSpacingAroundFirstToken(node);
checkSpacingAroundTokenBefore(node.alternate);
}
/**
* Reports `try`, `catch`, and `finally` keywords of a given node if usage
* of spacing around those keywords is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForTryStatement(node) {
checkSpacingAroundFirstToken(node);
checkSpacingAroundFirstToken(node.handler);
checkSpacingAroundTokenBefore(node.finalizer);
}
/**
* Reports `do` and `while` keywords of a given node if usage of spacing
* around those keywords is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForDoWhileStatement(node) {
checkSpacingAroundFirstToken(node);
checkSpacingAroundTokenBefore(node.test);
}
/**
* Reports `for` and `in` keywords of a given node if usage of spacing
* around those keywords is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForForInStatement(node) {
checkSpacingAroundFirstToken(node);
const inToken = sourceCode.getTokenBefore(
node.right,
astUtils.isNotOpeningParenToken,
);
const previousToken = sourceCode.getTokenBefore(inToken);
if (previousToken.type !== "PrivateIdentifier") {
checkSpacingBefore(inToken);
}
checkSpacingAfter(inToken);
}
/**
* Reports `for` and `of` keywords of a given node if usage of spacing
* around those keywords is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForForOfStatement(node) {
if (node.await) {
checkSpacingBefore(sourceCode.getFirstToken(node, 0));
checkSpacingAfter(sourceCode.getFirstToken(node, 1));
} else {
checkSpacingAroundFirstToken(node);
}
const ofToken = sourceCode.getTokenBefore(
node.right,
astUtils.isNotOpeningParenToken,
);
const previousToken = sourceCode.getTokenBefore(ofToken);
if (previousToken.type !== "PrivateIdentifier") {
checkSpacingBefore(ofToken);
}
checkSpacingAfter(ofToken);
}
/**
* Reports `import`, `export`, `as`, and `from` keywords of a given node if
* usage of spacing around those keywords is invalid.
*
* This rule handles the `*` token in module declarations.
*
* import*as A from "./a"; /*error Expected space(s) after "import".
* error Expected space(s) before "as".
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForModuleDeclaration(node) {
const firstToken = sourceCode.getFirstToken(node);
checkSpacingBefore(firstToken, PREV_TOKEN_M);
checkSpacingAfter(firstToken, NEXT_TOKEN_M);
if (node.type === "ExportDefaultDeclaration") {
checkSpacingAround(sourceCode.getTokenAfter(firstToken));
}
if (node.type === "ExportAllDeclaration" && node.exported) {
const asToken = sourceCode.getTokenBefore(node.exported);
checkSpacingBefore(asToken, PREV_TOKEN_M);
checkSpacingAfter(asToken, NEXT_TOKEN_M);
}
if (node.source) {
const fromToken = sourceCode.getTokenBefore(node.source);
checkSpacingBefore(fromToken, PREV_TOKEN_M);
checkSpacingAfter(fromToken, NEXT_TOKEN_M);
}
}
/**
* Reports `as` keyword of a given node if usage of spacing around this
* keyword is invalid.
* @param {ASTNode} node An `ImportSpecifier` node to check.
* @returns {void}
*/
function checkSpacingForImportSpecifier(node) {
if (node.imported.range[0] !== node.local.range[0]) {
const asToken = sourceCode.getTokenBefore(node.local);
checkSpacingBefore(asToken, PREV_TOKEN_M);
}
}
/**
* Reports `as` keyword of a given node if usage of spacing around this
* keyword is invalid.
* @param {ASTNode} node An `ExportSpecifier` node to check.
* @returns {void}
*/
function checkSpacingForExportSpecifier(node) {
if (node.local.range[0] !== node.exported.range[0]) {
const asToken = sourceCode.getTokenBefore(node.exported);
checkSpacingBefore(asToken, PREV_TOKEN_M);
checkSpacingAfter(asToken, NEXT_TOKEN_M);
}
}
/**
* Reports `as` keyword of a given node if usage of spacing around this
* keyword is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForImportNamespaceSpecifier(node) {
const asToken = sourceCode.getFirstToken(node, 1);
checkSpacingBefore(asToken, PREV_TOKEN_M);
}
/**
* Reports `static`, `get`, and `set` keywords of a given node if usage of
* spacing around those keywords is invalid.
* @param {ASTNode} node A node to report.
* @throws {Error} If unable to find token get, set, or async beside method name.
* @returns {void}
*/
function checkSpacingForProperty(node) {
if (node.static) {
checkSpacingAroundFirstToken(node);
}
if (
node.kind === "get" ||
node.kind === "set" ||
((node.method || node.type === "MethodDefinition") &&
node.value.async)
) {
const token = sourceCode.getTokenBefore(node.key, tok => {
switch (tok.value) {
case "get":
case "set":
case "async":
return true;
default:
return false;
}
});
if (!token) {
throw new Error(
"Failed to find token get, set, or async beside method name",
);
}
checkSpacingAround(token);
}
}
/**
* Reports `await` keyword of a given node if usage of spacing before
* this keyword is invalid.
* @param {ASTNode} node A node to report.
* @returns {void}
*/
function checkSpacingForAwaitExpression(node) {
checkSpacingBefore(sourceCode.getFirstToken(node));
}
return {
// Statements
DebuggerStatement: checkSpacingAroundFirstToken,
WithStatement: checkSpacingAroundFirstToken,
// Statements - Control flow
BreakStatement: checkSpacingAroundFirstToken,
ContinueStatement: checkSpacingAroundFirstToken,
ReturnStatement: checkSpacingAroundFirstToken,
ThrowStatement: checkSpacingAroundFirstToken,
TryStatement: checkSpacingForTryStatement,
// Statements - Choice
IfStatement: checkSpacingForIfStatement,
SwitchStatement: checkSpacingAroundFirstToken,
SwitchCase: checkSpacingAroundFirstToken,
// Statements - Loops
DoWhileStatement: checkSpacingForDoWhileStatement,
ForInStatement: checkSpacingForForInStatement,
ForOfStatement: checkSpacingForForOfStatement,
ForStatement: checkSpacingAroundFirstToken,
WhileStatement: checkSpacingAroundFirstToken,
// Statements - Declarations
ClassDeclaration: checkSpacingForClass,
ExportNamedDeclaration: checkSpacingForModuleDeclaration,
ExportDefaultDeclaration: checkSpacingForModuleDeclaration,
ExportAllDeclaration: checkSpacingForModuleDeclaration,
FunctionDeclaration: checkSpacingForFunction,
ImportDeclaration: checkSpacingForModuleDeclaration,
VariableDeclaration: checkSpacingAroundFirstToken,
// Expressions
ArrowFunctionExpression: checkSpacingForFunction,
AwaitExpression: checkSpacingForAwaitExpression,
ClassExpression: checkSpacingForClass,
FunctionExpression: checkSpacingForFunction,
NewExpression: checkSpacingBeforeFirstToken,
Super: checkSpacingBeforeFirstToken,
ThisExpression: checkSpacingBeforeFirstToken,
UnaryExpression: checkSpacingBeforeFirstToken,
YieldExpression: checkSpacingBeforeFirstToken,
// Others
ImportSpecifier: checkSpacingForImportSpecifier,
ExportSpecifier: checkSpacingForExportSpecifier,
ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier,
MethodDefinition: checkSpacingForProperty,
PropertyDefinition: checkSpacingForProperty,
StaticBlock: checkSpacingAroundFirstToken,
Property: checkSpacingForProperty,
// To avoid conflicts with `space-infix-ops`, e.g. `a > this.b`
"BinaryExpression[operator='>']"(node) {
const operatorToken = sourceCode.getTokenBefore(
node.right,
astUtils.isNotOpeningParenToken,
);
tokensToIgnore.add(operatorToken);
},
};
},
};

View File

@@ -0,0 +1,235 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = applyDecs2305;
var _checkInRHS = require("./checkInRHS.js");
var _setFunctionName = require("./setFunctionName.js");
var _toPropertyKey = require("./toPropertyKey.js");
function applyDecs2305(targetClass, memberDecs, classDecs, classDecsHaveThis, instanceBrand, parentClass) {
function _bindPropCall(obj, name, before) {
return function (_this, value) {
if (before) {
before(_this);
}
return obj[name].call(_this, value);
};
}
function runInitializers(initializers, value) {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(value);
}
return value;
}
function assertCallable(fn, hint1, hint2, throwUndefined) {
if (typeof fn !== "function") {
if (throwUndefined || fn !== void 0) {
throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
}
}
return fn;
}
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, metadata, initializers, ret, isStatic, isPrivate, isField, isAccessor, hasPrivateBrand) {
function assertInstanceIfPrivate(target) {
if (!hasPrivateBrand(target)) {
throw new TypeError("Attempted to access private element on non-instance");
}
}
var decs = decInfo[0],
decVal = decInfo[3],
_,
isClass = !ret;
if (!isClass) {
if (!decoratorsHaveThis && !Array.isArray(decs)) {
decs = [decs];
}
var desc = {},
init = [],
key = kind === 3 ? "get" : kind === 4 || isAccessor ? "set" : "value";
if (isPrivate) {
if (isField || isAccessor) {
desc = {
get: (0, _setFunctionName.default)(function () {
return decVal(this);
}, name, "get"),
set: function (value) {
decInfo[4](this, value);
}
};
} else {
desc[key] = decVal;
}
if (!isField) {
(0, _setFunctionName.default)(desc[key], name, kind === 2 ? "" : key);
}
} else if (!isField) {
desc = Object.getOwnPropertyDescriptor(Class, name);
}
}
var newValue = Class;
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
var dec = decs[i],
decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
var decoratorFinishedRef = {};
var ctx = {
kind: ["field", "accessor", "method", "getter", "setter", "class"][kind],
name: name,
metadata: metadata,
addInitializer: function (decoratorFinishedRef, initializer) {
if (decoratorFinishedRef.v) {
throw new Error("attempted to call addInitializer after decoration was finished");
}
assertCallable(initializer, "An initializer", "be", true);
initializers.push(initializer);
}.bind(null, decoratorFinishedRef)
};
try {
if (isClass) {
if (_ = assertCallable(dec.call(decThis, newValue, ctx), "class decorators", "return")) {
newValue = _;
}
} else {
ctx.static = isStatic;
ctx.private = isPrivate;
var get, set;
if (!isPrivate) {
get = function (target) {
return target[name];
};
if (kind < 2 || kind === 4) {
set = function (target, v) {
target[name] = v;
};
}
} else if (kind === 2) {
get = function (_this) {
assertInstanceIfPrivate(_this);
return desc.value;
};
} else {
if (kind < 4) {
get = _bindPropCall(desc, "get", assertInstanceIfPrivate);
}
if (kind !== 3) {
set = _bindPropCall(desc, "set", assertInstanceIfPrivate);
}
}
var access = ctx.access = {
has: isPrivate ? hasPrivateBrand.bind() : function (target) {
return name in target;
}
};
if (get) access.get = get;
if (set) access.set = set;
newValue = dec.call(decThis, isAccessor ? {
get: desc.get,
set: desc.set
} : desc[key], ctx);
if (isAccessor) {
if (typeof newValue === "object" && newValue) {
if (_ = assertCallable(newValue.get, "accessor.get")) {
desc.get = _;
}
if (_ = assertCallable(newValue.set, "accessor.set")) {
desc.set = _;
}
if (_ = assertCallable(newValue.init, "accessor.init")) {
init.push(_);
}
} else if (newValue !== void 0) {
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
}
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) {
if (isField) {
init.push(newValue);
} else {
desc[key] = newValue;
}
}
}
} finally {
decoratorFinishedRef.v = true;
}
}
if (isField || isAccessor) {
ret.push(function (instance, value) {
for (var i = init.length - 1; i >= 0; i--) {
value = init[i].call(instance, value);
}
return value;
});
}
if (!isField && !isClass) {
if (isPrivate) {
if (isAccessor) {
ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set"));
} else {
ret.push(kind === 2 ? desc[key] : _bindPropCall.call.bind(desc[key]));
}
} else {
Object.defineProperty(Class, name, desc);
}
}
return newValue;
}
function applyMemberDecs(Class, decInfos, instanceBrand, metadata) {
var ret = [];
var protoInitializers;
var staticInitializers;
var staticBrand = function (_) {
return (0, _checkInRHS.default)(_) === Class;
};
var existingNonFields = new Map();
function pushInitializers(initializers) {
if (initializers) {
ret.push(runInitializers.bind(null, initializers));
}
}
for (var i = 0; i < decInfos.length; i++) {
var decInfo = decInfos[i];
if (!Array.isArray(decInfo)) continue;
var kind = decInfo[1];
var name = decInfo[2];
var isPrivate = decInfo.length > 3;
var decoratorsHaveThis = kind & 16;
var isStatic = !!(kind & 8);
kind &= 7;
var isField = kind === 0;
var key = name + "/" + isStatic;
if (!isField && !isPrivate) {
var existingKind = existingNonFields.get(key);
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
}
existingNonFields.set(key, kind > 2 ? kind : true);
}
applyDec(isStatic ? Class : Class.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kind, metadata, isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, isStatic, isPrivate, isField, kind === 1, isStatic && isPrivate ? staticBrand : instanceBrand);
}
pushInitializers(protoInitializers);
pushInitializers(staticInitializers);
return ret;
}
function defineMetadata(Class, metadata) {
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
configurable: true,
enumerable: true,
value: metadata
});
}
if (arguments.length >= 6) {
var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
}
var metadata = Object.create(parentMetadata == null ? null : parentMetadata);
var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);
if (!classDecs.length) defineMetadata(targetClass, metadata);
return {
e: e,
get c() {
var initializers = [];
return classDecs.length && [defineMetadata(applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, metadata, initializers), metadata), runInitializers.bind(null, initializers, targetClass)];
}
};
}
//# sourceMappingURL=applyDecs2305.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"36":0.00347,"59":0.05552,"78":0.00347,"102":0.00347,"113":0.00347,"114":0.00347,"115":0.0694,"123":0.00347,"124":0.00347,"127":0.01041,"128":0.01735,"129":0.00347,"132":0.00694,"133":0.00694,"134":0.00694,"135":0.19432,"136":0.66624,"137":0.00347,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 116 117 118 119 120 121 122 125 126 130 131 138 139 140 3.6","3.5":0.00347},D:{"39":0.06593,"40":0.06593,"41":0.06593,"42":0.06593,"43":0.06593,"44":0.0694,"45":0.06593,"46":0.06593,"47":0.0694,"48":0.06593,"49":0.0694,"50":0.06593,"51":0.06593,"52":0.07287,"53":0.0694,"54":0.06593,"55":0.0694,"56":0.06593,"57":0.0694,"58":0.0694,"59":0.0694,"60":0.06593,"61":0.00694,"62":0.00347,"63":0.00694,"65":0.00694,"74":0.01388,"79":0.02429,"81":0.03123,"85":0.00347,"86":0.00347,"87":0.02082,"88":0.00694,"91":0.00347,"92":0.00347,"93":0.00694,"94":0.00347,"102":0.00347,"103":0.03817,"104":0.02082,"105":0.00347,"106":0.03817,"107":0.00347,"108":0.01388,"109":0.28107,"110":0.00347,"111":0.00347,"112":0.00694,"113":0.01388,"114":0.02429,"115":0.00694,"116":0.06593,"117":0.0347,"118":0.00347,"119":0.00694,"120":0.1041,"121":0.01735,"122":0.07287,"123":0.05205,"124":0.05552,"125":1.22144,"126":0.31577,"127":0.25331,"128":0.05899,"129":0.05899,"130":0.21514,"131":3.16117,"132":3.31038,"133":6.94,"134":6.61729,"135":0.00694,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 64 66 67 68 69 70 71 72 73 75 76 77 78 80 83 84 89 90 95 96 97 98 99 100 101 136 137 138"},F:{"46":0.00347,"87":0.00694,"88":0.00347,"95":0.00347,"107":0.02776,"114":0.00347,"116":0.11104,"117":0.35741,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 108 109 110 111 112 113 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00347,"107":0.00347,"109":0.01041,"113":0.00347,"114":0.00694,"115":0.00347,"117":0.00347,"120":0.01041,"121":0.02082,"122":0.01041,"124":0.00347,"125":0.00694,"126":0.05552,"127":0.00347,"128":0.00347,"129":0.01041,"130":0.01735,"131":0.04164,"132":0.11104,"133":1.20062,"134":2.776,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 108 110 111 112 116 118 119 123"},E:{"8":0.00347,"13":0.00347,"14":0.02429,"15":0.00347,_:"0 4 5 6 7 9 10 11 12 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1","12.1":0.00347,"13.1":0.02082,"14.1":0.04858,"15.1":0.00347,"15.2-15.3":0.01388,"15.4":0.01388,"15.5":0.02776,"15.6":0.15962,"16.0":0.02776,"16.1":0.01388,"16.2":0.0347,"16.3":0.06593,"16.4":0.01041,"16.5":0.01735,"16.6":0.17003,"17.0":0.01041,"17.1":0.13533,"17.2":0.02082,"17.3":0.01735,"17.4":0.05899,"17.5":0.11104,"17.6":0.2429,"18.0":0.03123,"18.1":0.13186,"18.2":0.04511,"18.3":1.23532,"18.4":0.01388},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00372,"5.0-5.1":0,"6.0-6.1":0.01116,"7.0-7.1":0.00744,"8.1-8.4":0,"9.0-9.2":0.00558,"9.3":0.02605,"10.0-10.2":0.00186,"10.3":0.04279,"11.0-11.2":0.1972,"11.3-11.4":0.01302,"12.0-12.1":0.00744,"12.2-12.5":0.18418,"13.0-13.1":0.00372,"13.2":0.00558,"13.3":0.00744,"13.4-13.7":0.02605,"14.0-14.4":0.06511,"14.5-14.8":0.07814,"15.0-15.1":0.04279,"15.2-15.3":0.04279,"15.4":0.05209,"15.5":0.05953,"15.6-15.8":0.733,"16.0":0.10418,"16.1":0.21395,"16.2":0.11162,"16.3":0.19348,"16.4":0.04279,"16.5":0.08,"16.6-16.7":0.86881,"17.0":0.05209,"17.1":0.09302,"17.2":0.0707,"17.3":0.0986,"17.4":0.1972,"17.5":0.43905,"17.6-17.7":1.27437,"18.0":0.3572,"18.1":1.16833,"18.2":0.52277,"18.3":10.92611,"18.4":0.16185},P:{"20":0.02083,"21":0.03125,"22":0.03125,"23":0.04167,"24":0.05208,"25":0.04167,"26":0.07291,"27":2.68742,_:"4 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0","7.2-7.4":0.01042,"18.0":0.01042,"19.0":0.01042},I:{"0":0.05865,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00006},K:{"0":0.11754,_:"10 11 12 11.1 11.5 12.1"},A:{"9":0.02002,"11":0.03203,_:"6 7 8 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.37221},Q:{_:"14.9"},O:{"0":0.00653},H:{"0":0},L:{"0":43.52313}};

View File

@@ -0,0 +1,272 @@
/* eslint-env browser */
/**
* This is the web browser implementation of `debug()`.
*/
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = localstorage();
exports.destroy = (() => {
let warned = false;
return () => {
if (!warned) {
warned = true;
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
}
};
})();
/**
* Colors.
*/
exports.colors = [
'#0000CC',
'#0000FF',
'#0033CC',
'#0033FF',
'#0066CC',
'#0066FF',
'#0099CC',
'#0099FF',
'#00CC00',
'#00CC33',
'#00CC66',
'#00CC99',
'#00CCCC',
'#00CCFF',
'#3300CC',
'#3300FF',
'#3333CC',
'#3333FF',
'#3366CC',
'#3366FF',
'#3399CC',
'#3399FF',
'#33CC00',
'#33CC33',
'#33CC66',
'#33CC99',
'#33CCCC',
'#33CCFF',
'#6600CC',
'#6600FF',
'#6633CC',
'#6633FF',
'#66CC00',
'#66CC33',
'#9900CC',
'#9900FF',
'#9933CC',
'#9933FF',
'#99CC00',
'#99CC33',
'#CC0000',
'#CC0033',
'#CC0066',
'#CC0099',
'#CC00CC',
'#CC00FF',
'#CC3300',
'#CC3333',
'#CC3366',
'#CC3399',
'#CC33CC',
'#CC33FF',
'#CC6600',
'#CC6633',
'#CC9900',
'#CC9933',
'#CCCC00',
'#CCCC33',
'#FF0000',
'#FF0033',
'#FF0066',
'#FF0099',
'#FF00CC',
'#FF00FF',
'#FF3300',
'#FF3333',
'#FF3366',
'#FF3399',
'#FF33CC',
'#FF33FF',
'#FF6600',
'#FF6633',
'#FF9900',
'#FF9933',
'#FFCC00',
'#FFCC33'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colors
*/
// eslint-disable-next-line complexity
function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
return true;
}
// Internet Explorer and Edge do not support colors.
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
let m;
// Is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
// eslint-disable-next-line no-return-assign
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// Is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// Is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
// Double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs(args) {
args[0] = (this.useColors ? '%c' : '') +
this.namespace +
(this.useColors ? ' %c' : ' ') +
args[0] +
(this.useColors ? '%c ' : ' ') +
'+' + module.exports.humanize(this.diff);
if (!this.useColors) {
return;
}
const c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit');
// The final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
let index = 0;
let lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, match => {
if (match === '%%') {
return;
}
index++;
if (match === '%c') {
// We only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
}
/**
* Invokes `console.debug()` when available.
* No-op when `console.debug` is not a "function".
* If `console.debug` is not available, falls back
* to `console.log`.
*
* @api public
*/
exports.log = console.debug || console.log || (() => {});
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
try {
if (namespaces) {
exports.storage.setItem('debug', namespaces);
} else {
exports.storage.removeItem('debug');
}
} catch (error) {
// Swallow
// XXX (@Qix-) should we be logging these?
}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
let r;
try {
r = exports.storage.getItem('debug');
} catch (error) {
// Swallow
// XXX (@Qix-) should we be logging these?
}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
return r;
}
/**
* Localstorage attempts to return the localstorage.
*
* This is necessary because safari throws
* when a user disables cookies/localstorage
* and you attempt to access it.
*
* @return {LocalStorage}
* @api private
*/
function localstorage() {
try {
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
// The Browser also has localStorage in the global context.
return localStorage;
} catch (error) {
// Swallow
// XXX (@Qix-) should we be logging these?
}
}
module.exports = require('./common')(exports);
const {formatters} = module.exports;
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
*/
formatters.j = function (v) {
try {
return JSON.stringify(v);
} catch (error) {
return '[UnexpectedJSONParseError]: ' + error.message;
}
};

View File

@@ -0,0 +1,120 @@
export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
export type PageViewport = import("../src/display/display_utils").PageViewport;
export type EventBus = import("./event_utils").EventBus;
export type IPDFLinkService = import("./interfaces").IPDFLinkService;
export type IRenderableView = import("./interfaces").IRenderableView;
export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
export type PDFThumbnailViewOptions = {
/**
* - The viewer element.
*/
container: HTMLDivElement;
/**
* - The application event bus.
*/
eventBus: EventBus;
/**
* - The thumbnail's unique ID (normally its number).
*/
id: number;
/**
* - The page viewport.
*/
defaultViewport: PageViewport;
/**
* -
* A promise that is resolved with an {@link OptionalContentConfig} instance.
* The default value is `null`.
*/
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
/**
* - The navigation/linking service.
*/
linkService: IPDFLinkService;
/**
* - The rendering queue object.
*/
renderingQueue: PDFRenderingQueue;
/**
* - Overwrites background and foreground colors
* with user defined ones in order to improve readability in high contrast
* mode.
*/
pageColors?: Object | undefined;
/**
* - Enables hardware acceleration for
* rendering. The default value is `false`.
*/
enableHWA?: boolean | undefined;
};
/**
* @implements {IRenderableView}
*/
export class PDFThumbnailView implements IRenderableView {
/**
* @param {PDFThumbnailViewOptions} options
*/
constructor({ container, eventBus, id, defaultViewport, optionalContentConfigPromise, linkService, renderingQueue, pageColors, enableHWA, }: PDFThumbnailViewOptions);
id: number;
renderingId: string;
pageLabel: string | null;
pdfPage: any;
rotation: number;
viewport: import("../src/display/display_utils").PageViewport;
pdfPageRotate: number;
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
pageColors: Object | null;
enableHWA: boolean;
eventBus: import("./event_utils").EventBus;
linkService: import("./interfaces").IPDFLinkService;
renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue;
renderTask: any;
renderingState: number;
resume: (() => void) | null;
anchor: HTMLAnchorElement;
div: HTMLDivElement;
_placeholderImg: HTMLDivElement;
canvasWidth: number | undefined;
canvasHeight: number | undefined;
scale: number | undefined;
setPdfPage(pdfPage: any): void;
reset(): void;
update({ rotation }: {
rotation?: null | undefined;
}): void;
/**
* PLEASE NOTE: Most likely you want to use the `this.reset()` method,
* rather than calling this one directly.
*/
cancelRendering(): void;
image: HTMLImageElement | undefined;
draw(): Promise<any>;
setImage(pageView: any): void;
/**
* @param {string|null} label
*/
setPageLabel(label: string | null): void;
#private;
}
/**
* @typedef {Object} PDFThumbnailViewOptions
* @property {HTMLDivElement} container - The viewer element.
* @property {EventBus} eventBus - The application event bus.
* @property {number} id - The thumbnail's unique ID (normally its number).
* @property {PageViewport} defaultViewport - The page viewport.
* @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -
* A promise that is resolved with an {@link OptionalContentConfig} instance.
* The default value is `null`.
* @property {IPDFLinkService} linkService - The navigation/linking service.
* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.
* @property {Object} [pageColors] - Overwrites background and foreground colors
* with user defined ones in order to improve readability in high contrast
* mode.
* @property {boolean} [enableHWA] - Enables hardware acceleration for
* rendering. The default value is `false`.
*/
export class TempImageFactory {
static "__#73@#tempCanvas": null;
static getCanvas(width: any, height: any): (HTMLCanvasElement | CanvasRenderingContext2D | null)[];
static destroyCanvas(): void;
}

View File

@@ -0,0 +1,251 @@
'use strict'
let { nanoid } = require('nanoid/non-secure')
let { isAbsolute, resolve } = require('path')
let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
let { fileURLToPath, pathToFileURL } = require('url')
let CssSyntaxError = require('./css-syntax-error')
let PreviousMap = require('./previous-map')
let terminalHighlight = require('./terminal-highlight')
let fromOffsetCache = Symbol('fromOffsetCache')
let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)
let pathAvailable = Boolean(resolve && isAbsolute)
class Input {
get from() {
return this.file || this.id
}
constructor(css, opts = {}) {
if (
css === null ||
typeof css === 'undefined' ||
(typeof css === 'object' && !css.toString)
) {
throw new Error(`PostCSS received ${css} instead of CSS string`)
}
this.css = css.toString()
if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
this.hasBOM = true
this.css = this.css.slice(1)
} else {
this.hasBOM = false
}
this.document = this.css
if (opts.document) this.document = opts.document.toString()
if (opts.from) {
if (
!pathAvailable ||
/^\w+:\/\//.test(opts.from) ||
isAbsolute(opts.from)
) {
this.file = opts.from
} else {
this.file = resolve(opts.from)
}
}
if (pathAvailable && sourceMapAvailable) {
let map = new PreviousMap(this.css, opts)
if (map.text) {
this.map = map
let file = map.consumer().file
if (!this.file && file) this.file = this.mapResolve(file)
}
}
if (!this.file) {
this.id = '<input css ' + nanoid(6) + '>'
}
if (this.map) this.map.file = this.from
}
error(message, line, column, opts = {}) {
let endColumn, endLine, result
if (line && typeof line === 'object') {
let start = line
let end = column
if (typeof start.offset === 'number') {
let pos = this.fromOffset(start.offset)
line = pos.line
column = pos.col
} else {
line = start.line
column = start.column
}
if (typeof end.offset === 'number') {
let pos = this.fromOffset(end.offset)
endLine = pos.line
endColumn = pos.col
} else {
endLine = end.line
endColumn = end.column
}
} else if (!column) {
let pos = this.fromOffset(line)
line = pos.line
column = pos.col
}
let origin = this.origin(line, column, endLine, endColumn)
if (origin) {
result = new CssSyntaxError(
message,
origin.endLine === undefined
? origin.line
: { column: origin.column, line: origin.line },
origin.endLine === undefined
? origin.column
: { column: origin.endColumn, line: origin.endLine },
origin.source,
origin.file,
opts.plugin
)
} else {
result = new CssSyntaxError(
message,
endLine === undefined ? line : { column, line },
endLine === undefined ? column : { column: endColumn, line: endLine },
this.css,
this.file,
opts.plugin
)
}
result.input = { column, endColumn, endLine, line, source: this.css }
if (this.file) {
if (pathToFileURL) {
result.input.url = pathToFileURL(this.file).toString()
}
result.input.file = this.file
}
return result
}
fromOffset(offset) {
let lastLine, lineToIndex
if (!this[fromOffsetCache]) {
let lines = this.css.split('\n')
lineToIndex = new Array(lines.length)
let prevIndex = 0
for (let i = 0, l = lines.length; i < l; i++) {
lineToIndex[i] = prevIndex
prevIndex += lines[i].length + 1
}
this[fromOffsetCache] = lineToIndex
} else {
lineToIndex = this[fromOffsetCache]
}
lastLine = lineToIndex[lineToIndex.length - 1]
let min = 0
if (offset >= lastLine) {
min = lineToIndex.length - 1
} else {
let max = lineToIndex.length - 2
let mid
while (min < max) {
mid = min + ((max - min) >> 1)
if (offset < lineToIndex[mid]) {
max = mid - 1
} else if (offset >= lineToIndex[mid + 1]) {
min = mid + 1
} else {
min = mid
break
}
}
}
return {
col: offset - lineToIndex[min] + 1,
line: min + 1
}
}
mapResolve(file) {
if (/^\w+:\/\//.test(file)) {
return file
}
return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file)
}
origin(line, column, endLine, endColumn) {
if (!this.map) return false
let consumer = this.map.consumer()
let from = consumer.originalPositionFor({ column, line })
if (!from.source) return false
let to
if (typeof endLine === 'number') {
to = consumer.originalPositionFor({ column: endColumn, line: endLine })
}
let fromUrl
if (isAbsolute(from.source)) {
fromUrl = pathToFileURL(from.source)
} else {
fromUrl = new URL(
from.source,
this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile)
)
}
let result = {
column: from.column,
endColumn: to && to.column,
endLine: to && to.line,
line: from.line,
url: fromUrl.toString()
}
if (fromUrl.protocol === 'file:') {
if (fileURLToPath) {
result.file = fileURLToPath(fromUrl)
} else {
/* c8 ignore next 2 */
throw new Error(`file: protocol is not available in this PostCSS build`)
}
}
let source = consumer.sourceContentFor(from.source)
if (source) result.source = source
return result
}
toJSON() {
let json = {}
for (let name of ['hasBOM', 'css', 'file', 'id']) {
if (this[name] != null) {
json[name] = this[name]
}
}
if (this.map) {
json.map = { ...this.map }
if (json.map.consumerCache) {
json.map.consumerCache = undefined
}
}
return json
}
}
module.exports = Input
Input.default = Input
if (terminalHighlight && terminalHighlight.registerInput) {
terminalHighlight.registerInput(Input)
}

View File

@@ -0,0 +1,122 @@
iMurmurHash.js
==============
An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).
This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.
Installation
------------
To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.
```html
<script type="text/javascript" src="/scripts/imurmurhash.min.js"></script>
<script>
// Your code here, access iMurmurHash using the global object MurmurHash3
</script>
```
---
To use iMurmurHash in Node.js, install the module using NPM:
```bash
npm install imurmurhash
```
Then simply include it in your scripts:
```javascript
MurmurHash3 = require('imurmurhash');
```
Quick Example
-------------
```javascript
// Create the initial hash
var hashState = MurmurHash3('string');
// Incrementally add text
hashState.hash('more strings');
hashState.hash('even more strings');
// All calls can be chained if desired
hashState.hash('and').hash('some').hash('more');
// Get a result
hashState.result();
// returns 0xe4ccfe6b
```
Functions
---------
### MurmurHash3 ([string], [seed])
Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:
```javascript
// Use the cached object, calling the function again will return the same
// object (but reset, so the current state would be lost)
hashState = MurmurHash3();
...
// Create a new object that can be safely used however you wish. Calling the
// function again will simply return a new state object, and no state loss
// will occur, at the cost of creating more objects.
hashState = new MurmurHash3();
```
Both methods can be mixed however you like if you have different use cases.
---
### MurmurHash3.prototype.hash (string)
Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.
---
### MurmurHash3.prototype.result ()
Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.
```javascript
// Do the whole string at once
MurmurHash3('this is a test string').result();
// 0x70529328
// Do part of the string, get a result, then the other part
var m = MurmurHash3('this is a');
m.result();
// 0xbfc4f834
m.hash(' test string').result();
// 0x70529328 (same as above)
```
---
### MurmurHash3.prototype.reset ([seed])
Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.
---
License (MIT)
-------------
Copyright (c) 2013 Gary Court, Jens Taylor
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.

View File

@@ -0,0 +1,2 @@
import type { DocumentContextType } from '../types.js';
export default function useDocumentContext(): DocumentContextType;

View File

@@ -0,0 +1 @@
module.exports={C:{"34":0.00128,"47":0.00128,"52":0.00128,"88":0.00256,"100":0.00897,"102":0.00128,"114":0.00128,"115":0.03074,"125":0.01025,"127":0.00128,"128":0.00256,"131":0.00128,"133":0.00256,"134":0.00128,"135":0.03843,"136":0.12298,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 38 39 40 41 42 43 44 45 46 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 99 101 103 104 105 106 107 108 109 110 111 112 113 116 117 118 119 120 121 122 123 124 126 129 130 132 137 138 139 140 3.5 3.6"},D:{"26":0.00128,"34":0.01025,"38":0.03715,"39":0.00128,"40":0.00128,"41":0.00128,"42":0.00128,"43":0.00128,"44":0.00128,"45":0.00128,"46":0.00128,"47":0.00769,"48":0.00128,"49":0.00256,"50":0.00128,"51":0.00128,"52":0.00128,"53":0.00256,"54":0.00256,"55":0.00128,"56":0.00128,"57":0.00512,"58":0.00128,"59":0.00128,"60":0.00128,"61":0.00128,"67":0.00128,"69":0.00128,"70":0.00128,"71":0.00256,"72":0.00128,"73":0.00128,"74":0.00128,"75":0.00128,"76":0.00128,"77":0.00128,"78":0.00128,"79":0.06533,"80":0.00128,"81":0.00384,"83":0.00128,"84":0.00128,"85":0.00512,"86":0.00256,"87":0.05893,"88":0.00128,"89":0.00256,"90":0.00128,"91":0.01025,"92":0.00128,"93":0.00128,"94":0.00641,"95":0.00256,"96":0.00128,"97":0.00128,"99":0.00256,"100":0.01665,"101":0.00128,"102":0.00256,"103":0.01025,"104":0.03971,"105":0.00384,"106":0.00769,"107":0.00641,"108":0.01409,"109":0.43042,"110":0.00512,"111":0.00512,"112":0.00512,"113":0.00256,"114":0.00512,"115":0.00512,"116":0.01665,"117":0.00256,"118":0.00512,"119":0.01409,"120":0.01409,"121":0.01409,"122":0.01793,"123":0.01537,"124":0.03843,"125":0.01281,"126":0.01793,"127":0.01793,"128":0.0269,"129":0.01922,"130":0.02178,"131":0.07942,"132":0.14347,"133":2.11493,"134":3.46511,"135":0.00512,"136":0.00128,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28 29 30 31 32 33 35 36 37 62 63 64 65 66 68 98 137 138"},F:{"28":0.00128,"29":0.00384,"36":0.02306,"40":0.00256,"46":0.01793,"87":0.01281,"88":0.00512,"95":0.00256,"116":0.01922,"117":0.09864,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 30 31 32 33 34 35 37 38 39 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.00128,"18":0.00256,"80":0.00128,"84":0.00128,"86":0.00128,"89":0.00128,"92":0.00128,"107":0.00128,"109":0.00384,"111":0.00256,"114":0.00256,"115":0.00128,"117":0.00128,"119":0.00128,"120":0.00128,"122":0.00128,"124":0.00128,"125":0.00128,"126":0.00128,"127":0.00128,"128":0.00128,"129":0.00128,"130":0.00256,"131":0.0269,"132":0.00769,"133":0.2024,"134":0.50984,_:"12 13 14 15 16 79 81 83 85 87 88 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 108 110 112 113 116 118 121 123"},E:{"13":0.00256,"14":0.01281,"15":0.00256,_:"0 4 5 6 7 8 9 10 11 12 3.1 3.2 5.1 6.1 7.1 10.1 11.1","9.1":0.00128,"12.1":0.00128,"13.1":0.00897,"14.1":0.03074,"15.1":0.00512,"15.2-15.3":0.00384,"15.4":0.00641,"15.5":0.01409,"15.6":0.10889,"16.0":0.00641,"16.1":0.01153,"16.2":0.01025,"16.3":0.02178,"16.4":0.00641,"16.5":0.00769,"16.6":0.09095,"17.0":0.00256,"17.1":0.03203,"17.2":0.00512,"17.3":0.00384,"17.4":0.01537,"17.5":0.02178,"17.6":0.0474,"18.0":0.00641,"18.1":0.02306,"18.2":0.00897,"18.3":0.19471,"18.4":0.00256},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00536,"5.0-5.1":0,"6.0-6.1":0.01609,"7.0-7.1":0.01073,"8.1-8.4":0,"9.0-9.2":0.00804,"9.3":0.03754,"10.0-10.2":0.00268,"10.3":0.06167,"11.0-11.2":0.28423,"11.3-11.4":0.01877,"12.0-12.1":0.01073,"12.2-12.5":0.26546,"13.0-13.1":0.00536,"13.2":0.00804,"13.3":0.01073,"13.4-13.7":0.03754,"14.0-14.4":0.09385,"14.5-14.8":0.11262,"15.0-15.1":0.06167,"15.2-15.3":0.06167,"15.4":0.07508,"15.5":0.0858,"15.6-15.8":1.05647,"16.0":0.15016,"16.1":0.30836,"16.2":0.16088,"16.3":0.27887,"16.4":0.06167,"16.5":0.1153,"16.6-16.7":1.25221,"17.0":0.07508,"17.1":0.13407,"17.2":0.10189,"17.3":0.14211,"17.4":0.28423,"17.5":0.63281,"17.6-17.7":1.83676,"18.0":0.51483,"18.1":1.68392,"18.2":0.75347,"18.3":15.74786,"18.4":0.23328},P:{"4":0.34492,"20":0.02029,"21":0.05072,"22":0.07101,"23":0.07101,"24":0.07101,"25":0.12174,"26":0.23333,"27":1.88694,"5.0-5.4":0.02029,"6.2-6.4":0.01014,"7.2-7.4":0.06087,_:"8.2 10.1 12.0","9.2":0.01014,"11.1-11.2":0.02029,"13.0":0.01014,"14.0":0.01014,"15.0":0.01014,"16.0":0.02029,"17.0":0.01014,"18.0":0.01014,"19.0":0.02029},I:{"0":0.0174,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.3388,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00897,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.09592},Q:{_:"14.9"},O:{"0":2.06664},H:{"0":0.01},L:{"0":54.64275}};