@stdlib/random-streams-laplace 0.0.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CITATION.cff +30 -0
- package/LICENSE +0 -304
- package/NOTICE +1 -1
- package/README.md +31 -87
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +7 -0
- package/docs/types/index.d.ts +1 -1
- package/lib/factory.js +12 -3
- package/lib/index.js +4 -4
- package/lib/main.js +5 -4
- package/lib/object_mode.js +4 -3
- package/lib/validate.js +9 -8
- package/package.json +26 -52
- package/bin/cli +0 -194
- package/docs/repl.txt +0 -262
- package/docs/types/test.ts +0 -135
- package/docs/usage.txt +0 -15
- package/etc/cli_opts.json +0 -24
package/CITATION.cff
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
title: stdlib
|
|
3
|
+
message: >-
|
|
4
|
+
If you use this software, please cite it using the
|
|
5
|
+
metadata from this file.
|
|
6
|
+
|
|
7
|
+
type: software
|
|
8
|
+
|
|
9
|
+
authors:
|
|
10
|
+
- name: The Stdlib Authors
|
|
11
|
+
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
+
|
|
13
|
+
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
+
url: https://stdlib.io
|
|
15
|
+
|
|
16
|
+
abstract: |
|
|
17
|
+
Standard library for JavaScript and Node.js.
|
|
18
|
+
|
|
19
|
+
keywords:
|
|
20
|
+
- JavaScript
|
|
21
|
+
- Node.js
|
|
22
|
+
- TypeScript
|
|
23
|
+
- standard library
|
|
24
|
+
- scientific computing
|
|
25
|
+
- numerical computing
|
|
26
|
+
- statistical computing
|
|
27
|
+
|
|
28
|
+
license: Apache-2.0 AND BSL-1.0
|
|
29
|
+
|
|
30
|
+
date-released: 2016
|
package/LICENSE
CHANGED
|
@@ -175,307 +175,3 @@
|
|
|
175
175
|
of your accepting any such warranty or additional liability.
|
|
176
176
|
|
|
177
177
|
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Boost Software License - Version 1.0 - August 17th, 2003
|
|
182
|
-
|
|
183
|
-
Permission is hereby granted, free of charge, to any person or organization
|
|
184
|
-
obtaining a copy of the software and accompanying documentation covered by this
|
|
185
|
-
license (the "Software") to use, reproduce, display, distribute, execute, and
|
|
186
|
-
transmit the Software, and to prepare derivative works of the Software, and to
|
|
187
|
-
permit third-parties to whom the Software is furnished to do so, all subject to
|
|
188
|
-
the following:
|
|
189
|
-
|
|
190
|
-
The copyright notices in the Software and this entire statement, including the
|
|
191
|
-
above license grant, this restriction and the following disclaimer, must be
|
|
192
|
-
included in all copies of the Software, in whole or in part, and all derivative
|
|
193
|
-
works of the Software, unless such copies or derivative works are solely in the
|
|
194
|
-
form of machine-executable object code generated by a source language processor.
|
|
195
|
-
|
|
196
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
197
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
198
|
-
FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
199
|
-
COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
|
|
200
|
-
OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
201
|
-
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
DEPENDENCIES
|
|
207
|
-
|
|
208
|
-
The library links against the following external libraries, which have their own
|
|
209
|
-
licenses:
|
|
210
|
-
|
|
211
|
-
* OpenBLAS <https://raw.githubusercontent.com/xianyi/OpenBLAS/
|
|
212
|
-
def146efed8d5908ea04e22668feeab7099599a0/LICENSE>
|
|
213
|
-
|
|
214
|
-
Copyright (c) 2011-2014, The OpenBLAS Project
|
|
215
|
-
All rights reserved.
|
|
216
|
-
|
|
217
|
-
Redistribution and use in source and binary forms, with or without
|
|
218
|
-
modification, are permitted provided that the following conditions are
|
|
219
|
-
met:
|
|
220
|
-
|
|
221
|
-
1. Redistributions of source code must retain the above copyright
|
|
222
|
-
notice, this list of conditions and the following disclaimer.
|
|
223
|
-
|
|
224
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
225
|
-
notice, this list of conditions and the following disclaimer in
|
|
226
|
-
the documentation and/or other materials provided with the
|
|
227
|
-
distribution.
|
|
228
|
-
|
|
229
|
-
3. Neither the name of the OpenBLAS project nor the names of
|
|
230
|
-
its contributors may be used to endorse or promote products
|
|
231
|
-
derived from this software without specific prior written
|
|
232
|
-
permission.
|
|
233
|
-
|
|
234
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
235
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
236
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
237
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
238
|
-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
239
|
-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
240
|
-
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
241
|
-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
242
|
-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
243
|
-
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
* Electron <https://raw.githubusercontent.com/electron/electron/
|
|
247
|
-
c4cfb3e7110266b9d7ad80e1ae097c4db564501c/LICENSE>
|
|
248
|
-
|
|
249
|
-
Copyright (c) 2013-2017 GitHub Inc.
|
|
250
|
-
|
|
251
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
252
|
-
a copy of this software and associated documentation files (the
|
|
253
|
-
"Software"), to deal in the Software without restriction, including
|
|
254
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
255
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
256
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
257
|
-
the following conditions:
|
|
258
|
-
|
|
259
|
-
The above copyright notice and this permission notice shall be
|
|
260
|
-
included in all copies or substantial portions of the Software.
|
|
261
|
-
|
|
262
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
263
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
264
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
265
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
266
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
267
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
268
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
* Boost <http://www.boost.org/LICENSE_1_0.txt>
|
|
272
|
-
|
|
273
|
-
Boost Software License - Version 1.0 - August 17th, 2003
|
|
274
|
-
|
|
275
|
-
Permission is hereby granted, free of charge, to any person or organization
|
|
276
|
-
obtaining a copy of the software and accompanying documentation covered by
|
|
277
|
-
this license (the "Software") to use, reproduce, display, distribute,
|
|
278
|
-
execute, and transmit the Software, and to prepare derivative works of the
|
|
279
|
-
Software, and to permit third-parties to whom the Software is furnished to
|
|
280
|
-
do so, all subject to the following:
|
|
281
|
-
|
|
282
|
-
The copyright notices in the Software and this entire statement, including
|
|
283
|
-
the above license grant, this restriction and the following disclaimer,
|
|
284
|
-
must be included in all copies of the Software, in whole or in part, and
|
|
285
|
-
all derivative works of the Software, unless such copies or derivative
|
|
286
|
-
works are solely in the form of machine-executable object code generated by
|
|
287
|
-
a source language processor.
|
|
288
|
-
|
|
289
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
290
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
291
|
-
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
|
292
|
-
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
|
293
|
-
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
|
294
|
-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
295
|
-
DEALINGS IN THE SOFTWARE.
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
* Cephes <http://www.netlib.org/cephes/readme>
|
|
299
|
-
|
|
300
|
-
Copyright (c) 1984-2000 Stephen L. Moshier
|
|
301
|
-
|
|
302
|
-
Some software in this archive may be from the book _Methods and Programs for
|
|
303
|
-
Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989)
|
|
304
|
-
or from the Cephes Mathematical Library, a commercial product. In either event,
|
|
305
|
-
it is copyrighted by the author. What you see here may be used freely but it
|
|
306
|
-
comes with no support or guarantee.
|
|
307
|
-
|
|
308
|
-
Stephen L. Moshier
|
|
309
|
-
moshier@na-net.ornl.gov
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
ATTRIBUTION
|
|
314
|
-
|
|
315
|
-
The library contains implementations from the following external libraries,
|
|
316
|
-
which have their own licenses:
|
|
317
|
-
|
|
318
|
-
* FreeBSD <https://svnweb.freebsd.org/>
|
|
319
|
-
|
|
320
|
-
Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved.
|
|
321
|
-
|
|
322
|
-
Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
323
|
-
Permission to use, copy, modify, and distribute this
|
|
324
|
-
software is freely granted, provided that this notice
|
|
325
|
-
is preserved.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
* FDLIBM <http://www.netlib.org/fdlibm/>
|
|
329
|
-
|
|
330
|
-
Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
|
|
331
|
-
|
|
332
|
-
Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
333
|
-
Permission to use, copy, modify, and distribute this
|
|
334
|
-
software is freely granted, provided that this notice
|
|
335
|
-
is preserved.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
* Go <https://raw.githubusercontent.com/golang/go/master/LICENSE>
|
|
339
|
-
|
|
340
|
-
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
341
|
-
|
|
342
|
-
Redistribution and use in source and binary forms, with or without
|
|
343
|
-
modification, are permitted provided that the following conditions are
|
|
344
|
-
met:
|
|
345
|
-
|
|
346
|
-
* Redistributions of source code must retain the above copyright
|
|
347
|
-
notice, this list of conditions and the following disclaimer.
|
|
348
|
-
* Redistributions in binary form must reproduce the above
|
|
349
|
-
copyright notice, this list of conditions and the following disclaimer
|
|
350
|
-
in the documentation and/or other materials provided with the
|
|
351
|
-
distribution.
|
|
352
|
-
* Neither the name of Google Inc. nor the names of its
|
|
353
|
-
contributors may be used to endorse or promote products derived from
|
|
354
|
-
this software without specific prior written permission.
|
|
355
|
-
|
|
356
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
357
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
358
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
359
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
360
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
361
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
362
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
363
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
364
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
365
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
366
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
* SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>
|
|
370
|
-
|
|
371
|
-
Public domain.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
* ESLint <https://raw.githubusercontent.com/eslint/eslint/master/LICENSE>
|
|
375
|
-
|
|
376
|
-
Copyright JS Foundation and other contributors, https://js.foundation
|
|
377
|
-
|
|
378
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
379
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
380
|
-
in the Software without restriction, including without limitation the rights
|
|
381
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
382
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
383
|
-
furnished to do so, subject to the following conditions:
|
|
384
|
-
|
|
385
|
-
The above copyright notice and this permission notice shall be included in
|
|
386
|
-
all copies or substantial portions of the Software.
|
|
387
|
-
|
|
388
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
389
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
390
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
391
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
392
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
393
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
394
|
-
THE SOFTWARE.
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
* StatsFuns.jl <https://raw.githubusercontent.com/JuliaStats/StatsFuns.jl/
|
|
398
|
-
e66dd973650c375bc1739c820e5b96bb5bd000a8/LICENSE.md>
|
|
399
|
-
|
|
400
|
-
Copyright (c) 2015: Dahua Lin.
|
|
401
|
-
|
|
402
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
403
|
-
a copy of this software and associated documentation files (the
|
|
404
|
-
"Software"), to deal in the Software without restriction, including
|
|
405
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
406
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
407
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
408
|
-
the following conditions:
|
|
409
|
-
|
|
410
|
-
The above copyright notice and this permission notice shall be
|
|
411
|
-
included in all copies or substantial portions of the Software.
|
|
412
|
-
|
|
413
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
414
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
415
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
416
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
417
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
418
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
419
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
* SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/
|
|
423
|
-
SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE>
|
|
424
|
-
|
|
425
|
-
The MIT License (MIT)
|
|
426
|
-
|
|
427
|
-
Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others:
|
|
428
|
-
|
|
429
|
-
https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors
|
|
430
|
-
|
|
431
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
432
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
433
|
-
in the Software without restriction, including without limitation the rights
|
|
434
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
435
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
436
|
-
furnished to do so, subject to the following conditions:
|
|
437
|
-
|
|
438
|
-
The above copyright notice and this permission notice shall be included in all
|
|
439
|
-
copies or substantial portions of the Software.
|
|
440
|
-
|
|
441
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
442
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
443
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
444
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
445
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
446
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
447
|
-
SOFTWARE.
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
* MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/
|
|
451
|
-
mt19937ar.c>
|
|
452
|
-
|
|
453
|
-
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
|
|
454
|
-
All rights reserved.
|
|
455
|
-
|
|
456
|
-
Redistribution and use in source and binary forms, with or without
|
|
457
|
-
modification, are permitted provided that the following conditions
|
|
458
|
-
are met:
|
|
459
|
-
|
|
460
|
-
1. Redistributions of source code must retain the above copyright
|
|
461
|
-
notice, this list of conditions and the following disclaimer.
|
|
462
|
-
|
|
463
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
464
|
-
notice, this list of conditions and the following disclaimer in the
|
|
465
|
-
documentation and/or other materials provided with the distribution.
|
|
466
|
-
|
|
467
|
-
3. The names of its contributors may not be used to endorse or promote
|
|
468
|
-
products derived from this software without specific prior written
|
|
469
|
-
permission.
|
|
470
|
-
|
|
471
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
472
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
473
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
474
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
475
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
476
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
477
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
478
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
479
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
480
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
481
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2023 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -18,6 +18,17 @@ limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
-->
|
|
20
20
|
|
|
21
|
+
|
|
22
|
+
<details>
|
|
23
|
+
<summary>
|
|
24
|
+
About stdlib...
|
|
25
|
+
</summary>
|
|
26
|
+
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
|
|
27
|
+
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
|
|
28
|
+
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
|
|
29
|
+
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
|
|
30
|
+
</details>
|
|
31
|
+
|
|
21
32
|
# Laplace Random Numbers
|
|
22
33
|
|
|
23
34
|
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
@@ -470,91 +481,17 @@ stream.pipe( iStream );
|
|
|
470
481
|
|
|
471
482
|
<!-- Section for describing a command-line interface. -->
|
|
472
483
|
|
|
473
|
-
* * *
|
|
474
|
-
|
|
475
|
-
<section class="cli">
|
|
476
|
-
|
|
477
|
-
## CLI
|
|
478
|
-
|
|
479
|
-
<section class="installation">
|
|
480
|
-
|
|
481
|
-
## Installation
|
|
482
484
|
|
|
483
|
-
To use the module as a general utility, install the module globally
|
|
484
|
-
|
|
485
|
-
```bash
|
|
486
|
-
npm install -g @stdlib/random-streams-laplace
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
</section>
|
|
490
|
-
<!-- CLI usage documentation. -->
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
<section class="usage">
|
|
494
|
-
|
|
495
|
-
### Usage
|
|
496
|
-
|
|
497
|
-
```text
|
|
498
|
-
Usage: random-laplace [options] <mu> <b>
|
|
499
|
-
|
|
500
|
-
Options:
|
|
501
|
-
|
|
502
|
-
-h, --help Print this message.
|
|
503
|
-
-V, --version Print the package version.
|
|
504
|
-
--sep sep Separator used to join streamed data. Default: '\n'.
|
|
505
|
-
-n, --iter iterations Number of pseudorandom numbers.
|
|
506
|
-
--seed seed Pseudorandom number generator seed.
|
|
507
|
-
--state filepath Path to a file containing the pseudorandom number
|
|
508
|
-
generator state.
|
|
509
|
-
--snapshot filepath Output file path for saving the pseudorandom number
|
|
510
|
-
generator state upon exit.
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
</section>
|
|
514
|
-
|
|
515
|
-
<!-- /.usage -->
|
|
516
|
-
|
|
517
|
-
<!-- CLI usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
518
|
-
|
|
519
|
-
<section class="notes">
|
|
520
|
-
|
|
521
|
-
### Notes
|
|
522
|
-
|
|
523
|
-
- In accordance with POSIX convention, a trailing newline is **always** appended to generated output prior to exit.
|
|
524
|
-
- Specifying a "snapshot" file path is useful when wanting to resume pseudorandom number generation due to, e.g., a downstream failure in an analysis pipeline. Before exiting, the process will store the pseudorandom number generator state in a file specified according to a provided file path. Upon loading a snapshot (state), the process will generate pseudorandom numbers starting from the loaded state, thus avoiding having to seed and replay an entire analysis.
|
|
525
|
-
|
|
526
|
-
</section>
|
|
527
|
-
|
|
528
|
-
<!-- /.notes -->
|
|
529
|
-
|
|
530
|
-
<!-- CLI usage examples. -->
|
|
531
|
-
|
|
532
|
-
<section class="examples">
|
|
533
|
-
|
|
534
|
-
### Examples
|
|
535
|
-
|
|
536
|
-
```bash
|
|
537
|
-
$ random-laplace 0.0 1.0 -n 10 --seed 1234
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
</section>
|
|
541
|
-
|
|
542
|
-
<!-- /.examples -->
|
|
543
|
-
|
|
544
|
-
</section>
|
|
545
|
-
|
|
546
|
-
<!-- /.cli -->
|
|
547
485
|
|
|
548
486
|
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
549
487
|
|
|
550
488
|
<section class="related">
|
|
551
489
|
|
|
552
|
-
* * *
|
|
553
|
-
|
|
554
490
|
## See Also
|
|
555
491
|
|
|
556
|
-
- <span class="package-name">[`@stdlib/random
|
|
557
|
-
- <span class="package-name">[`@stdlib/random/
|
|
492
|
+
- <span class="package-name">[`@stdlib/random-streams-laplace-cli`][@stdlib/random-streams-laplace-cli]</span><span class="delimiter">: </span><span class="description">CLI package for use as a command-line utility.</span>
|
|
493
|
+
- <span class="package-name">[`@stdlib/random-base/laplace`][@stdlib/random/base/laplace]</span><span class="delimiter">: </span><span class="description">Laplace (double exponential) distributed pseudorandom numbers.</span>
|
|
494
|
+
- <span class="package-name">[`@stdlib/random-iter/laplace`][@stdlib/random/iter/laplace]</span><span class="delimiter">: </span><span class="description">create an iterator for generating pseudorandom numbers drawn from a Laplace distribution.</span>
|
|
558
495
|
|
|
559
496
|
</section>
|
|
560
497
|
|
|
@@ -586,7 +523,7 @@ See [LICENSE][stdlib-license].
|
|
|
586
523
|
|
|
587
524
|
## Copyright
|
|
588
525
|
|
|
589
|
-
Copyright © 2016-
|
|
526
|
+
Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
590
527
|
|
|
591
528
|
</section>
|
|
592
529
|
|
|
@@ -596,11 +533,13 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
596
533
|
|
|
597
534
|
<section class="links">
|
|
598
535
|
|
|
536
|
+
[@stdlib/random-streams-laplace-cli]: https://www.npmjs.com/package/@stdlib/random-streams-laplace-cli
|
|
537
|
+
|
|
599
538
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/random-streams-laplace.svg
|
|
600
539
|
[npm-url]: https://npmjs.org/package/@stdlib/random-streams-laplace
|
|
601
540
|
|
|
602
|
-
[test-image]: https://github.com/stdlib-js/random-streams-laplace/actions/workflows/test.yml/badge.svg
|
|
603
|
-
[test-url]: https://github.com/stdlib-js/random-streams-laplace/actions/workflows/test.yml
|
|
541
|
+
[test-image]: https://github.com/stdlib-js/random-streams-laplace/actions/workflows/test.yml/badge.svg?branch=v0.1.0
|
|
542
|
+
[test-url]: https://github.com/stdlib-js/random-streams-laplace/actions/workflows/test.yml?query=branch:v0.1.0
|
|
604
543
|
|
|
605
544
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/random-streams-laplace/main.svg
|
|
606
545
|
[coverage-url]: https://codecov.io/github/stdlib-js/random-streams-laplace?branch=main
|
|
@@ -612,19 +551,24 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
612
551
|
|
|
613
552
|
-->
|
|
614
553
|
|
|
554
|
+
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
555
|
+
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
|
|
556
|
+
|
|
557
|
+
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
558
|
+
|
|
559
|
+
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
560
|
+
|
|
561
|
+
[cli-section]: https://github.com/stdlib-js/random-streams-laplace#cli
|
|
562
|
+
[cli-url]: https://github.com/stdlib-js/random-streams-laplace/tree/cli
|
|
563
|
+
[@stdlib/random-streams-laplace]: https://github.com/stdlib-js/random-streams-laplace/tree/main
|
|
564
|
+
|
|
615
565
|
[umd]: https://github.com/umdjs/umd
|
|
616
566
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
617
567
|
|
|
618
568
|
[deno-url]: https://github.com/stdlib-js/random-streams-laplace/tree/deno
|
|
619
569
|
[umd-url]: https://github.com/stdlib-js/random-streams-laplace/tree/umd
|
|
620
570
|
[esm-url]: https://github.com/stdlib-js/random-streams-laplace/tree/esm
|
|
621
|
-
|
|
622
|
-
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
623
|
-
[chat-url]: https://gitter.im/stdlib-js/stdlib/
|
|
624
|
-
|
|
625
|
-
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
626
|
-
|
|
627
|
-
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
571
|
+
[branches-url]: https://github.com/stdlib-js/random-streams-laplace/blob/main/branches.md
|
|
628
572
|
|
|
629
573
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/random-streams-laplace/main/LICENSE
|
|
630
574
|
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";var d=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var l=d(function(_e,G){G.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var p=d(function(je,b){
|
|
2
|
+
var I=require('@stdlib/assert-is-plain-object/dist'),a=require('@stdlib/assert-has-own-property/dist'),C=require('@stdlib/assert-is-boolean/dist').isPrimitive,J=require('@stdlib/assert-is-nonnegative-number/dist').isPrimitive,m=require('@stdlib/assert-is-string/dist').isPrimitive,z=require('@stdlib/assert-is-positive-integer/dist').isPrimitive,B=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,o=require('@stdlib/error-tools-fmtprodmsg/dist');function D(e,r){return I(r)?a(r,"sep")&&(e.sep=r.sep,!m(e.sep))?new TypeError(o('0rP2W',"sep",e.sep)):a(r,"objectMode")&&(e.objectMode=r.objectMode,!C(e.objectMode))?new TypeError(o('0rP2o',"objectMode",e.objectMode)):a(r,"encoding")&&(e.encoding=r.encoding,!m(e.encoding)&&e.encoding!==null)?new TypeError(o('0rP7n',"encoding",e.encoding)):a(r,"highWaterMark")&&(e.highWaterMark=r.highWaterMark,!J(e.highWaterMark))?new TypeError(o('0rP4k',"highWaterMark",e.highWaterMark)):a(r,"iter")&&(e.iter=r.iter,!B(e.iter))?new TypeError(o('0rP2t',"iter",e.iter)):a(r,"siter")&&(e.siter=r.siter,!z(e.siter))?new TypeError(o('0rP3P',"siter",e.siter)):(a(r,"prng")&&(e.prng=r.prng),a(r,"seed")&&(e.seed=r.seed),a(r,"state")&&(e.state=r.state),a(r,"copy")&&(e.copy=r.copy),null):new TypeError(o('0rP2V',r));}b.exports=D
|
|
3
|
+
});var q=d(function(Me,y){
|
|
4
|
+
var U=require("debug"),H=U("random:streams:laplace");y.exports=H
|
|
5
|
+
});var h=d(function(Oe,O){
|
|
6
|
+
var M=require("readable-stream").Readable,K=require('@stdlib/assert-is-positive-number/dist').isPrimitive,Q=require('@stdlib/assert-is-number/dist').isPrimitive,X=require('@stdlib/math-base-assert-is-nan/dist'),Y=require('@stdlib/assert-is-error/dist'),Z=require('@stdlib/object-assign/dist'),$=require('@stdlib/utils-inherit/dist'),w=require('@stdlib/utils-define-nonenumerable-property/dist'),u=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),v=require('@stdlib/utils-define-read-only-accessor/dist'),ee=require('@stdlib/utils-define-read-write-accessor/dist'),re=require('@stdlib/random-base-laplace/dist').factory,_=require('@stdlib/buffer-from-string/dist'),j=require('@stdlib/error-tools-fmtprodmsg/dist'),te=require('@stdlib/utils-next-tick/dist'),ie=l(),ne=p(),g=q();function ae(){return this._prng.seed}function se(){return this._prng.seedLength}function ue(){return this._prng.stateLength}function oe(){return this._prng.byteLength}function de(){return this._prng.state}function ge(e){this._prng.state=e}function ve(){var e,r;if(!this._destroyed)for(e=!0;e;){if(this._i+=1,this._i>this._iter)return g("Finished generating pseudorandom numbers."),this.push(null);r=this._prng(),g("Generated a new pseudorandom number. Value: %d. Iter: %d.",r,this._i),this._objectMode===!1&&(r=r.toString(),this._i===1?r=_(r):r=_(this._sep+r)),e=this.push(r),this._i%this._siter===0&&this.emit("state",this.state)}}function he(e){var r;if(this._destroyed)return g("Attempted to destroy an already destroyed stream."),this;return r=this,this._destroyed=!0,te(n),this;function n(){e&&(g("Stream was destroyed due to an error. Error: %s.",Y(e)?e.message:JSON.stringify(e)),r.emit("error",e)),g("Closing the stream..."),r.emit("close")}}function i(e,r,n){var t,s;if(!(this instanceof i))return arguments.length>2?new i(e,r,n):new i(e,r);if(!Q(e)||X(e))throw new TypeError(j('0rP6v',e));if(!K(r))throw new TypeError(j('0rP72',r));if(t=Z({},ie),arguments.length>2&&(s=ne(t,n),s))throw s;return g("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),M.call(this,t),w(this,"_destroyed",!1),u(this,"_objectMode",t.objectMode),u(this,"_sep",t.sep),u(this,"_iter",t.iter),u(this,"_siter",t.siter),w(this,"_i",0),u(this,"_prng",re(e,r,t)),u(this,"PRNG",this._prng.PRNG),this}$(i,M);v(i.prototype,"seed",ae);v(i.prototype,"seedLength",se);ee(i.prototype,"state",de,ge);v(i.prototype,"stateLength",ue);v(i.prototype,"byteLength",oe);u(i.prototype,"_read",ve);u(i.prototype,"destroy",he);O.exports=i
|
|
7
|
+
});var E=d(function(Se,S){
|
|
8
|
+
var ce=require('@stdlib/assert-is-plain-object/dist'),fe=require('@stdlib/object-assign/dist'),le=require('@stdlib/error-tools-fmtprodmsg/dist'),me=h();function be(e,r,n){var t;if(arguments.length>2){if(t=n,!ce(t))throw new TypeError(le('0rP2V',t));t=fe({},n)}else t={};return t.objectMode=!0,new me(e,r,t)}S.exports=be
|
|
9
|
+
});var k=d(function(Ee,L){
|
|
10
|
+
var N=require('@stdlib/assert-is-plain-object/dist'),T=require('@stdlib/object-assign/dist'),P=require('@stdlib/error-tools-fmtprodmsg/dist'),R=h();function pe(e,r,n){var t,s,c;if(t=arguments.length,t===1){if(!N(e))throw new TypeError(P('0rP2V',e));s=T({},e)}else if(t>2){if(!N(n))throw new TypeError(P('0rP2V',n));s=T({},n)}else s={};return t<2?c=V:c=W,c;function V(A,F){return new R(A,F,s)}function W(){return new R(e,r,s)}}L.exports=pe
|
|
11
|
+
});var x=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),f=h(),ye=E(),qe=k();x(f,"objectMode",ye);x(f,"factory",qe);module.exports=f;
|
|
12
|
+
/** @license Apache-2.0 */
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../lib/defaults.json", "../lib/validate.js", "../lib/debug.js", "../lib/main.js", "../lib/object_mode.js", "../lib/factory.js", "../lib/index.js"],
|
|
4
|
+
"sourcesContent": ["{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert-is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:laplace' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert-is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar isError = require( '@stdlib/assert-is-error' );\nvar assign = require( '@stdlib/object-assign' );\nvar inherit = require( '@stdlib/utils-inherit' );\nvar setNonEnumerable = require( '@stdlib/utils-define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils-define-read-write-accessor' );\nvar rlaplace = require( '@stdlib/random-base-laplace' ).factory;\nvar string2buffer = require( '@stdlib/buffer-from-string' );\nvar format = require( '@stdlib/string-format' );\nvar nextTick = require( '@stdlib/utils-next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, b, options );\n\t\t}\n\t\treturn new RandomStream( mu, b );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlaplace( mu, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar assign = require( '@stdlib/object-assign' );\nvar format = require( '@stdlib/string-format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert-is-plain-object' );\nvar assign = require( '@stdlib/object-assign' );\nvar format = require( '@stdlib/string-format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, b ) {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random-streams-laplace\n*\n* @example\n* var inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n* var randomStream = require( '@stdlib/random-streams-laplace' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random-streams-laplace' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n* var randomStream = require( '@stdlib/random-streams-laplace' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,CAAAA,EAAA,SACC,WAAc,GACd,SAAY,KACZ,IAAO,KACP,KAAQ,GACR,MAAS,KACV,ICNA,IAAAC,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,gCAAiC,EACrDC,EAAa,QAAS,iCAAkC,EACxDC,EAAY,QAAS,2BAA4B,EAAE,YACnDC,EAAgB,QAAS,sCAAuC,EAAE,YAClEC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAoB,QAAS,oCAAqC,EAAE,YACpEC,EAAuB,QA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,IAAIL,GAAcE,EAAIC,EAAGE,CAAK,CACtC,CAKAT,EAAO,QAAUK,KCpFjB,IAAAK,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,gCAAiC,EAC1DC,EAAS,QAAS,uBAAwB,EAC1CC,EAAS,QAAS,uBAAwB,EAC1CC,EAAe,IAyCnB,SAASC,GAASC,EAAIC,EAAGC,EAAU,CAClC,IAAIC,EACAC,EACAC,EAGJ,GADAF,EAAQ,UAAU,OACbA,IAAU,EAAI,CAClB,GAAK,CAACR,EAAeK,CAAG,EACvB,MAAM,IAAI,UAAWH,EAAQ,qEAAsEG,CAAG,CAAE,EAEzGI,EAAOR,EAAQ,CAAC,EAAGI,CAAG,CACvB,SAAYG,EAAQ,EAAI,CACvB,GAAK,CAACR,EAAeO,CAAQ,EAC5B,MAAM,IAAI,UAAWL,EAAQ,qEAAsEK,CAAQ,CAAE,EAE9GE,EAAOR,EAAQ,CAAC,EAAGM,CAAQ,CAC5B,MACCE,EAAO,CAAC,EAET,OAAKD,EAAQ,EACZE,EAAMC,EAEND,EAAME,EAEAF,EAeP,SAASC,EAAeN,EAAIC,EAAI,CAC/B,OAAO,IAAIH,EAAcE,EAAIC,EAAGG,CAAK,CACtC,CAaA,SAASG,GAAgB,CACxB,OAAO,IAAIT,EAAcE,EAAIC,EAAGG,CAAK,CACtC,CACD,CAKAV,EAAO,QAAUK,KChDjB,IAAIS,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,GAAa,IACbC,GAAU,IAKdH,EAAaC,EAAM,aAAcC,EAAW,EAC5CF,EAAaC,EAAM,UAAWE,EAAQ,EAKtC,OAAO,QAAUF",
|
|
6
|
+
"names": ["require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlaplace", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "destroy", "error", "self", "close", "RandomStream", "mu", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "setReadOnly", "main", "objectMode", "factory"]
|
|
7
|
+
}
|