Skip to content

Commit

Permalink
Mark private functions private
Browse files Browse the repository at this point in the history
  • Loading branch information
hildjj committed Jul 2, 2023
1 parent 688fc9d commit d20118a
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 76 deletions.
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

136 changes: 68 additions & 68 deletions docs/classes/Basura.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/BasuraGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hildjj/basura/blob/d93b175/lib/index.js#L87">index.js:87</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/hildjj/basura/blob/688fc9d/lib/index.js#L87">index.js:87</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/types/BasuraRandBytes.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h5><span class="tsd-kind-parameter">reason</span>: <span class="tsd-signature-t
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Buffer</span></h4>
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/hildjj/basura/blob/d93b175/lib/index.js#L76">index.js:76</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/hildjj/basura/blob/688fc9d/lib/index.js#L76">index.js:76</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion lib/data.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Buffer} from 'buffer'
import {UnicodeTrie} from '@cto.af/unicode-trie'

export const generatedDate = new Date('2023-07-01T21:53:27.470Z')
export const generatedDate = new Date('2023-07-02T05:19:40.130Z')
export const Trie = new UnicodeTrie(Buffer.from(
`AAgOAAAAAQAdFgAAW79bMSIJaU1qREUrEZS/SrDhUF1Bf5jSr7Qt78H5xQWGlljE8+y/GDAJ
twylHYRTOzsjgIsBoDZjeJ9XeUqhbaKLg4O3Cw+Dpv7LuML1c+FfphdIp+knnXZw8xYySCeu
Expand Down
4 changes: 4 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export class Basura {
* to generate up to stringLength bytes
* @param {string} [reason='unspecified'] - reason for generation
* @return {bigint} the random number
* @private
*/
_randUBigInt(bytes = -1, reason = 'unspecified') {
const len = (bytes === -1) ?
Expand All @@ -300,6 +301,7 @@ export class Basura {
*
* @param {string} [reason='unspecified'] - reason for generation
* @return {number} the random number
* @private
*/
_random01(reason = 'unspecified') {
const buf = this._randBytes(8, `_random01,${reason}`)
Expand All @@ -326,6 +328,7 @@ export class Basura {
* generated
* @param {string} [reason='unspecified'] - reason for generation
* @return {number} the random number
* @private
*/
_randomGauss(mean, stdDev, reason = 'unspecified') {
// See: https://stackoverflow.com/a/60476586/8388 or
Expand Down Expand Up @@ -354,6 +357,7 @@ export class Basura {
* @param {number} num - one more than the maximum number generated
* @param {string} [reason='unspecified'] - reason for generation
* @return {number} the random number
* @private
*/
_upto(num, reason = 'unspecified') {
if (num === 0) {
Expand Down
12 changes: 8 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,17 @@ export class Basura {
* to generate up to stringLength bytes
* @param {string} [reason='unspecified'] - reason for generation
* @return {bigint} the random number
* @private
*/
_randUBigInt(bytes?: number, reason?: string): bigint;
private _randUBigInt;
/**
* Generate a random number (0,1].
*
* @param {string} [reason='unspecified'] - reason for generation
* @return {number} the random number
* @private
*/
_random01(reason?: string): number;
private _random01;
/**
* Generate a random number with close to gaussian distribution.
* Uses the polar method for normal deviates, which generates two
Expand All @@ -138,16 +140,18 @@ export class Basura {
* generated
* @param {string} [reason='unspecified'] - reason for generation
* @return {number} the random number
* @private
*/
_randomGauss(mean: number, stdDev: number, reason?: string): number;
private _randomGauss;
/**
* Generate a random positive integer less than a given number.
*
* @param {number} num - one more than the maximum number generated
* @param {string} [reason='unspecified'] - reason for generation
* @return {number} the random number
* @private
*/
_upto(num: number, reason?: string): number;
private _upto;
/**
* Pick an arbitrary element from the specified array
*
Expand Down

0 comments on commit d20118a

Please sign in to comment.