react-native-in-app-debugger 1.0.20 → 1.0.22

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/Api.jsx CHANGED
@@ -157,7 +157,7 @@ export default (props) => {
157
157
  </View>
158
158
  {!filter &&
159
159
  !!props.maxNumOfApiToStore &&
160
- apis.length === props.maxNumOfApiToStore && (
160
+ apis.length >= props.maxNumOfApiToStore && (
161
161
  <Text style={{ color: "#ffffff88", padding: 10 }}>
162
162
  Capped to only latest {props.maxNumOfApiToStore} APIs
163
163
  </Text>
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ declare module 'react-native-in-app-debugger';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-in-app-debugger",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "",
5
5
  "main": "index.jsx",
6
6
  "scripts": {
@@ -18,6 +18,7 @@ const parse = (data) => {
18
18
  };
19
19
 
20
20
  export default (maxNumOfApiToStore) => {
21
+ console.log("xxxxx maxNumOfApiToStore", maxNumOfApiToStore);
21
22
  const [apis, setApis] = useState([]);
22
23
 
23
24
  const makeRequest = (data) => {
@@ -40,9 +41,8 @@ export default (maxNumOfApiToStore) => {
40
41
  setApis((v) => {
41
42
  const newData = [
42
43
  { request, id: Date.now().toString(36) + Math.random().toString(36) },
43
- ...v,
44
+ ...(maxNumOfApiToStore ? v.slice(0, maxNumOfApiToStore - 1) : v),
44
45
  ];
45
- if (maxNumOfApiToStore) newData.slice(0, maxNumOfApiToStore);
46
46
  return newData;
47
47
  });
48
48
  };