1
0
mirror of https://github.com/actions/labeler synced 2026-05-11 22:31:10 +02:00
This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

View File

@@ -9,29 +9,11 @@ exports.merge = merge;
var virtualTypes = _interopRequireWildcard(require("./path/lib/virtual-types"));
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _clone() {
const data = _interopRequireDefault(require("lodash/clone"));
_clone = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function explode(visitor) {
if (visitor._exploded) return visitor;
@@ -82,8 +64,8 @@ function explode(visitor) {
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
const fns = visitor[nodeType];
let aliases = t().FLIPPED_ALIAS_KEYS[nodeType];
const deprecratedKey = t().DEPRECATED_KEYS[nodeType];
let aliases = t.FLIPPED_ALIAS_KEYS[nodeType];
const deprecratedKey = t.DEPRECATED_KEYS[nodeType];
if (deprecratedKey) {
console.trace(`Visitor defined for ${nodeType} but it has been renamed to ${deprecratedKey}`);
@@ -99,7 +81,7 @@ function explode(visitor) {
if (existing) {
mergePair(existing, fns);
} else {
visitor[alias] = (0, _clone().default)(fns);
visitor[alias] = Object.assign({}, fns);
}
}
}
@@ -126,7 +108,7 @@ function verify(visitor) {
if (shouldIgnoreKey(nodeType)) continue;
if (t().TYPES.indexOf(nodeType) < 0) {
if (t.TYPES.indexOf(nodeType) < 0) {
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type`);
}
@@ -198,6 +180,10 @@ function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
newFn = wrapper(state.key, key, newFn);
}
if (newFn !== fn) {
newFn.toString = () => fn.toString();
}
return newFn;
});
newVisitor[key] = fns;
@@ -240,7 +226,7 @@ function shouldIgnoreKey(key) {
if (key[0] === "_") return true;
if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
if (key === "blacklist" || key === "noScope" || key === "skipKeys") {
if (key === "denylist" || key === "noScope" || key === "skipKeys" || key === "blacklist") {
return true;
}