Fixed ESLint issues

This commit is contained in:
Peng-YM
2022-05-24 22:24:27 +08:00
parent 3b70cc0bd8
commit b56f17606e
10 changed files with 42 additions and 36 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
import { ENV } from './open-api';
import $ from '../core/app';
@@ -238,7 +239,7 @@ export default function express({ port } = { port: 3000 }) {
function extractURL(url) {
// extract path
const match = url.match(/https?:\/\/[^\/]+(\/[^?]*)/) || [];
const match = url.match(/https?:\/\/[^/]+(\/[^?]*)/) || [];
const path = match[1] || '/';
// extract query string

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
export function ENV() {
const isQX = typeof $task !== 'undefined';
const isLoon = typeof $loon !== 'undefined';
@@ -18,7 +19,7 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
'PATCH',
];
const URL_REGEX =
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/;
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
function send(method, options) {
options = typeof options === 'string' ? { url: options } : options;