Skip to content

Commit 06edacc

Browse files
committed
Set first stable version; add some keywords.
1 parent e04a85c commit 06edacc

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![NPM version][npm-image]][npm-url] ![dependencies][dependencies-image] [![License MIT][license-image]](LICENSE)
44

55
Simple and fast ES3-check that function is pure.
6-
76
```js
87
/**
98
* @param {function} fn
@@ -13,7 +12,6 @@
1312
*/
1413
function isPureFunction(fn, thisArg, args) {};
1514
```
16-
1715
*fn* is pure, if not throw when called with *thisArg* as this and *args* as arguments in global scope.
1816

1917
Pure function cannot use closures, but can use exists global vars (Array, Object, setTimeout, etc.).
@@ -24,7 +22,7 @@ Result of Function.prototype.bind() could not be pure (because we can not substi
2422

2523
It is supposed to use in reactive libraries.
2624

27-
## Examples
25+
## Examples ##
2826
```js
2927
var isPureFunction = require('is-pure-function');
3028

@@ -117,10 +115,9 @@ isPureFunction(boundFn, 0, []);
117115
// it is unlikely you will need
118116
isPureFunction.clearCache();
119117
```
120-
121118
Use pure functions for FRP (the best way is arrow functions, without this and arguments object, with a fixed number of arguments).
122119

123-
## Tests
120+
## Tests ##
124121
Standalone pages test/es3.html && test/es6.html (via Mocha). Install webpack and opener, build scripts, than run tests:
125122
```bash
126123
$ npm install

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "is-pure-function",
3-
"version": "0.1.6",
3+
"version": "1.0.0",
44
"description": "Return true, if function is pure.",
55
"main": "src/is-pure-function.js",
66
"scripts": {
@@ -10,7 +10,9 @@
1010
"keywords": [
1111
"check",
1212
"pure",
13+
"purity",
1314
"function",
15+
"FRP",
1416
"reactive",
1517
"model"
1618
],

0 commit comments

Comments
 (0)