Skip to content

Commit 6959dff

Browse files
committed
feat: 支持 Stash JQ
1 parent c569008 commit 6959dff

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Rewrite-Parser.beta.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
559559

560560
if (/\s((request|response)-body-json-jq)\s/.test(_x)) {
561561
let [_, regex, type, value] = _x.match(/^(.*?)\s+?(?:(request|response)-body-json-jq)\s+?(.*?)\s*$/)
562-
if (jqEnabled && isSurgeiOS) {
562+
if (jqEnabled && (isSurgeiOS || isStashiOS)) {
563563
const jqPath = value.match(/jq-path="(.+?)"/)?.[1]
564564
if (jqPath) {
565565
if (/^https?:\/\//.test(jqPath)) {
@@ -610,7 +610,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
610610
const jsptn = regex
611611
let args = [[action, newSuffixArray]]
612612

613-
if (jqEnabled && isSurgeiOS) {
613+
if (jqEnabled && (isSurgeiOS || isStashiOS)) {
614614
if (action === 'json-add') {
615615
newSuffixArray.forEach(item => {
616616
const paths = parseJsonPath(item[0])

Rewrite-Parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
559559

560560
if (/\s((request|response)-body-json-jq)\s/.test(_x)) {
561561
let [_, regex, type, value] = _x.match(/^(.*?)\s+?(?:(request|response)-body-json-jq)\s+?(.*?)\s*$/)
562-
if (jqEnabled && isSurgeiOS) {
562+
if (jqEnabled && (isSurgeiOS || isStashiOS)) {
563563
const jqPath = value.match(/jq-path="(.+?)"/)?.[1]
564564
if (jqPath) {
565565
if (/^https?:\/\//.test(jqPath)) {
@@ -610,7 +610,7 @@ if (binaryInfo != null && binaryInfo.length > 0) {
610610
const jsptn = regex
611611
let args = [[action, newSuffixArray]]
612612

613-
if (jqEnabled && isSurgeiOS) {
613+
if (jqEnabled && (isSurgeiOS || isStashiOS)) {
614614
if (action === 'json-add') {
615615
newSuffixArray.forEach(item => {
616616
const paths = parseJsonPath(item[0])

0 commit comments

Comments
 (0)