mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-08-31 14:39:48 +08:00
feat: updates & github event support
This commit is contained in:
+5
-4
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable no-param-reassign*/
|
||||
/* eslint no-param-reassign: 0 -- stylistic choice */
|
||||
|
||||
import TokenTranslator from "./token-translator.js";
|
||||
import { normalizeOptions } from "./options.js";
|
||||
|
||||
@@ -109,7 +110,7 @@ export default () => Parser => {
|
||||
allowReturnOutsideFunction: options.allowReturnOutsideFunction,
|
||||
|
||||
// Collect tokens
|
||||
onToken: token => {
|
||||
onToken(token) {
|
||||
if (tokenTranslator) {
|
||||
|
||||
// Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
|
||||
@@ -121,7 +122,7 @@ export default () => Parser => {
|
||||
},
|
||||
|
||||
// Collect comments
|
||||
onComment: (block, text, start, end, startLoc, endLoc) => {
|
||||
onComment(block, text, start, end, startLoc, endLoc) {
|
||||
if (state.comments) {
|
||||
const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code);
|
||||
|
||||
@@ -314,7 +315,7 @@ export default () => Parser => {
|
||||
* on extra so that when tokens are converted, the next token will be switched
|
||||
* to JSXText via onToken.
|
||||
*/
|
||||
jsx_readString(quote) { // eslint-disable-line camelcase
|
||||
jsx_readString(quote) { // eslint-disable-line camelcase -- required by API
|
||||
const result = super.jsx_readString(quote);
|
||||
|
||||
if (this.type === tokTypes.string) {
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ const SUPPORTED_VERSIONS = [
|
||||
11, // 2020
|
||||
12, // 2021
|
||||
13, // 2022
|
||||
14 // 2023
|
||||
14, // 2023
|
||||
15 // 2024
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
+5
-7
@@ -2,7 +2,6 @@
|
||||
* @fileoverview Translates tokens between Acorn format and Esprima format.
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
/* eslint no-underscore-dangle: 0 */
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
@@ -180,8 +179,7 @@ TokenTranslator.prototype = {
|
||||
*/
|
||||
onToken(token, extra) {
|
||||
|
||||
const that = this,
|
||||
tt = this._acornTokTypes,
|
||||
const tt = this._acornTokTypes,
|
||||
tokens = extra.tokens,
|
||||
templateTokens = this._tokens;
|
||||
|
||||
@@ -191,10 +189,10 @@ TokenTranslator.prototype = {
|
||||
* @returns {void}
|
||||
* @private
|
||||
*/
|
||||
function translateTemplateTokens() {
|
||||
tokens.push(convertTemplatePart(that._tokens, that._code));
|
||||
that._tokens = [];
|
||||
}
|
||||
const translateTemplateTokens = () => {
|
||||
tokens.push(convertTemplatePart(this._tokens, this._code));
|
||||
this._tokens = [];
|
||||
};
|
||||
|
||||
if (token.type === tt.eof) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user