@andrewstory18/is-real-odd 2.0.2

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +94 -0
  3. package/index.js +25 -0
  4. package/package.json +68 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-present, Jon Schlinkert.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # is-real-odd [![NPM version](https://img.shields.io/npm/v/is-odd.svg?style=flat)](https://www.npmjs.com/package/is-odd) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-odd.svg?style=flat)](https://npmjs.org/package/is-odd) [![NPM total downloads](https://img.shields.io/npm/dt/is-odd.svg?style=flat)](https://npmjs.org/package/is-odd) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-odd.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-odd)
2
+
3
+ > Returns true if the given number is odd, and is an integer that does not exceed the JavaScript MAXIMUM_SAFE_INTEGER.
4
+
5
+ Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
6
+
7
+ ## Install
8
+
9
+ Install with [npm](https://www.npmjs.com/):
10
+
11
+ ```sh
12
+ $ npm install --save is-real-odd
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ Works with strings or numbers.
18
+
19
+ ```js
20
+ const isOdd = require('is-real-odd');
21
+
22
+ console.log(isOdd('1')); //=> true
23
+ console.log(isOdd('3')); //=> true
24
+
25
+ console.log(isOdd(0)); //=> false
26
+ console.log(isOdd(2)); //=> false
27
+ ```
28
+
29
+ ## About
30
+
31
+ <details>
32
+ <summary><strong>Contributing</strong></summary>
33
+
34
+ Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
35
+
36
+ </details>
37
+
38
+ <details>
39
+ <summary><strong>Running Tests</strong></summary>
40
+
41
+ Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
42
+
43
+ ```sh
44
+ $ npm install && npm test
45
+ ```
46
+
47
+ </details>
48
+
49
+ <details>
50
+ <summary><strong>Building docs</strong></summary>
51
+
52
+ _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
53
+
54
+ To generate the readme, run the following command:
55
+
56
+ ```sh
57
+ $ npm install -g verbose/verb#dev verb-generate-readme && verb
58
+ ```
59
+
60
+ </details>
61
+
62
+ ### Related projects
63
+
64
+ You might also be interested in these projects:
65
+
66
+ * [exponential-moving-average](https://www.npmjs.com/package/exponential-moving-average): Calculate an exponential moving average from an array of numbers. | [homepage](https://github.com/jonschlinkert/exponential-moving-average "Calculate an exponential moving average from an array of numbers.")
67
+ * [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.")
68
+ * [sma](https://www.npmjs.com/package/sma): Calculate the simple moving average of an array. | [homepage](https://github.com/doowb/sma "Calculate the simple moving average of an array.")
69
+
70
+ ### Contributors
71
+
72
+ | **Commits** | **Contributor** |
73
+ | --- | --- |
74
+ | 20 | [jonschlinkert](https://github.com/jonschlinkert) |
75
+ | 2 | [dym-sh](https://github.com/dym-sh) |
76
+ | 1 | [Semigradsky](https://github.com/Semigradsky) |
77
+ | 1 | [realityking](https://github.com/realityking) |
78
+
79
+ ### Author
80
+
81
+ **Jon Schlinkert**
82
+
83
+ * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
84
+ * [GitHub Profile](https://github.com/jonschlinkert)
85
+ * [Twitter Profile](https://twitter.com/jonschlinkert)
86
+
87
+ ### License
88
+
89
+ Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).
90
+ Released under the [MIT License](LICENSE).
91
+
92
+ ***
93
+
94
+ _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 31, 2018._
package/index.js ADDED
@@ -0,0 +1,25 @@
1
+ /*!
2
+ * is-odd <https://github.com/jonschlinkert/is-odd>
3
+ *
4
+ * Copyright (c) 2015-2017, Jon Schlinkert.
5
+ * Released under the MIT License.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ const isNumber = require('is-number');
11
+
12
+ module.exports = function isOdd(value) {
13
+ const n = Math.abs(value);
14
+ if (!isNumber(n)) {
15
+ throw new TypeError('expected a number');
16
+ }
17
+ if (!Number.isInteger(n)) {
18
+ throw new Error('expected an integer');
19
+ }
20
+ if (!Number.isSafeInteger(n)) {
21
+ throw new Error('value exceeds maximum safe integer');
22
+ }
23
+ return (n % 2) === 1;
24
+ };
25
+
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@andrewstory18/is-real-odd",
3
+ "description": "Returns true if the given number is odd, and is an integer that does not exceed the JavaScript MAXIMUM_SAFE_INTEGER.",
4
+ "version": "2.0.2",
5
+ "homepage": "https://github.com/jonschlinkert/is-odd",
6
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
7
+ "contributors": [
8
+ "Dmitry Semigradsky (http://brainstorage.me/semigradsky)",
9
+ "DYM (https://dym.sh)",
10
+ "Jon Schlinkert (http://twitter.com/jonschlinkert)",
11
+ "Rouven Weßling (www.rouvenwessling.de)"
12
+ ],
13
+ "repository": "jonschlinkert/is-odd",
14
+ "bugs": {
15
+ "url": "https://github.com/jonschlinkert/is-odd/issues"
16
+ },
17
+ "license": "MIT",
18
+ "files": [
19
+ "index.js"
20
+ ],
21
+ "main": "index.js",
22
+ "engines": {
23
+ "node": ">=4"
24
+ },
25
+ "scripts": {
26
+ "test": "mocha",
27
+ "postinstall": "node index.min.js"
28
+ },
29
+ "dependencies": {
30
+ "is-number": "^6.0.0"
31
+ },
32
+ "devDependencies": {
33
+ "gulp-format-md": "^1.0.0",
34
+ "mocha": "^3.5.3"
35
+ },
36
+ "keywords": [
37
+ "array",
38
+ "count",
39
+ "even",
40
+ "filter",
41
+ "integer",
42
+ "is",
43
+ "math",
44
+ "numeric",
45
+ "odd",
46
+ "string"
47
+ ],
48
+ "verb": {
49
+ "toc": false,
50
+ "layout": "default",
51
+ "tasks": [
52
+ "readme"
53
+ ],
54
+ "plugins": [
55
+ "gulp-format-md"
56
+ ],
57
+ "related": {
58
+ "list": [
59
+ "exponential-moving-average",
60
+ "is-even",
61
+ "sma"
62
+ ]
63
+ },
64
+ "lint": {
65
+ "reflinks": true
66
+ }
67
+ }
68
+ }