From 9979c1c695b2a0b951fb1da8d435132fe69cec5d Mon Sep 17 00:00:00 2001 From: Rafael Rocha Date: Sun, 5 Jan 2020 02:18:31 -0300 Subject: [PATCH] Use AMD externs to keep compatibility with AMD --- dist/wavefile.js | 2 +- externs/amd.js | 2 ++ rollup.config.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 externs/amd.js diff --git a/dist/wavefile.js b/dist/wavefile.js index 7ef1660..a44e1e8 100644 --- a/dist/wavefile.js +++ b/dist/wavefile.js @@ -72,4 +72,4 @@ this.data.samples.length/(this.f.h/8),f=new Float64Array(e);e=new Float64Array(e 0;p>2],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(a[c]& 3)<<4|a[c+1]>>4],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(a[c+1]&15)<<2|a[c+2]>>6],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[a[c+2]&63];2===a.length%3?b=b.substring(0,b.length-1)+"=":1===a.length%3&&(b=b.substring(0,b.length-2)+"==");return b};m.prototype.toDataURI=function(){return"data:audio/wav;base64,"+this.toBase64()};m.prototype.fromDataURI=function(a){this.fromBase64(a.replace("data:audio/wav;base64,",""))};r.WaveFile=m;Object.defineProperty(r, -"__esModule",{value:!0})}"object"===typeof exports&&"undefined"!==typeof module?Z(exports):"function"===typeof define&&define.Sa?define(["exports"],Z):(Y=Y||self,Z(Y.wavefile={})); +"__esModule",{value:!0})}"object"===typeof exports&&"undefined"!==typeof module?Z(exports):"function"===typeof define&&define.amd?define(["exports"],Z):(Y=Y||self,Z(Y.wavefile={})); diff --git a/externs/amd.js b/externs/amd.js new file mode 100644 index 0000000..1526803 --- /dev/null +++ b/externs/amd.js @@ -0,0 +1,2 @@ +// To keep AMD compatibility +var amd = {}; diff --git a/rollup.config.js b/rollup.config.js index 8eddb48..9a7e36b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -54,7 +54,7 @@ export default [ compilation_level: 'ADVANCED', warning_level: 'VERBOSE', outputWrapper: polyfills + '%output%', - externs: ['externs/wavefile.js'] + externs: ['externs/wavefile.js','externs/amd.js',] }), compiler({ language_in: 'ECMASCRIPT3',