pargras 1.0.3 → 1.1.1
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/LICENSE +1 -1
- package/README.md +34 -14
- package/package.json +24 -11
- package/pargras.js +6 -5
- package/pargras.min.js +2 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Pargras
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
-
`Pargras` is a minimalistic helper around function arguments for Node.js and the Browser. `Pargras` has a fluent
|
|
4
|
+
`Pargras` is a minimalistic helper around function arguments for Node.js and the Browser. `Pargras` has a fluent
|
|
5
|
+
interface and supports adding, removing and altering arguments before applying them to a function.
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
Getting started
|
|
@@ -23,8 +24,8 @@ const Pargras = require('pargras');
|
|
|
23
24
|
|
|
24
25
|
### Browser
|
|
25
26
|
You can download the latest release from the repository
|
|
26
|
-
* [`pargras.js`](https://github.com/
|
|
27
|
-
* [`pargras.min.js`](https://github.com/
|
|
27
|
+
* [`pargras.js`](https://github.com/tbillenstein/pargras/blob/master/pargras.js) unminified, including comments
|
|
28
|
+
* [`pargras.min.js`](https://github.com/tbillenstein/pargras/blob/master/pargras.min.js) minified version
|
|
28
29
|
|
|
29
30
|
Use a script tag to directly add `Pargras` to the global scope.
|
|
30
31
|
|
|
@@ -138,17 +139,24 @@ afunc(1, 2, 3, 4);
|
|
|
138
139
|
|
|
139
140
|
More examples
|
|
140
141
|
-------------
|
|
141
|
-
Please refer to the [test spec](https://github.com/
|
|
142
|
+
Please refer to the [test spec](https://github.com/tbillenstein/pargras/blob/master/spec/PargrasSpec.js) for more examples.
|
|
142
143
|
|
|
143
144
|
|
|
144
145
|
Testing
|
|
145
146
|
-------
|
|
146
|
-
We
|
|
147
|
+
We use
|
|
148
|
+
* [JSHint](https://jshint.com/) for static code analysis.
|
|
149
|
+
* [Jasmine testing framework](https://jasmine.github.io/index.html) for testing.
|
|
150
|
+
* [Karma test runner](https://karma-runner.github.io/latest/index.html) for testing in the browser.
|
|
151
|
+
* [Istanbul test coverage framework](https://istanbul.js.org/) for tracking test coverage.
|
|
147
152
|
|
|
153
|
+
Steps to be taken
|
|
148
154
|
* Clone or download the repository.
|
|
149
|
-
* Change into project directory.
|
|
155
|
+
* Change into the project directory.
|
|
150
156
|
* Use `npm install` to install all development dependencies.
|
|
157
|
+
* Use `npm runt lint` to run static code analysis.
|
|
151
158
|
* Use `npm test` to run the tests.
|
|
159
|
+
* Use `npm run coverage` to track test coverage.
|
|
152
160
|
* The output should display successful execution results and a code coverage map.
|
|
153
161
|
|
|
154
162
|
|
|
@@ -156,33 +164,45 @@ Build
|
|
|
156
164
|
-----
|
|
157
165
|
* Clone or download the repository.
|
|
158
166
|
* Change into project directory.
|
|
159
|
-
* Use `
|
|
167
|
+
* Use `npm run build` in project directory to build `pargras.min.js` from `pargras.js`.
|
|
160
168
|
|
|
161
169
|
|
|
162
170
|
Contribution
|
|
163
171
|
------------
|
|
164
|
-
Please use [Github issues](https://github.com/
|
|
172
|
+
Please use [Github issues](https://github.com/tbillenstein/pargras/issues) for requests.
|
|
165
173
|
|
|
166
174
|
Pull requests are welcome.
|
|
167
175
|
|
|
168
176
|
|
|
169
177
|
Issues
|
|
170
178
|
------
|
|
171
|
-
We use GitHub issues to track bugs. Please ensure your bug description is clear and has sufficient instructions to be
|
|
179
|
+
We use GitHub issues to track bugs. Please ensure your bug description is clear and has sufficient instructions to be
|
|
180
|
+
able to reproduce the issue.
|
|
172
181
|
|
|
173
|
-
The absolute best way to report a bug is to submit a pull request including a new failing test which describes the bug.
|
|
182
|
+
The absolute best way to report a bug is to submit a pull request including a new failing test which describes the bug.
|
|
183
|
+
When the bug is fixed, your pull request can then be merged.
|
|
174
184
|
|
|
175
|
-
The next best way to report a bug is to provide a reduced test case on jsFiddle or jsBin or produce exact code inline
|
|
185
|
+
The next best way to report a bug is to provide a reduced test case on jsFiddle or jsBin or produce exact code inline
|
|
186
|
+
in the issue which will reproduce the bug.
|
|
176
187
|
|
|
177
188
|
|
|
178
189
|
Support
|
|
179
190
|
-------
|
|
180
|
-
* Send us an email: [
|
|
181
|
-
* Follow us on Twitter: [@
|
|
191
|
+
* Send us an email: [tb@thomasbillenstein.com](mailto:tb@thomasbillenstein.com)
|
|
192
|
+
* Follow us on Twitter: [@tbillenstein](https://x.com/tbillenstein/)
|
|
182
193
|
|
|
183
194
|
|
|
184
195
|
Changelog
|
|
185
196
|
---------
|
|
197
|
+
v1.1.0
|
|
198
|
+
* Update npm modules.
|
|
199
|
+
* Update and extend test environment.
|
|
200
|
+
* Add static code analysis tool JSHint.
|
|
201
|
+
* Add Karma test runner.
|
|
202
|
+
* Fix JSHint issues.
|
|
203
|
+
* Replace uglify-js by terser for minification.
|
|
204
|
+
* Update README.
|
|
205
|
+
|
|
186
206
|
v1.0.3
|
|
187
207
|
* Update npm modules.
|
|
188
208
|
|
|
@@ -198,4 +218,4 @@ v1.0.0
|
|
|
198
218
|
|
|
199
219
|
License
|
|
200
220
|
-------
|
|
201
|
-
Copyright (c) 2016-present,
|
|
221
|
+
Copyright (c) 2016-present, tbillenstein. `Pargras` is licensed under the [MIT License](https://github.com/tbillenstein/pargras/blob/master/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pargras",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Pargras is a minimalistic helper around function arguments for Node.js and the
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Pargras is a minimalistic helper around function arguments for Node.js and the browser. Pargras has a fluent interface and supports adding, removing and altering arguments before applying them to a function.",
|
|
5
5
|
"main": "pargras.js",
|
|
6
6
|
"directories": {
|
|
7
7
|
"test": "test"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"build": "grunt build",
|
|
11
|
+
"coverage": "nyc ./node_modules/.bin/jasmine",
|
|
12
|
+
"lint": "grunt jshint",
|
|
13
|
+
"test": "./node_modules/.bin/jasmine && npx karma start test/karma/karma.conf.js --single-run",
|
|
14
|
+
"test-node": "./node_modules/.bin/jasmine",
|
|
15
|
+
"test-browser": "npx karma start test/karma/karma.conf.js --single-run"
|
|
12
16
|
},
|
|
13
17
|
"repository": {
|
|
14
18
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/
|
|
19
|
+
"url": "https://github.com/tbillenstein/pargras.git"
|
|
16
20
|
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/tbillenstein/pargras/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/tbillenstein/pargras#readme",
|
|
17
25
|
"keywords": [
|
|
18
26
|
"function",
|
|
19
27
|
"argument",
|
|
@@ -27,9 +35,8 @@
|
|
|
27
35
|
"array",
|
|
28
36
|
"length"
|
|
29
37
|
],
|
|
30
|
-
"author": "
|
|
38
|
+
"author": "tbillenstein <tb@thomasbillenstein.com> (https://thomasbillenstein.com)",
|
|
31
39
|
"license": "MIT",
|
|
32
|
-
"homepage": "https://github.com/belexos/pargras#readme",
|
|
33
40
|
"nyc": {
|
|
34
41
|
"exclude": [
|
|
35
42
|
"**/*Spec.js"
|
|
@@ -41,10 +48,16 @@
|
|
|
41
48
|
},
|
|
42
49
|
"dependencies": {},
|
|
43
50
|
"devDependencies": {
|
|
44
|
-
"grunt": "^1.
|
|
45
|
-
"grunt-contrib-
|
|
51
|
+
"grunt": "^1.6.1",
|
|
52
|
+
"grunt-contrib-jshint": "^3.2.0",
|
|
46
53
|
"grunt-contrib-watch": "^1.1.0",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
54
|
+
"grunt-terser": "^2.0.0",
|
|
55
|
+
"jasmine": "^5.13.0",
|
|
56
|
+
"karma": "^6.4.4",
|
|
57
|
+
"karma-chrome-launcher": "^3.2.0",
|
|
58
|
+
"karma-coverage": "^2.2.1",
|
|
59
|
+
"karma-firefox-launcher": "^2.1.3",
|
|
60
|
+
"karma-jasmine": "^5.1.0",
|
|
61
|
+
"nyc": "^17.1.0"
|
|
49
62
|
}
|
|
50
63
|
}
|
package/pargras.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pargras - Minimalistic helper around function arguments for Node.js and the
|
|
2
|
+
* Pargras - Minimalistic helper around function arguments for Node.js and the browser.
|
|
3
3
|
*
|
|
4
|
-
* @copyright: Copyright (c) 2016-present,
|
|
4
|
+
* @copyright: Copyright (c) 2016-present, tbillenstein
|
|
5
5
|
*
|
|
6
|
-
* @author:
|
|
6
|
+
* @author: tbillenstein <tb@thomasbillenstein.com> (https://thomasbillenstein.com)
|
|
7
7
|
*
|
|
8
8
|
* @license This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
(function(window)
|
|
13
14
|
{
|
|
14
15
|
const nodeEnv = typeof module === 'object' && module && typeof module.exports === 'object';
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
|
-
* Pargras is a minimalistic helper around function arguments for Node.js and the
|
|
28
|
+
* Pargras is a minimalistic helper around function arguments for Node.js and the browser.
|
|
28
29
|
* Pargras has a fluent interface and supports adding, removing and altering arguments
|
|
29
30
|
* before applying them to a function.
|
|
30
31
|
*
|
|
@@ -182,7 +183,7 @@
|
|
|
182
183
|
|
|
183
184
|
function isArguments(value)
|
|
184
185
|
{
|
|
185
|
-
return value != null && typeof value === 'object' && Object.prototype.hasOwnProperty.call(value, 'callee')
|
|
186
|
+
return value != null && typeof value === 'object' && Object.prototype.hasOwnProperty.call(value, 'callee');
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
})(this);
|
package/pargras.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! pargras V1.
|
|
2
|
-
!function(
|
|
1
|
+
/*! pargras V1.1.1, Copyright (c) 2016-present, tbillenstein. MIT licensed. */
|
|
2
|
+
!function(t){function n(t){"use strict";var n,r,e,o;if(null==(o=t)||"object"!=typeof o||!Object.prototype.hasOwnProperty.call(o,"callee"))throw new Error("Parameter is no arguments object");for(r=0,e=(n=new Array(t.length)).length;r<e;r++)n[r]=t[r];this.array=function(){return n},this.length=function(){return n.length},this.set=function(t,r){return t<n.length&&(n[t]=r),this},this.get=function(t){return n[t]},this.shift=function(){return n.shift(),this},this.pop=function(){return n.pop(),this},this.unshift=function(){var t;for(t=arguments.length-1;t>=0;t--)n.unshift(arguments[t]);return this},this.push=function(){var t,r=arguments.length;for(t=0;t<r;t++)n.push(arguments[t]);return this},this.applyTo=function(t,r){return t.apply(r||null,n)}}"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=n:t.Pargras=n}(this);
|