Skip to content

Commit

Permalink
remove data shortening
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Aug 24, 2023
1 parent 4f3c4a3 commit 29dd5da
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 63 deletions.
2 changes: 1 addition & 1 deletion docs/html/curve.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 16:55:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 17:27:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
4 changes: 2 additions & 2 deletions docs/html/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -5622,7 +5622,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line1008">line 1008</a>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line1007">line 1007</a>
</li></ul></dd>


Expand Down Expand Up @@ -6606,7 +6606,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 16:55:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 17:27:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 16:55:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 17:27:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 16:55:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 17:27:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/query.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 16:55:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 17:27:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/router.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 16:55:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 17:27:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
56 changes: 28 additions & 28 deletions docs/html/utils.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ <h1 class="page-title">Source: utils.js</h1>
* @param {...any} data - The optinnal data to hide
*/
const appGlobalLogger = (scurb, ...data) => {
const largeDataPattern = /0x[a-fA-F0-9]{128,}/g;
// const largeDataPattern = /0x[a-fA-F0-9]{128,}/g;
const consoleMethods = ["log", "warn", "error", "info", "debug"];

// Stringifies an object
Expand Down Expand Up @@ -978,43 +978,42 @@ <h1 class="page-title">Source: utils.js</h1>
) logItem = logItem.toString();

if (typeof logItem === "string") {
for (let j = 0; j &lt; _data.length; j++) {
if (scrub) for (let j = 0; j &lt; _data.length; j++) {
// while (logItem.includes(_data[i]))
logItem = logItem.replaceAll(
_data[i],
"**********"
);
}
let _skipFirst = true;
logItem = logItem.replace(
largeDataPattern,
largeData => {
if (_skipFirst) {
_skipFirst = false;
return largeData;
}
else return largeData.slice(0, 67) + "...";
}
);
// let _skipFirst = true;
// logItem = logItem.replace(
// largeDataPattern,
// largeData => {
// if (_skipFirst) {
// _skipFirst = false;
// return largeData;
// }
// else return largeData.slice(0, 67) + "...";
// }
// );
}
else if (typeof logItem === "object" &amp;&amp; logItem !== null) {
logItem = objStringify(logItem);
if (scurb) for (let j = 0; j &lt; _data.length; j++) {
logItem = objStrReplacer(logItem, _data[j], "**********");
}
let _skipFirst = true;
logItem = objStrReplacer(
logItem,
largeDataPattern,
largeData => {
if (_skipFirst) {
_skipFirst = false;
return largeData;
}
else return largeData.slice(0, 67) + "...";
},
true
);
// let _skipFirst = true;
// logItem = objStrReplacer(
// logItem,
// largeDataPattern,
// largeData => {
// if (_skipFirst) {
// _skipFirst = false;
// return largeData;
// }
// else return largeData.slice(0, 67) + "...";
// }
// );
}
modifiedParams.push(logItem);
}
Expand Down Expand Up @@ -1066,7 +1065,8 @@ <h1 class="page-title">Source: utils.js</h1>
getOrderDetailsFromJson,
appGlobalLogger,
promiseTimeout
};</code></pre>
};
</code></pre>
</article>
</section>

Expand All @@ -1082,7 +1082,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 16:55:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 17:27:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/zeroex.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 16:55:43 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Aug 24 2023 17:27:16 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
53 changes: 26 additions & 27 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ const getOrderDetailsFromJson = async(jsonContent, signer) => {
* @param {...any} data - The optinnal data to hide
*/
const appGlobalLogger = (scurb, ...data) => {
const largeDataPattern = /0x[a-fA-F0-9]{128,}/g;
// const largeDataPattern = /0x[a-fA-F0-9]{128,}/g;
const consoleMethods = ["log", "warn", "error", "info", "debug"];

// Stringifies an object
Expand Down Expand Up @@ -950,43 +950,42 @@ const appGlobalLogger = (scurb, ...data) => {
) logItem = logItem.toString();

if (typeof logItem === "string") {
for (let j = 0; j < _data.length; j++) {
if (scrub) for (let j = 0; j < _data.length; j++) {
// while (logItem.includes(_data[i]))
logItem = logItem.replaceAll(
_data[i],
"**********"
);
}
let _skipFirst = true;
logItem = logItem.replace(
largeDataPattern,
largeData => {
if (_skipFirst) {
_skipFirst = false;
return largeData;
}
else return largeData.slice(0, 67) + "...";
}
);
// let _skipFirst = true;
// logItem = logItem.replace(
// largeDataPattern,
// largeData => {
// if (_skipFirst) {
// _skipFirst = false;
// return largeData;
// }
// else return largeData.slice(0, 67) + "...";
// }
// );
}
else if (typeof logItem === "object" && logItem !== null) {
logItem = objStringify(logItem);
if (scurb) for (let j = 0; j < _data.length; j++) {
logItem = objStrReplacer(logItem, _data[j], "**********");
}
let _skipFirst = true;
logItem = objStrReplacer(
logItem,
largeDataPattern,
largeData => {
if (_skipFirst) {
_skipFirst = false;
return largeData;
}
else return largeData.slice(0, 67) + "...";
},
true
);
// let _skipFirst = true;
// logItem = objStrReplacer(
// logItem,
// largeDataPattern,
// largeData => {
// if (_skipFirst) {
// _skipFirst = false;
// return largeData;
// }
// else return largeData.slice(0, 67) + "...";
// }
// );
}
modifiedParams.push(logItem);
}
Expand Down Expand Up @@ -1038,4 +1037,4 @@ module.exports = {
getOrderDetailsFromJson,
appGlobalLogger,
promiseTimeout
};
};

0 comments on commit 29dd5da

Please sign in to comment.