ajax-hooker 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,9 +3,8 @@
3
3
  English | [中文](./README.zh-CN.md)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/ajax-hooker.svg)](https://www.npmjs.com/package/ajax-hooker)
6
- [![npm downloads](https://img.shields.io/npm/dm/ajax-hooker.svg)](https://www.npmjs.com/package/ajax-hooker)
6
+ [![npm downloads](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.npmjs.org%2Fdownloads%2Fpoint%2Flast-day%2Fajax-hooker&query=%24.downloads&label=downloads&suffix=%2Fday&color=green)](https://www.npmjs.com/package/ajax-hooker)
7
7
  [![CI](https://img.shields.io/github/actions/workflow/status/Arktomson/ajaxInterceptor/ci.yml?branch=master&label=ci)](https://github.com/Arktomson/ajaxInterceptor/actions/workflows/ci.yml)
8
- [![bundle size](https://img.shields.io/bundlephobia/minzip/ajax-hooker)](https://bundlephobia.com/package/ajax-hooker)
9
8
 
10
9
  `ajax-hooker` is a browser-side AJAX interception library (XMLHttpRequest interceptor + Fetch interceptor). It deeply hooks native `XMLHttpRequest` and `fetch`, then normalizes both into one hook lifecycle so interception logic can be written once and reused across request types.
11
10
 
package/README.zh-CN.md CHANGED
@@ -5,7 +5,6 @@
5
5
  [![npm version](https://img.shields.io/npm/v/ajax-hooker.svg)](https://www.npmjs.com/package/ajax-hooker)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/ajax-hooker.svg)](https://www.npmjs.com/package/ajax-hooker)
7
7
  [![CI](https://img.shields.io/github/actions/workflow/status/Arktomson/ajaxInterceptor/ci.yml?branch=master&label=ci)](https://github.com/Arktomson/ajaxInterceptor/actions/workflows/ci.yml)
8
- [![bundle size](https://img.shields.io/bundlephobia/minzip/ajax-hooker)](https://bundlephobia.com/package/ajax-hooker)
9
8
 
10
9
  `ajax-hooker` 是一个浏览器端 AJAX 拦截库(XMLHttpRequest 拦截 + Fetch 拦截)。它会对原生 `XMLHttpRequest` 和 `fetch` 做深度劫持,并把两者抹平为统一的 Hook 生命周期,让拦截逻辑写一次即可复用。
11
10
 
package/dist/cjs/index.js CHANGED
@@ -624,6 +624,10 @@ class AjaxInterceptor {
624
624
  }
625
625
  }
626
626
 
627
+ exports.AJAX_TYPE = AJAX_TYPE;
628
+
627
629
  exports.AjaxInterceptor = AjaxInterceptor;
628
630
 
631
+ exports.CYCLE_SCHEDULER = CYCLE_SCHEDULER;
632
+
629
633
  exports.default = AjaxInterceptor;
package/dist/esm/index.js CHANGED
@@ -618,4 +618,4 @@ class AjaxInterceptor {
618
618
  }
619
619
  }
620
620
 
621
- export { AjaxInterceptor, AjaxInterceptor as default };
621
+ export { AJAX_TYPE, AjaxInterceptor, CYCLE_SCHEDULER, AjaxInterceptor as default };
@@ -607,7 +607,9 @@ var AjaxHooker = function(exports) {
607
607
  }
608
608
  }
609
609
  }
610
+ exports.AJAX_TYPE = AJAX_TYPE;
610
611
  exports.AjaxInterceptor = AjaxInterceptor;
612
+ exports.CYCLE_SCHEDULER = CYCLE_SCHEDULER;
611
613
  exports.default = AjaxInterceptor;
612
614
  Object.defineProperty(exports, "__esModule", {
613
615
  value: true
@@ -1,3 +1,4 @@
1
1
  export { default } from './interceptor';
2
2
  export * from './interceptor';
3
3
  export * from './type';
4
+ export * from './constant';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ajax-hooker",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "Browser AJAX interceptor for XMLHttpRequest and fetch with unified hooks, request/response mutation, and streaming response support.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",