update
This commit is contained in:
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P Q H R S"},C:{"1":"0 9 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B qC rC"},D:{"1":"0 9 T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S"},E:{"1":"A B C L M G wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F sC SC tC uC vC"},F:{"1":"0 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 lD mD IC JC KC nD","2":"J dD eD fD gD hD TC iD jD kD"},Q:{"2":"oD"},R:{"1":"pD"},S:{"1":"rD","2":"qD"}},B:4,C:"CSS revert value",D:true};
|
||||
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
import { useContext } from 'react';
|
||||
|
||||
import OutlineContext from '../../OutlineContext.js';
|
||||
|
||||
import type { OutlineContextType } from '../types.js';
|
||||
|
||||
export default function useOutlineContext(): OutlineContextType {
|
||||
return useContext(OutlineContext);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_OverloadYield","require","_awaitAsyncGenerator","value","OverloadYield"],"sources":["../../src/helpers/awaitAsyncGenerator.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport OverloadYield from \"./OverloadYield.ts\";\n\nexport default function _awaitAsyncGenerator<T>(value: T) {\n return new OverloadYield<T>(value, /* kind: await */ 0);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAEe,SAASC,oBAAoBA,CAAIC,KAAQ,EAAE;EACxD,OAAO,IAAIC,sBAAa,CAAID,KAAK,EAAoB,CAAC,CAAC;AACzD","ignoreList":[]}
|
||||
@@ -0,0 +1,15 @@
|
||||
export function createHeaders(isHttp: any, httpHeaders: any): Headers;
|
||||
export function createResponseStatusError(status: any, url: any): MissingPDFException | UnexpectedResponseException;
|
||||
export function extractFilenameFromHeader(responseHeaders: any): string | null;
|
||||
export function validateRangeRequestCapabilities({ responseHeaders, isHttp, rangeChunkSize, disableRange, }: {
|
||||
responseHeaders: any;
|
||||
isHttp: any;
|
||||
rangeChunkSize: any;
|
||||
disableRange: any;
|
||||
}): {
|
||||
allowRangeRequests: boolean;
|
||||
suggestedLength: undefined;
|
||||
};
|
||||
export function validateResponseStatus(status: any): boolean;
|
||||
import { MissingPDFException } from "../shared/util.js";
|
||||
import { UnexpectedResponseException } from "../shared/util.js";
|
||||
@@ -0,0 +1,149 @@
|
||||
{
|
||||
"id": "http://json-schema.org/draft-04/schema#",
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"description": "Core schema meta-schema",
|
||||
"definitions": {
|
||||
"schemaArray": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": { "$ref": "#" }
|
||||
},
|
||||
"positiveInteger": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"positiveIntegerDefault0": {
|
||||
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
|
||||
},
|
||||
"simpleTypes": {
|
||||
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
|
||||
},
|
||||
"stringArray": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"minItems": 1,
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"$schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": {},
|
||||
"multipleOf": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"exclusiveMinimum": true
|
||||
},
|
||||
"maximum": {
|
||||
"type": "number"
|
||||
},
|
||||
"exclusiveMaximum": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"minimum": {
|
||||
"type": "number"
|
||||
},
|
||||
"exclusiveMinimum": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"maxLength": { "$ref": "#/definitions/positiveInteger" },
|
||||
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
||||
"pattern": {
|
||||
"type": "string",
|
||||
"format": "regex"
|
||||
},
|
||||
"additionalItems": {
|
||||
"anyOf": [
|
||||
{ "type": "boolean" },
|
||||
{ "$ref": "#" }
|
||||
],
|
||||
"default": {}
|
||||
},
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#" },
|
||||
{ "$ref": "#/definitions/schemaArray" }
|
||||
],
|
||||
"default": {}
|
||||
},
|
||||
"maxItems": { "$ref": "#/definitions/positiveInteger" },
|
||||
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
||||
"uniqueItems": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
|
||||
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
||||
"required": { "$ref": "#/definitions/stringArray" },
|
||||
"additionalProperties": {
|
||||
"anyOf": [
|
||||
{ "type": "boolean" },
|
||||
{ "$ref": "#" }
|
||||
],
|
||||
"default": {}
|
||||
},
|
||||
"definitions": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "$ref": "#" },
|
||||
"default": {}
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "$ref": "#" },
|
||||
"default": {}
|
||||
},
|
||||
"patternProperties": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "$ref": "#" },
|
||||
"default": {}
|
||||
},
|
||||
"dependencies": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#" },
|
||||
{ "$ref": "#/definitions/stringArray" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"enum": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"type": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#/definitions/simpleTypes" },
|
||||
{
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/simpleTypes" },
|
||||
"minItems": 1,
|
||||
"uniqueItems": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"format": { "type": "string" },
|
||||
"allOf": { "$ref": "#/definitions/schemaArray" },
|
||||
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
||||
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
||||
"not": { "$ref": "#" }
|
||||
},
|
||||
"dependencies": {
|
||||
"exclusiveMaximum": [ "maximum" ],
|
||||
"exclusiveMinimum": [ "minimum" ]
|
||||
},
|
||||
"default": {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
var ruleModules = require('../dotjs')
|
||||
, toHash = require('./util').toHash;
|
||||
|
||||
module.exports = function rules() {
|
||||
var RULES = [
|
||||
{ type: 'number',
|
||||
rules: [ { 'maximum': ['exclusiveMaximum'] },
|
||||
{ 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },
|
||||
{ type: 'string',
|
||||
rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },
|
||||
{ type: 'array',
|
||||
rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] },
|
||||
{ type: 'object',
|
||||
rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames',
|
||||
{ 'properties': ['additionalProperties', 'patternProperties'] } ] },
|
||||
{ rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] }
|
||||
];
|
||||
|
||||
var ALL = [ 'type', '$comment' ];
|
||||
var KEYWORDS = [
|
||||
'$schema', '$id', 'id', '$data', '$async', 'title',
|
||||
'description', 'default', 'definitions',
|
||||
'examples', 'readOnly', 'writeOnly',
|
||||
'contentMediaType', 'contentEncoding',
|
||||
'additionalItems', 'then', 'else'
|
||||
];
|
||||
var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
|
||||
RULES.all = toHash(ALL);
|
||||
RULES.types = toHash(TYPES);
|
||||
|
||||
RULES.forEach(function (group) {
|
||||
group.rules = group.rules.map(function (keyword) {
|
||||
var implKeywords;
|
||||
if (typeof keyword == 'object') {
|
||||
var key = Object.keys(keyword)[0];
|
||||
implKeywords = keyword[key];
|
||||
keyword = key;
|
||||
implKeywords.forEach(function (k) {
|
||||
ALL.push(k);
|
||||
RULES.all[k] = true;
|
||||
});
|
||||
}
|
||||
ALL.push(keyword);
|
||||
var rule = RULES.all[keyword] = {
|
||||
keyword: keyword,
|
||||
code: ruleModules[keyword],
|
||||
implements: implKeywords
|
||||
};
|
||||
return rule;
|
||||
});
|
||||
|
||||
RULES.all.$comment = {
|
||||
keyword: '$comment',
|
||||
code: ruleModules.$comment
|
||||
};
|
||||
|
||||
if (group.type) RULES.types[group.type] = group;
|
||||
});
|
||||
|
||||
RULES.keywords = toHash(ALL.concat(KEYWORDS));
|
||||
RULES.custom = {};
|
||||
|
||||
return RULES;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P"},C:{"2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB qC rC","1028":"c d e f g","3076":"fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b","8196":"0 9 h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC"},D:{"1":"0 9 MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB","132":"nB oB","260":"pB qB","516":"rB sB tB uB vB"},E:{"1":"JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F A B C L M sC SC tC uC vC wC TC FC GC xC yC","4100":"G zC UC VC HC 0C IC WC XC YC ZC aC 1C"},F:{"1":"0 jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB 4C 5C 6C 7C FC kC 8C GC","132":"aB bB","260":"cB dB","516":"eB fB gB hB iB"},G:{"1":"JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD","4100":"SD UC VC HC TD IC WC XC YC ZC aC UD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"8196":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 eD fD gD hD TC iD jD kD lD mD IC JC KC nD","16":"J dD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"3076":"qD rD"}},B:1,C:"createImageBitmap",D:true};
|
||||
@@ -0,0 +1,267 @@
|
||||
// Copyright 2017 Lovell Fuller and others.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
'use strict';
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const { isLinux, getReport } = require('./process');
|
||||
const { LDD_PATH, readFile, readFileSync } = require('./filesystem');
|
||||
|
||||
let cachedFamilyFilesystem;
|
||||
let cachedVersionFilesystem;
|
||||
|
||||
const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true';
|
||||
let commandOut = '';
|
||||
|
||||
const safeCommand = () => {
|
||||
if (!commandOut) {
|
||||
return new Promise((resolve) => {
|
||||
childProcess.exec(command, (err, out) => {
|
||||
commandOut = err ? ' ' : out;
|
||||
resolve(commandOut);
|
||||
});
|
||||
});
|
||||
}
|
||||
return commandOut;
|
||||
};
|
||||
|
||||
const safeCommandSync = () => {
|
||||
if (!commandOut) {
|
||||
try {
|
||||
commandOut = childProcess.execSync(command, { encoding: 'utf8' });
|
||||
} catch (_err) {
|
||||
commandOut = ' ';
|
||||
}
|
||||
}
|
||||
return commandOut;
|
||||
};
|
||||
|
||||
/**
|
||||
* A String constant containing the value `glibc`.
|
||||
* @type {string}
|
||||
* @public
|
||||
*/
|
||||
const GLIBC = 'glibc';
|
||||
|
||||
/**
|
||||
* A Regexp constant to get the GLIBC Version.
|
||||
* @type {string}
|
||||
*/
|
||||
const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
|
||||
|
||||
/**
|
||||
* A String constant containing the value `musl`.
|
||||
* @type {string}
|
||||
* @public
|
||||
*/
|
||||
const MUSL = 'musl';
|
||||
|
||||
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-');
|
||||
|
||||
const familyFromReport = () => {
|
||||
const report = getReport();
|
||||
if (report.header && report.header.glibcVersionRuntime) {
|
||||
return GLIBC;
|
||||
}
|
||||
if (Array.isArray(report.sharedObjects)) {
|
||||
if (report.sharedObjects.some(isFileMusl)) {
|
||||
return MUSL;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const familyFromCommand = (out) => {
|
||||
const [getconf, ldd1] = out.split(/[\r\n]+/);
|
||||
if (getconf && getconf.includes(GLIBC)) {
|
||||
return GLIBC;
|
||||
}
|
||||
if (ldd1 && ldd1.includes(MUSL)) {
|
||||
return MUSL;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const getFamilyFromLddContent = (content) => {
|
||||
if (content.includes('musl')) {
|
||||
return MUSL;
|
||||
}
|
||||
if (content.includes('GNU C Library')) {
|
||||
return GLIBC;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const familyFromFilesystem = async () => {
|
||||
if (cachedFamilyFilesystem !== undefined) {
|
||||
return cachedFamilyFilesystem;
|
||||
}
|
||||
cachedFamilyFilesystem = null;
|
||||
try {
|
||||
const lddContent = await readFile(LDD_PATH);
|
||||
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
||||
} catch (e) {}
|
||||
return cachedFamilyFilesystem;
|
||||
};
|
||||
|
||||
const familyFromFilesystemSync = () => {
|
||||
if (cachedFamilyFilesystem !== undefined) {
|
||||
return cachedFamilyFilesystem;
|
||||
}
|
||||
cachedFamilyFilesystem = null;
|
||||
try {
|
||||
const lddContent = readFileSync(LDD_PATH);
|
||||
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
||||
} catch (e) {}
|
||||
return cachedFamilyFilesystem;
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolves with the libc family when it can be determined, `null` otherwise.
|
||||
* @returns {Promise<?string>}
|
||||
*/
|
||||
const family = async () => {
|
||||
let family = null;
|
||||
if (isLinux()) {
|
||||
family = await familyFromFilesystem();
|
||||
if (!family) {
|
||||
family = familyFromReport();
|
||||
}
|
||||
if (!family) {
|
||||
const out = await safeCommand();
|
||||
family = familyFromCommand(out);
|
||||
}
|
||||
}
|
||||
return family;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the libc family when it can be determined, `null` otherwise.
|
||||
* @returns {?string}
|
||||
*/
|
||||
const familySync = () => {
|
||||
let family = null;
|
||||
if (isLinux()) {
|
||||
family = familyFromFilesystemSync();
|
||||
if (!family) {
|
||||
family = familyFromReport();
|
||||
}
|
||||
if (!family) {
|
||||
const out = safeCommandSync();
|
||||
family = familyFromCommand(out);
|
||||
}
|
||||
}
|
||||
return family;
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolves `true` only when the platform is Linux and the libc family is not `glibc`.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;
|
||||
|
||||
/**
|
||||
* Returns `true` only when the platform is Linux and the libc family is not `glibc`.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
|
||||
|
||||
const versionFromFilesystem = async () => {
|
||||
if (cachedVersionFilesystem !== undefined) {
|
||||
return cachedVersionFilesystem;
|
||||
}
|
||||
cachedVersionFilesystem = null;
|
||||
try {
|
||||
const lddContent = await readFile(LDD_PATH);
|
||||
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
||||
if (versionMatch) {
|
||||
cachedVersionFilesystem = versionMatch[1];
|
||||
}
|
||||
} catch (e) {}
|
||||
return cachedVersionFilesystem;
|
||||
};
|
||||
|
||||
const versionFromFilesystemSync = () => {
|
||||
if (cachedVersionFilesystem !== undefined) {
|
||||
return cachedVersionFilesystem;
|
||||
}
|
||||
cachedVersionFilesystem = null;
|
||||
try {
|
||||
const lddContent = readFileSync(LDD_PATH);
|
||||
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
||||
if (versionMatch) {
|
||||
cachedVersionFilesystem = versionMatch[1];
|
||||
}
|
||||
} catch (e) {}
|
||||
return cachedVersionFilesystem;
|
||||
};
|
||||
|
||||
const versionFromReport = () => {
|
||||
const report = getReport();
|
||||
if (report.header && report.header.glibcVersionRuntime) {
|
||||
return report.header.glibcVersionRuntime;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const versionSuffix = (s) => s.trim().split(/\s+/)[1];
|
||||
|
||||
const versionFromCommand = (out) => {
|
||||
const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/);
|
||||
if (getconf && getconf.includes(GLIBC)) {
|
||||
return versionSuffix(getconf);
|
||||
}
|
||||
if (ldd1 && ldd2 && ldd1.includes(MUSL)) {
|
||||
return versionSuffix(ldd2);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolves with the libc version when it can be determined, `null` otherwise.
|
||||
* @returns {Promise<?string>}
|
||||
*/
|
||||
const version = async () => {
|
||||
let version = null;
|
||||
if (isLinux()) {
|
||||
version = await versionFromFilesystem();
|
||||
if (!version) {
|
||||
version = versionFromReport();
|
||||
}
|
||||
if (!version) {
|
||||
const out = await safeCommand();
|
||||
version = versionFromCommand(out);
|
||||
}
|
||||
}
|
||||
return version;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the libc version when it can be determined, `null` otherwise.
|
||||
* @returns {?string}
|
||||
*/
|
||||
const versionSync = () => {
|
||||
let version = null;
|
||||
if (isLinux()) {
|
||||
version = versionFromFilesystemSync();
|
||||
if (!version) {
|
||||
version = versionFromReport();
|
||||
}
|
||||
if (!version) {
|
||||
const out = safeCommandSync();
|
||||
version = versionFromCommand(out);
|
||||
}
|
||||
}
|
||||
return version;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
GLIBC,
|
||||
MUSL,
|
||||
family,
|
||||
familySync,
|
||||
isNonGlibcLinux,
|
||||
isNonGlibcLinuxSync,
|
||||
version,
|
||||
versionSync
|
||||
};
|
||||
@@ -0,0 +1,115 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
#include <memory>
|
||||
#include <variant>
|
||||
#include <unordered_map>
|
||||
#include "CharData.h"
|
||||
|
||||
enum class FontStyle {
|
||||
Normal,
|
||||
Italic,
|
||||
Oblique
|
||||
};
|
||||
|
||||
enum class FontVariant {
|
||||
Normal,
|
||||
SmallCaps
|
||||
};
|
||||
|
||||
struct FontProperties {
|
||||
double fontSize{16.0f};
|
||||
std::vector<std::string> fontFamily;
|
||||
uint16_t fontWeight{400};
|
||||
FontVariant fontVariant{FontVariant::Normal};
|
||||
FontStyle fontStyle{FontStyle::Normal};
|
||||
};
|
||||
|
||||
class Token {
|
||||
public:
|
||||
enum class Type {
|
||||
Invalid,
|
||||
Number,
|
||||
Percent,
|
||||
Identifier,
|
||||
Slash,
|
||||
Comma,
|
||||
QuotedString,
|
||||
Whitespace,
|
||||
EndOfInput
|
||||
};
|
||||
|
||||
Token(Type type, std::string value);
|
||||
Token(Type type, double value);
|
||||
Token(Type type);
|
||||
|
||||
Type type() const { return type_; }
|
||||
|
||||
const std::string& getString() const;
|
||||
double getNumber() const;
|
||||
|
||||
private:
|
||||
Type type_;
|
||||
std::variant<std::string, double> value_;
|
||||
};
|
||||
|
||||
class Tokenizer {
|
||||
public:
|
||||
Tokenizer(std::string_view input);
|
||||
Token nextToken();
|
||||
|
||||
private:
|
||||
std::string_view input_;
|
||||
size_t position_{0};
|
||||
|
||||
// Util
|
||||
std::string utf8Encode(uint32_t codepoint);
|
||||
inline bool isWhitespace(char c) const {
|
||||
return charData[static_cast<uint8_t>(c)] & CharData::Whitespace;
|
||||
}
|
||||
inline bool isNewline(char c) const {
|
||||
return charData[static_cast<uint8_t>(c)] & CharData::Newline;
|
||||
}
|
||||
|
||||
// Moving through the string
|
||||
char peek() const;
|
||||
char advance();
|
||||
|
||||
// Tokenize
|
||||
Token parseNumber();
|
||||
Token parseIdentifier();
|
||||
uint32_t parseUnicode();
|
||||
bool parseEscape(std::string& str);
|
||||
Token parseString(char quote);
|
||||
};
|
||||
|
||||
class FontParser {
|
||||
public:
|
||||
static FontProperties parse(const std::string& fontString, bool* success = nullptr);
|
||||
|
||||
private:
|
||||
static const std::unordered_map<std::string, uint16_t> weightMap;
|
||||
static const std::unordered_map<std::string, double> unitMap;
|
||||
|
||||
FontParser(std::string_view input);
|
||||
|
||||
void advance();
|
||||
void skipWs();
|
||||
bool check(Token::Type type) const;
|
||||
bool checkWs() const;
|
||||
|
||||
bool parseFontStyle(FontProperties& props);
|
||||
bool parseFontVariant(FontProperties& props);
|
||||
bool parseFontWeight(FontProperties& props);
|
||||
bool parseFontSize(FontProperties& props);
|
||||
bool parseLineHeight(FontProperties& props);
|
||||
bool parseFontFamily(FontProperties& props);
|
||||
FontProperties parseFont();
|
||||
|
||||
Tokenizer tokenizer_;
|
||||
Token currentToken_;
|
||||
Token nextToken_;
|
||||
bool hasError_{false};
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"F A B mC","8":"K D E"},B:{"2":"C L M G N O P","8":"Q H R S T U V W X Y Z a b c d e f","584":"g h i j k l m n o p q r","1025":"0 9 s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","129":"nC LC qC rC"},D:{"1":"5","8":"1 2 3 4 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f","584":"g h i j k l m n o p q r","1025":"0 9 s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"1":"A B C L M G TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","260":"J PB K D E F sC SC tC uC vC wC"},F:{"2":"F","8":"1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC","584":"S T U V W X Y Z a b c d","1025":"0 e f g h i j k l m n o p q r s t u v w x y z","2052":"B C 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"E AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","8":"SC 9C lC"},H:{"8":"WD"},I:{"8":"LC J XD YD ZD aD lC bD cD","1025":"I"},J:{"1":"A","8":"D"},K:{"8":"A B C FC kC GC","1025":"H"},L:{"1025":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"8":"HC"},P:{"1":"2 3 4 5 6 7 8","8":"1 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"8":"oD"},R:{"8":"pD"},S:{"1":"qD rD"}},B:2,C:"MathML",D:true};
|
||||
@@ -0,0 +1,4 @@
|
||||
import { Constrain } from './utils.cjs';
|
||||
export interface OptionalStructuralSharing<TStructuralSharing, TConstraint> {
|
||||
readonly structuralSharing?: Constrain<TStructuralSharing, TConstraint> | undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user