Deployed the page to Github Pages.

This commit is contained in:
Batuhan Berk Başoğlu 2024-11-03 21:30:09 -05:00
parent 1d79754e93
commit 2c89899458
Signed by: batuhan-basoglu
SSH key fingerprint: SHA256:kEsnuHX+qbwhxSAXPUQ4ox535wFHu/hIRaa53FzxRpo
62797 changed files with 6551425 additions and 15279 deletions

View file

@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FEATURES = void 0;
exports.enableFeature = enableFeature;
exports.featuresKey = void 0;
exports.hasFeature = hasFeature;
exports.runtimeKey = void 0;
const FEATURES = exports.FEATURES = Object.freeze({
unicodeFlag: 1 << 0,
dotAllFlag: 1 << 1,
unicodePropertyEscape: 1 << 2,
namedCaptureGroups: 1 << 3,
unicodeSetsFlag_syntax: 1 << 4,
unicodeSetsFlag: 1 << 5,
duplicateNamedCaptureGroups: 1 << 6,
modifiers: 1 << 7
});
const featuresKey = exports.featuresKey = "@babel/plugin-regexp-features/featuresKey";
const runtimeKey = exports.runtimeKey = "@babel/plugin-regexp-features/runtimeKey";
function enableFeature(features, feature) {
return features | feature;
}
function hasFeature(features, feature) {
return !!(features & feature);
}
//# sourceMappingURL=features.js.map

View file

@ -0,0 +1 @@
{"version":3,"names":["FEATURES","exports","Object","freeze","unicodeFlag","dotAllFlag","unicodePropertyEscape","namedCaptureGroups","unicodeSetsFlag_syntax","unicodeSetsFlag","duplicateNamedCaptureGroups","modifiers","featuresKey","runtimeKey","enableFeature","features","feature","hasFeature"],"sources":["../src/features.ts"],"sourcesContent":["export const FEATURES = Object.freeze({\n unicodeFlag: 1 << 0,\n dotAllFlag: 1 << 1,\n unicodePropertyEscape: 1 << 2,\n namedCaptureGroups: 1 << 3,\n // Not used, for backward compatibility with syntax-unicode-sets-regex\n unicodeSetsFlag_syntax: 1 << 4,\n unicodeSetsFlag: 1 << 5,\n duplicateNamedCaptureGroups: 1 << 6,\n modifiers: 1 << 7,\n});\n\n// We can't use a symbol because this needs to always be the same, even if\n// this package isn't deduped by npm. e.g.\n// - node_modules/\n// - @babel/plugin-regexp-features\n// - @babel/plugin-transform-unicode-property-regex\n// - node_modules\n// - @babel-plugin-regexp-features\nexport const featuresKey = \"@babel/plugin-regexp-features/featuresKey\";\nexport const runtimeKey = \"@babel/plugin-regexp-features/runtimeKey\";\n\ntype FeatureType = (typeof FEATURES)[keyof typeof FEATURES];\n\nexport function enableFeature(features: number, feature: FeatureType): number {\n return features | feature;\n}\n\nexport function hasFeature(features: number, feature: FeatureType) {\n return !!(features & feature);\n}\n"],"mappings":";;;;;;;;;;AAAO,MAAMA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,MAAM,CAACC,MAAM,CAAC;EACpCC,WAAW,EAAE,CAAC,IAAI,CAAC;EACnBC,UAAU,EAAE,CAAC,IAAI,CAAC;EAClBC,qBAAqB,EAAE,CAAC,IAAI,CAAC;EAC7BC,kBAAkB,EAAE,CAAC,IAAI,CAAC;EAE1BC,sBAAsB,EAAE,CAAC,IAAI,CAAC;EAC9BC,eAAe,EAAE,CAAC,IAAI,CAAC;EACvBC,2BAA2B,EAAE,CAAC,IAAI,CAAC;EACnCC,SAAS,EAAE,CAAC,IAAI;AAClB,CAAC,CAAC;AASK,MAAMC,WAAW,GAAAX,OAAA,CAAAW,WAAA,GAAG,2CAA2C;AAC/D,MAAMC,UAAU,GAAAZ,OAAA,CAAAY,UAAA,GAAG,0CAA0C;AAI7D,SAASC,aAAaA,CAACC,QAAgB,EAAEC,OAAoB,EAAU;EAC5E,OAAOD,QAAQ,GAAGC,OAAO;AAC3B;AAEO,SAASC,UAAUA,CAACF,QAAgB,EAAEC,OAAoB,EAAE;EACjE,OAAO,CAAC,EAAED,QAAQ,GAAGC,OAAO,CAAC;AAC/B","ignoreList":[]}

View file

@ -0,0 +1,116 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createRegExpFeaturePlugin = createRegExpFeaturePlugin;
var _regexpuCore = require("regexpu-core");
var _core = require("@babel/core");
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
var _semver = require("semver");
var _features = require("./features.js");
var _util = require("./util.js");
const versionKey = "@babel/plugin-regexp-features/version";
function createRegExpFeaturePlugin({
name,
feature,
options = {},
manipulateOptions = () => {}
}) {
return {
name,
manipulateOptions,
pre() {
var _file$get;
const {
file
} = this;
const features = (_file$get = file.get(_features.featuresKey)) != null ? _file$get : 0;
let newFeatures = (0, _features.enableFeature)(features, _features.FEATURES[feature]);
const {
useUnicodeFlag,
runtime
} = options;
if (useUnicodeFlag === false) {
newFeatures = (0, _features.enableFeature)(newFeatures, _features.FEATURES.unicodeFlag);
}
if (newFeatures !== features) {
file.set(_features.featuresKey, newFeatures);
}
if (runtime !== undefined) {
if (file.has(_features.runtimeKey) && file.get(_features.runtimeKey) !== runtime && (0, _features.hasFeature)(newFeatures, _features.FEATURES.duplicateNamedCaptureGroups)) {
throw new Error(`The 'runtime' option must be the same for ` + `'@babel/plugin-transform-named-capturing-groups-regex' and ` + `'@babel/plugin-transform-duplicate-named-capturing-groups-regex'.`);
}
if (feature === "namedCaptureGroups") {
if (!runtime || !file.has(_features.runtimeKey)) file.set(_features.runtimeKey, runtime);
} else {
file.set(_features.runtimeKey, runtime);
}
}
{
if (typeof file.get(versionKey) === "number") {
file.set(versionKey, "7.25.9");
return;
}
}
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.25.9")) {
file.set(versionKey, "7.25.9");
}
},
visitor: {
RegExpLiteral(path) {
var _file$get2, _newFlags;
const {
node
} = path;
const {
file
} = this;
const features = file.get(_features.featuresKey);
const runtime = (_file$get2 = file.get(_features.runtimeKey)) != null ? _file$get2 : true;
const regexpuOptions = (0, _util.generateRegexpuOptions)(node.pattern, features);
if ((0, _util.canSkipRegexpu)(node, regexpuOptions)) {
return;
}
const namedCaptureGroups = {
__proto__: null
};
if (regexpuOptions.namedGroups === "transform") {
regexpuOptions.onNamedGroup = (name, index) => {
const prev = namedCaptureGroups[name];
if (typeof prev === "number") {
namedCaptureGroups[name] = [prev, index];
} else if (Array.isArray(prev)) {
prev.push(index);
} else {
namedCaptureGroups[name] = index;
}
};
}
let newFlags;
if (regexpuOptions.modifiers === "transform") {
regexpuOptions.onNewFlags = flags => {
newFlags = flags;
};
}
node.pattern = _regexpuCore(node.pattern, node.flags, regexpuOptions);
if (regexpuOptions.namedGroups === "transform" && Object.keys(namedCaptureGroups).length > 0 && runtime && !isRegExpTest(path)) {
const call = _core.types.callExpression(this.addHelper("wrapRegExp"), [node, _core.types.valueToNode(namedCaptureGroups)]);
(0, _helperAnnotateAsPure.default)(call);
path.replaceWith(call);
}
node.flags = (0, _util.transformFlags)(regexpuOptions, (_newFlags = newFlags) != null ? _newFlags : node.flags);
}
}
};
}
function isRegExpTest(path) {
return path.parentPath.isMemberExpression({
object: path.node,
computed: false
}) && path.parentPath.get("property").isIdentifier({
name: "test"
});
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,71 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.canSkipRegexpu = canSkipRegexpu;
exports.generateRegexpuOptions = generateRegexpuOptions;
exports.transformFlags = transformFlags;
var _features = require("./features.js");
function generateRegexpuOptions(pattern, toTransform) {
const feat = name => {
return (0, _features.hasFeature)(toTransform, _features.FEATURES[name]) ? "transform" : false;
};
const featDuplicateNamedGroups = () => {
if (!feat("duplicateNamedCaptureGroups")) return false;
const regex = /\(\?<([^>]+)>/g;
const seen = new Set();
for (let match; match = regex.exec(pattern); seen.add(match[1])) {
if (seen.has(match[1])) return "transform";
}
return false;
};
return {
unicodeFlag: feat("unicodeFlag"),
unicodeSetsFlag: feat("unicodeSetsFlag"),
dotAllFlag: feat("dotAllFlag"),
unicodePropertyEscapes: feat("unicodePropertyEscape"),
namedGroups: feat("namedCaptureGroups") || featDuplicateNamedGroups(),
onNamedGroup: () => {},
modifiers: feat("modifiers")
};
}
function canSkipRegexpu(node, options) {
const {
flags,
pattern
} = node;
if (flags.includes("v")) {
if (options.unicodeSetsFlag === "transform") return false;
}
if (flags.includes("u")) {
if (options.unicodeFlag === "transform") return false;
if (options.unicodePropertyEscapes === "transform" && /\\p\{/i.test(pattern)) {
return false;
}
}
if (flags.includes("s")) {
if (options.dotAllFlag === "transform") return false;
}
if (options.namedGroups === "transform" && /\(\?<(?![=!])/.test(pattern)) {
return false;
}
if (options.modifiers === "transform" && /\(\?[\w-]+:/.test(pattern)) {
return false;
}
return true;
}
function transformFlags(regexpuOptions, flags) {
if (regexpuOptions.unicodeSetsFlag === "transform") {
flags = flags.replace("v", "u");
}
if (regexpuOptions.unicodeFlag === "transform") {
flags = flags.replace("u", "");
}
if (regexpuOptions.dotAllFlag === "transform") {
flags = flags.replace("s", "");
}
return flags;
}
//# sourceMappingURL=util.js.map

File diff suppressed because one or more lines are too long