Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/src/external/nacl-fast.js (polyfill for TypedArray), Will affect other packages, is there any solution? #77

Open
EvanXzj opened this issue Mar 25, 2022 · 2 comments

Comments

@EvanXzj
Copy link

EvanXzj commented Mar 25, 2022

No description provided.

@wmvm0
Copy link

wmvm0 commented Jul 7, 2022

I have the same problem.

@wmvm0
Copy link

wmvm0 commented Jul 7, 2022

I tried it, as long as the following code is commented out, it can work normally.

This is new package after commenting out the code

npm i @wmvm__/nem-library 

can you tell me why the following code is added?

// polyfill for TypedArray.prototype.slice()
//     Uint8Array.prototype.slice = function(start, end) {
//         var len = this.length;
//         var relativeStart = start;
//         var k = (relativeStart < 0) ? max(len + relativeStart, 0) : Math.min(relativeStart, len);
//         var relativeEnd = (end === undefined) ? len : end;
//         var final = (relativeEnd < 0) ? max(len + relativeEnd, 0) : Math.min(relativeEnd, len);
//         var count = final - k;
//         var c = this.constructor;
//         var a = new c(count);
//         var n = 0;
//         while (k < final) {
//             a[n] = JSON.parse(JSON.stringify(this[k]));
//             k++;
//             n++;
//         }
//         return a;
//     }
//
//
//     Float64Array.prototype.slice = function(start, end) {
//         var len = this.length;
//         var relativeStart = start;
//         var k = (relativeStart < 0) ? max(len + relativeStart, 0) : Math.min(relativeStart, len);
//         var relativeEnd = (end === undefined) ? len : end;
//         var final = (relativeEnd < 0) ? max(len + relativeEnd, 0) : Math.min(relativeEnd, len);
//         var count = final - k;
//         var c = this.constructor;
//         var a = new c(count);
//         var n = 0;
//         while (k < final) {
//             a[n] = JSON.parse(JSON.stringify(this[k]));
//             k++;
//             n++;
//         }
//         return a;
//     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants