Skip to content

Commit

Permalink
Move var declarations to top of files
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Jun 25, 2018
1 parent bb01c85 commit 0284a0d
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 105 deletions.
28 changes: 14 additions & 14 deletions dist/alawmulaw.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ __webpack_require__.d(mulaw_namespaceObject, "decode", function() { return mulaw

/** @module alawmulaw/alaw */

/** @type {!Array<number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

/**
* Encode a 16-bit linear PCM sample as 8-bit A-Law.
* @param {number} sample A 16-bit linear PCM sample
Expand Down Expand Up @@ -226,14 +234,6 @@ function decode(samples) {
return pcmSamples;
}

/** @type {!Array<number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

// CONCATENATED MODULE: ./lib/mulaw.js
/*
* alawmulaw: A-Law and mu-Law codecs in JavaScript.
Expand Down Expand Up @@ -270,6 +270,12 @@ const LOG_TABLE = [

/** @module alawmulaw/mulaw */

/**
* @type {number}
* @private
*/
const BIAS = 0x84;

/**
* Encode a 16-bit linear PCM sample as 8-bit mu-Law.
* @param {number} pcmSample A 16-bit sample
Expand Down Expand Up @@ -359,12 +365,6 @@ function segmentValue_(sample) {
return segment;
}


/**
* @type {number}
* @private
*/
const BIAS = 0x84;
// CONCATENATED MODULE: ./index.js
/*
* alawmulaw: A-Law and mu-Law codecs in JavaScript.
Expand Down
29 changes: 14 additions & 15 deletions dist/alawmulaw.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@

/** @module alawmulaw/alaw */

/** @type {!Array<number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

/**
* Encode a 16-bit linear PCM sample as 8-bit A-Law.
* @param {number} sample A 16-bit linear PCM sample
Expand Down Expand Up @@ -121,14 +129,6 @@ function decode(samples) {
return pcmSamples;
}

/** @type {!Array<number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

var alaw = /*#__PURE__*/Object.freeze({
encodeSample: encodeSample,
decodeSample: decodeSample,
Expand Down Expand Up @@ -171,6 +171,12 @@ var alaw = /*#__PURE__*/Object.freeze({

/** @module alawmulaw/mulaw */

/**
* @type {number}
* @private
*/
const BIAS = 0x84;

/**
* Encode a 16-bit linear PCM sample as 8-bit mu-Law.
* @param {number} pcmSample A 16-bit sample
Expand Down Expand Up @@ -260,13 +266,6 @@ function segmentValue_(sample) {
return segment;
}


/**
* @type {number}
* @private
*/
const BIAS = 0x84;

var mulaw = /*#__PURE__*/Object.freeze({
encodeSample: encodeSample$1,
decodeSample: decodeSample$1,
Expand Down
29 changes: 14 additions & 15 deletions dist/alawmulaw.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@

/** @module alawmulaw/alaw */

/** @type {!Array<number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

/**
* Encode a 16-bit linear PCM sample as 8-bit A-Law.
* @param {number} sample A 16-bit linear PCM sample
Expand Down Expand Up @@ -119,14 +127,6 @@ function decode(samples) {
return pcmSamples;
}

/** @type {!Array<number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

var alaw = /*#__PURE__*/Object.freeze({
encodeSample: encodeSample,
decodeSample: decodeSample,
Expand Down Expand Up @@ -169,6 +169,12 @@ var alaw = /*#__PURE__*/Object.freeze({

/** @module alawmulaw/mulaw */

/**
* @type {number}
* @private
*/
const BIAS = 0x84;

/**
* Encode a 16-bit linear PCM sample as 8-bit mu-Law.
* @param {number} pcmSample A 16-bit sample
Expand Down Expand Up @@ -258,13 +264,6 @@ function segmentValue_(sample) {
return segment;
}


/**
* @type {number}
* @private
*/
const BIAS = 0x84;

var mulaw = /*#__PURE__*/Object.freeze({
encodeSample: encodeSample$1,
decodeSample: decodeSample$1,
Expand Down
29 changes: 14 additions & 15 deletions dist/alawmulaw.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@

/** @module alawmulaw/alaw */

/** @type {!Array<number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

/**
* Encode a 16-bit linear PCM sample as 8-bit A-Law.
* @param {number} sample A 16-bit linear PCM sample
Expand Down Expand Up @@ -125,14 +133,6 @@
return pcmSamples;
}

/** @type {!Array<number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

var alaw = /*#__PURE__*/Object.freeze({
encodeSample: encodeSample,
decodeSample: decodeSample,
Expand Down Expand Up @@ -175,6 +175,12 @@

/** @module alawmulaw/mulaw */

/**
* @type {number}
* @private
*/
const BIAS = 0x84;

/**
* Encode a 16-bit linear PCM sample as 8-bit mu-Law.
* @param {number} pcmSample A 16-bit sample
Expand Down Expand Up @@ -264,13 +270,6 @@
return segment;
}


/**
* @type {number}
* @private
*/
const BIAS = 0x84;

var mulaw = /*#__PURE__*/Object.freeze({
encodeSample: encodeSample$1,
decodeSample: decodeSample$1,
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ <h2>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:17:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:22:04 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:17:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:22:04 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
18 changes: 9 additions & 9 deletions docs/lib_alaw.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ <h1 class="page-title">lib/alaw.js</h1>

/** @module alawmulaw/alaw */

/** @type {!Array&lt;number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];

/**
* Encode a 16-bit linear PCM sample as 8-bit A-Law.
* @param {number} sample A 16-bit linear PCM sample
Expand Down Expand Up @@ -157,14 +165,6 @@ <h1 class="page-title">lib/alaw.js</h1>
}
return pcmSamples;
}

/** @type {!Array&lt;number>} */
const LOG_TABLE = [
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
];
</code></pre>
</article>
</section>
Expand All @@ -177,7 +177,7 @@ <h1 class="page-title">lib/alaw.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:17:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:22:04 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
16 changes: 8 additions & 8 deletions docs/lib_mulaw.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ <h1 class="page-title">lib/mulaw.js</h1>

/** @module alawmulaw/mulaw */

/**
* @type {number}
* @private
*/
const BIAS = 0x84;

/**
* Encode a 16-bit linear PCM sample as 8-bit mu-Law.
* @param {number} pcmSample A 16-bit sample
Expand Down Expand Up @@ -160,13 +166,7 @@ <h1 class="page-title">lib/mulaw.js</h1>
}
return segment;
}


/**
* @type {number}
* @private
*/
const BIAS = 0x84;</code></pre>
</code></pre>
</article>
</section>

Expand All @@ -178,7 +178,7 @@ <h1 class="page-title">lib/mulaw.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:17:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:22:04 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-alawmulaw.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ <h5>Type:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:17:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:22:04 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
12 changes: 6 additions & 6 deletions docs/module-alawmulaw_alaw.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h4 class="name" id="~LOG_TABLE"><span class="type-signature">(inner, constant,

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line123">line 123</a>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line38">line 38</a>
</li></ul></dd>


Expand Down Expand Up @@ -157,7 +157,7 @@ <h4 class="name" id=".decode"><span class="type-signature">(static) </span>decod

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line113">line 113</a>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line121">line 121</a>
</li></ul></dd>


Expand Down Expand Up @@ -308,7 +308,7 @@ <h4 class="name" id=".decodeSample"><span class="type-signature">(static) </span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line71">line 71</a>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line79">line 79</a>
</li></ul></dd>


Expand Down Expand Up @@ -459,7 +459,7 @@ <h4 class="name" id=".encode"><span class="type-signature">(static) </span>encod

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line99">line 99</a>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line107">line 107</a>
</li></ul></dd>


Expand Down Expand Up @@ -610,7 +610,7 @@ <h4 class="name" id=".encodeSample"><span class="type-signature">(static) </span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line42">line 42</a>
<a href="lib_alaw.js.html">lib/alaw.js</a>, <a href="lib_alaw.js.html#line50">line 50</a>
</li></ul></dd>


Expand Down Expand Up @@ -762,7 +762,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:17:15 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 20:22:04 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down

0 comments on commit 0284a0d

Please sign in to comment.