@stdlib/stats-base-dists-geometric-pmf 0.0.7 → 0.2.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/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2022 The Stdlib Authors.
1
+ Copyright (c) 2016-2024 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
  # Probability Mass Function
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] -->
@@ -175,7 +186,7 @@ See [LICENSE][stdlib-license].
175
186
 
176
187
  ## Copyright
177
188
 
178
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
189
+ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
179
190
 
180
191
  </section>
181
192
 
@@ -188,8 +199,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
188
199
  [npm-image]: http://img.shields.io/npm/v/@stdlib/stats-base-dists-geometric-pmf.svg
189
200
  [npm-url]: https://npmjs.org/package/@stdlib/stats-base-dists-geometric-pmf
190
201
 
191
- [test-image]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/actions/workflows/test.yml/badge.svg?branch=v0.0.7
192
- [test-url]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/actions/workflows/test.yml?query=branch:v0.0.7
202
+ [test-image]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/actions/workflows/test.yml/badge.svg?branch=v0.2.0
203
+ [test-url]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/actions/workflows/test.yml?query=branch:v0.2.0
193
204
 
194
205
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/stats-base-dists-geometric-pmf/main.svg
195
206
  [coverage-url]: https://codecov.io/github/stdlib-js/stats-base-dists-geometric-pmf?branch=main
@@ -202,7 +213,7 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
202
213
  -->
203
214
 
204
215
  [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
205
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
216
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
206
217
 
207
218
  [stdlib]: https://github.com/stdlib-js/stdlib
208
219
 
@@ -212,8 +223,11 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
212
223
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
213
224
 
214
225
  [deno-url]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/tree/deno
226
+ [deno-readme]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/blob/deno/README.md
215
227
  [umd-url]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/tree/umd
228
+ [umd-readme]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/blob/umd/README.md
216
229
  [esm-url]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/tree/esm
230
+ [esm-readme]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/blob/esm/README.md
217
231
  [branches-url]: https://github.com/stdlib-js/stats-base-dists-geometric-pmf/blob/main/branches.md
218
232
 
219
233
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/stats-base-dists-geometric-pmf/main/LICENSE
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import pmf from '../docs/types/index';
3
+ export = pmf;
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";var n=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var o=n(function(O,u){
2
+ var c=require('@stdlib/math-base-assert-is-nonnegative-integer/dist'),a=require('@stdlib/math-base-assert-is-nan/dist'),N=require('@stdlib/math-base-special-pow/dist');function g(e,r){var t;return a(e)||a(r)||r<0||r>1?NaN:c(e)?(t=1-r,r*N(t,e)):0}u.exports=g
3
+ });var f=n(function(R,v){
4
+ var y=require('@stdlib/math-base-assert-is-nonnegative-integer/dist'),m=require('@stdlib/utils-constant-function/dist'),s=require('@stdlib/math-base-assert-is-nan/dist'),w=require('@stdlib/math-base-special-pow/dist');function I(e){if(s(e)||e<0||e>1)return m(NaN);return r;function r(t){var i;return s(t)?NaN:y(t)?(i=1-e,e*w(i,t)):0}}v.exports=I
5
+ });var d=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),q=o(),l=f();d(q,"factory",l);module.exports=q;
6
+ /** @license Apache-2.0 */
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/main.js", "../lib/factory.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\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 isNonNegativeInteger = require( '@stdlib/math-base-assert-is-nonnegative-integer' );\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar pow = require( '@stdlib/math-base-special-pow' );\n\n\n// MAIN //\n\n/**\n* Evaluates the probability mass function (PMF) for a geometric distribution with success probability `p` at a value `x`.\n*\n* @param {number} x - input value\n* @param {Probability} p - success probability\n* @returns {Probability} evaluated PMF\n*\n* @example\n* var y = pmf( 4.0, 0.3 );\n* // returns ~0.072\n*\n* @example\n* var y = pmf( 2.0, 0.7 );\n* // returns ~0.063\n*\n* @example\n* var y = pmf( -1.0, 0.5 );\n* // returns 0.0\n*\n* @example\n* var y = pmf( 0.0, NaN );\n* // returns NaN\n*\n* @example\n* var y = pmf( NaN, 0.5 );\n* // returns NaN\n*\n* @example\n* // Invalid success probability:\n* var y = pmf( 2.0, 1.5 );\n* // returns NaN\n*/\nfunction pmf( x, p ) {\n\tvar q;\n\tif (\n\t\tisnan( x ) ||\n\t\tisnan( p ) ||\n\t\tp < 0.0 ||\n\t\tp > 1.0\n\t) {\n\t\treturn NaN;\n\t}\n\tif ( isNonNegativeInteger( x ) ) {\n\t\tq = 1.0 - p;\n\t\treturn p * pow( q, x );\n\t}\n\treturn 0.0;\n}\n\n\n// EXPORTS //\n\nmodule.exports = pmf;\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 isNonNegativeInteger = require( '@stdlib/math-base-assert-is-nonnegative-integer' );\nvar constantFunction = require( '@stdlib/utils-constant-function' );\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar pow = require( '@stdlib/math-base-special-pow' );\n\n\n// MAIN //\n\n/**\n* Returns a function for evaluating the probability mass function (PMF) for a geometric distribution with success probability `p`.\n*\n* @param {Probability} p - success probability\n* @returns {Function} PMF\n*\n* @example\n* var pmf = factory( 0.5 );\n* var y = pmf( 3.0 );\n* // returns 0.0625\n*\n* y = pmf( 1.0 );\n* // returns 0.25\n*/\nfunction factory( p ) {\n\tif (\n\t\tisnan( p ) ||\n\t\tp < 0.0 ||\n\t\tp > 1.0\n\t) {\n\t\treturn constantFunction( NaN );\n\t}\n\treturn pmf;\n\n\t/**\n\t* Evaluates the probability mass function (PMF) for a geometric distribution.\n\t*\n\t* @private\n\t* @param {number} x - input value\n\t* @returns {Probability} evaluated PMF\n\t*\n\t* @example\n\t* var y = pmf( 2.0 );\n\t* // returns <number>\n\t*/\n\tfunction pmf( x ) {\n\t\tvar q;\n\t\tif ( isnan( x ) ) {\n\t\t\treturn NaN;\n\t\t}\n\t\tif ( isNonNegativeInteger( x ) ) {\n\t\t\tq = 1.0 - p;\n\t\t\treturn p * pow( q, x );\n\t\t}\n\t\treturn 0.0;\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* Geometric distribution probability mass function (PMF).\n*\n* @module @stdlib/stats-base-dists-geometric-pmf\n*\n* @example\n* var pmf = require( '@stdlib/stats-base-dists-geometric-pmf' );\n*\n* var y = pmf( 4.0, 0.3 );\n* // returns ~0.072\n*\n* y = pmf( 2.0, 0.7 );\n* // returns ~0.063\n*\n* y = pmf( -1.0, 0.5 );\n* // returns 0.0\n*\n* var mypmf = pmf.factory( 0.5 );\n* y = mypmf( 3.0 );\n* // returns 0.0625\n*\n* y = mypmf( 1.0 );\n* // returns 0.25\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAuB,QAAS,iDAAkD,EAClFC,EAAQ,QAAS,iCAAkC,EACnDC,EAAM,QAAS,+BAAgC,EAqCnD,SAASC,EAAKC,EAAGC,EAAI,CACpB,IAAIC,EACJ,OACCL,EAAOG,CAAE,GACTH,EAAOI,CAAE,GACTA,EAAI,GACJA,EAAI,EAEG,IAEHL,EAAsBI,CAAE,GAC5BE,EAAI,EAAMD,EACHA,EAAIH,EAAKI,EAAGF,CAAE,GAEf,CACR,CAKAL,EAAO,QAAUI,ICjFjB,IAAAI,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAuB,QAAS,iDAAkD,EAClFC,EAAmB,QAAS,iCAAkC,EAC9DC,EAAQ,QAAS,iCAAkC,EACnDC,EAAM,QAAS,+BAAgC,EAmBnD,SAASC,EAASC,EAAI,CACrB,GACCH,EAAOG,CAAE,GACTA,EAAI,GACJA,EAAI,EAEJ,OAAOJ,EAAkB,GAAI,EAE9B,OAAOK,EAaP,SAASA,EAAKC,EAAI,CACjB,IAAIC,EACJ,OAAKN,EAAOK,CAAE,EACN,IAEHP,EAAsBO,CAAE,GAC5BC,EAAI,EAAMH,EACHA,EAAIF,EAAKK,EAAGD,CAAE,GAEf,CACR,CACD,CAKAR,EAAO,QAAUK,IClCjB,IAAIK,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,EAAU,IAKdF,EAAaC,EAAM,UAAWC,CAAQ,EAKtC,OAAO,QAAUD",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isnan", "pow", "pmf", "x", "p", "q", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "constantFunction", "isnan", "pow", "factory", "p", "pmf", "x", "q", "setReadOnly", "main", "factory"]
7
+ }
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
 
21
21
  /**
22
22
  * Evaluates the probability mass function (PMF) for a geometric distribution.
package/lib/index.js CHANGED
@@ -46,15 +46,15 @@
46
46
  // MODULES //
47
47
 
48
48
  var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );
49
- var pmf = require( './pmf.js' );
49
+ var main = require( './main.js' );
50
50
  var factory = require( './factory.js' );
51
51
 
52
52
 
53
53
  // MAIN //
54
54
 
55
- setReadOnly( pmf, 'factory', factory );
55
+ setReadOnly( main, 'factory', factory );
56
56
 
57
57
 
58
58
  // EXPORTS //
59
59
 
60
- module.exports = pmf;
60
+ module.exports = main;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/stats-base-dists-geometric-pmf",
3
- "version": "0.0.7",
3
+ "version": "0.2.0",
4
4
  "description": "Geometric distribution probability mass function (PMF).",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,22 +37,23 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/math-base-assert-is-nan": "^0.0.x",
41
- "@stdlib/math-base-assert-is-nonnegative-integer": "^0.0.x",
42
- "@stdlib/math-base-special-pow": "^0.0.x",
43
- "@stdlib/utils-constant-function": "^0.0.x",
44
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x"
40
+ "@stdlib/math-base-assert-is-nan": "^0.2.0",
41
+ "@stdlib/math-base-assert-is-nonnegative-integer": "^0.2.0",
42
+ "@stdlib/math-base-special-pow": "^0.2.0",
43
+ "@stdlib/utils-constant-function": "^0.2.0",
44
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@stdlib/bench": "^0.0.x",
48
- "@stdlib/constants-float64-eps": "^0.0.x",
49
- "@stdlib/constants-float64-pinf": "^0.0.x",
50
- "@stdlib/math-base-special-abs": "^0.0.x",
51
- "@stdlib/math-base-special-round": "^0.0.x",
52
- "@stdlib/random-base-randu": "^0.0.x",
47
+ "@stdlib/constants-float64-eps": "^0.1.1",
48
+ "@stdlib/constants-float64-pinf": "^0.1.1",
49
+ "@stdlib/math-base-special-abs": "^0.1.1",
50
+ "@stdlib/math-base-special-round": "^0.1.1",
51
+ "@stdlib/random-base-randu": "^0.1.0",
53
52
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
54
53
  "istanbul": "^0.4.1",
55
- "tap-spec": "5.x.x"
54
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
55
+ "@stdlib/bench-harness": "^0.2.0",
56
+ "@stdlib/bench": "^0.3.1"
56
57
  },
57
58
  "engines": {
58
59
  "node": ">=0.10.0",
@@ -84,7 +85,7 @@
84
85
  "discrete"
85
86
  ],
86
87
  "funding": {
87
- "type": "patreon",
88
- "url": "https://www.patreon.com/athan"
88
+ "type": "opencollective",
89
+ "url": "https://opencollective.com/stdlib"
89
90
  }
90
91
  }
package/docs/repl.txt DELETED
@@ -1,64 +0,0 @@
1
-
2
- {{alias}}( x, p )
3
- Evaluates the probability mass function (PMF) for a geometric distribution
4
- with success probability `p` at a value `x`.
5
-
6
- If provided `NaN` as any argument, the function returns `NaN`.
7
-
8
- If `p < 0` or `p > 1`, the function returns `NaN`.
9
-
10
- Parameters
11
- ----------
12
- x: number
13
- Input value.
14
-
15
- p: number
16
- Success probability.
17
-
18
- Returns
19
- -------
20
- out: number
21
- Evaluated PMF.
22
-
23
- Examples
24
- --------
25
- > var y = {{alias}}( 4.0, 0.3 )
26
- ~0.072
27
- > y = {{alias}}( 2.0, 0.7 )
28
- ~0.063
29
- > y = {{alias}}( -1.0, 0.5 )
30
- 0.0
31
- > y = {{alias}}( 0.0, NaN )
32
- NaN
33
- > y = {{alias}}( NaN, 0.5 )
34
- NaN
35
- // Invalid success probability:
36
- > y = {{alias}}( 2.0, 1.5 )
37
- NaN
38
-
39
-
40
- {{alias}}.factory( p )
41
- Returns a function for evaluating the probability mass function (PMF) of a
42
- geometric distribution with success probability `p`.
43
-
44
- Parameters
45
- ----------
46
- p: number
47
- Success probability.
48
-
49
- Returns
50
- -------
51
- pmf: Function
52
- Probability mass function (PMF).
53
-
54
- Examples
55
- --------
56
- > var mypmf = {{alias}}.factory( 0.5 );
57
- > var y = mypmf( 3.0 )
58
- 0.0625
59
- > y = mypmf( 1.0 )
60
- 0.25
61
-
62
- See Also
63
- --------
64
-
@@ -1,98 +0,0 @@
1
- /*
2
- * @license Apache-2.0
3
- *
4
- * Copyright (c) 2019 The Stdlib Authors.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import pmf = require( './index' );
20
-
21
-
22
- // TESTS //
23
-
24
- // The function returns a number...
25
- {
26
- pmf( 2, 0.4 ); // $ExpectType number
27
- pmf( 1, 0.2 ); // $ExpectType number
28
- }
29
-
30
- // The compiler throws an error if the function is provided values other than two numbers...
31
- {
32
- pmf( true, 0.3 ); // $ExpectError
33
- pmf( false, 0.2 ); // $ExpectError
34
- pmf( '5', 0.1 ); // $ExpectError
35
- pmf( [], 0.1 ); // $ExpectError
36
- pmf( {}, 0.4 ); // $ExpectError
37
- pmf( ( x: number ): number => x, 0.2 ); // $ExpectError
38
-
39
- pmf( 0, true ); // $ExpectError
40
- pmf( 1, false ); // $ExpectError
41
- pmf( 0, '5' ); // $ExpectError
42
- pmf( 1, [] ); // $ExpectError
43
- pmf( 2, {} ); // $ExpectError
44
- pmf( 3, ( x: number ): number => x ); // $ExpectError
45
- }
46
-
47
- // The compiler throws an error if the function is provided an unsupported number of arguments...
48
- {
49
- pmf(); // $ExpectError
50
- pmf( 0 ); // $ExpectError
51
- pmf( 1, 0.3, 4 ); // $ExpectError
52
- }
53
-
54
- // Attached to main export is a `factory` method which returns a function...
55
- {
56
- pmf.factory( 0.4 ); // $ExpectType Unary
57
- }
58
-
59
- // The `factory` method returns a function which returns a number...
60
- {
61
- const fcn = pmf.factory( 0.4 );
62
- fcn( 2 ); // $ExpectType number
63
- }
64
-
65
- // The compiler throws an error if the function returned by the `factory` method is provided an invalid argument...
66
- {
67
- const fcn = pmf.factory( 0.4 );
68
- fcn( true ); // $ExpectError
69
- fcn( false ); // $ExpectError
70
- fcn( '5' ); // $ExpectError
71
- fcn( [] ); // $ExpectError
72
- fcn( {} ); // $ExpectError
73
- fcn( ( x: number ): number => x ); // $ExpectError
74
- }
75
-
76
- // The compiler throws an error if the function returned by the `factory` method is provided an unsupported number of arguments...
77
- {
78
- const fcn = pmf.factory( 0.4 );
79
- fcn(); // $ExpectError
80
- fcn( 2, 0 ); // $ExpectError
81
- fcn( 2, 0, 1 ); // $ExpectError
82
- }
83
-
84
- // The compiler throws an error if the `factory` method is provided a value other than a number...
85
- {
86
- pmf.factory( true ); // $ExpectError
87
- pmf.factory( false ); // $ExpectError
88
- pmf.factory( '5' ); // $ExpectError
89
- pmf.factory( [] ); // $ExpectError
90
- pmf.factory( {} ); // $ExpectError
91
- pmf.factory( ( x: number ): number => x ); // $ExpectError
92
- }
93
-
94
- // The compiler throws an error if the `factory` method is provided an unsupported number of arguments...
95
- {
96
- pmf.factory( 0, 0.2 ); // $ExpectError
97
- pmf.factory( 0, 0.4, 8 ); // $ExpectError
98
- }
File without changes