[Pkg-javascript-commits] [node-is-plain-object] 02/06: New upstream version 2.0.4+dfsg
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Thu Jan 11 07:09:29 UTC 2018
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository node-is-plain-object.
commit 874ecec237738ba2896db8f86b74e01c63314a6f
Author: Pirate Praveen <praveen at debian.org>
Date: Thu Jan 11 12:02:02 2018 +0530
New upstream version 2.0.4+dfsg
---
.editorconfig | 14 +++++++
.eslintrc.json | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.gitignore | 69 +++++++++++-----------------------
.jshintrc | 18 ---------
.travis.yml | 15 ++++++--
.verb.md | 24 ------------
LICENSE | 2 +-
README.md | 68 +++++++++++++++++++++------------
bower.json | 56 +++++++++++++++++++--------
index.d.ts | 5 +++
index.js | 14 +++----
package.json | 60 +++++++++++++++++++++--------
test/server.js | 32 ++++++++--------
13 files changed, 323 insertions(+), 171 deletions(-)
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..449f0da
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,14 @@
+# http://editorconfig.org/
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 2
+indent_style = space
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[{**/{actual,fixtures,expected,templates}/**,*.md}]
+trim_trailing_whitespace = false
+insert_final_newline = false
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..61e8895
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,117 @@
+{
+ "env": {
+ "browser": false,
+ "es6": true,
+ "node": true,
+ "mocha": true
+ },
+
+ "globals": {
+ "document": false,
+ "navigator": false,
+ "window": false
+ },
+
+ "rules": {
+ "accessor-pairs": 2,
+ "arrow-spacing": [2, { "before": true, "after": true }],
+ "block-spacing": [2, "always"],
+ "brace-style": [2, "1tbs", { "allowSingleLine": true }],
+ "comma-dangle": [2, "never"],
+ "comma-spacing": [2, { "before": false, "after": true }],
+ "comma-style": [2, "last"],
+ "constructor-super": 2,
+ "curly": [2, "multi-line"],
+ "dot-location": [2, "property"],
+ "eol-last": 2,
+ "eqeqeq": [2, "allow-null"],
+ "generator-star-spacing": [2, { "before": true, "after": true }],
+ "handle-callback-err": [2, "^(err|error)$" ],
+ "indent": [2, 2, { "SwitchCase": 1 }],
+ "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
+ "keyword-spacing": [2, { "before": true, "after": true }],
+ "new-cap": [2, { "newIsCap": true, "capIsNew": false }],
+ "new-parens": 2,
+ "no-array-constructor": 2,
+ "no-caller": 2,
+ "no-class-assign": 2,
+ "no-cond-assign": 2,
+ "no-const-assign": 2,
+ "no-control-regex": 2,
+ "no-debugger": 2,
+ "no-delete-var": 2,
+ "no-dupe-args": 2,
+ "no-dupe-class-members": 2,
+ "no-dupe-keys": 2,
+ "no-duplicate-case": 2,
+ "no-empty-character-class": 2,
+ "no-eval": 2,
+ "no-ex-assign": 2,
+ "no-extend-native": 2,
+ "no-extra-bind": 2,
+ "no-extra-boolean-cast": 2,
+ "no-extra-parens": [2, "functions"],
+ "no-fallthrough": 2,
+ "no-floating-decimal": 2,
+ "no-func-assign": 2,
+ "no-implied-eval": 2,
+ "no-inner-declarations": [2, "functions"],
+ "no-invalid-regexp": 2,
+ "no-irregular-whitespace": 2,
+ "no-iterator": 2,
+ "no-label-var": 2,
+ "no-labels": 2,
+ "no-lone-blocks": 2,
+ "no-mixed-spaces-and-tabs": 2,
+ "no-multi-spaces": 2,
+ "no-multi-str": 2,
+ "no-multiple-empty-lines": [2, { "max": 1 }],
+ "no-native-reassign": 0,
+ "no-negated-in-lhs": 2,
+ "no-new": 2,
+ "no-new-func": 2,
+ "no-new-object": 2,
+ "no-new-require": 2,
+ "no-new-wrappers": 2,
+ "no-obj-calls": 2,
+ "no-octal": 2,
+ "no-octal-escape": 2,
+ "no-proto": 0,
+ "no-redeclare": 2,
+ "no-regex-spaces": 2,
+ "no-return-assign": 2,
+ "no-self-compare": 2,
+ "no-sequences": 2,
+ "no-shadow-restricted-names": 2,
+ "no-spaced-func": 2,
+ "no-sparse-arrays": 2,
+ "no-this-before-super": 2,
+ "no-throw-literal": 2,
+ "no-trailing-spaces": 0,
+ "no-undef": 2,
+ "no-undef-init": 2,
+ "no-unexpected-multiline": 2,
+ "no-unneeded-ternary": [2, { "defaultAssignment": false }],
+ "no-unreachable": 2,
+ "no-unused-vars": [2, { "vars": "all", "args": "none" }],
+ "no-useless-call": 0,
+ "no-with": 2,
+ "one-var": [0, { "initialized": "never" }],
+ "operator-linebreak": [0, "after", { "overrides": { "?": "before", ":": "before" } }],
+ "padded-blocks": [0, "never"],
+ "quotes": [2, "single", "avoid-escape"],
+ "radix": 2,
+ "semi": [2, "always"],
+ "semi-spacing": [2, { "before": false, "after": true }],
+ "space-before-blocks": [2, "always"],
+ "space-before-function-paren": [2, "never"],
+ "space-in-parens": [2, "never"],
+ "space-infix-ops": 2,
+ "space-unary-ops": [2, { "words": true, "nonwords": false }],
+ "spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
+ "use-isnan": 2,
+ "valid-typeof": 2,
+ "wrap-iife": [2, "any"],
+ "yoda": [2, "never"]
+ }
+}
diff --git a/.gitignore b/.gitignore
index 92139bd..f2a4ab2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,53 +1,28 @@
-# Numerous always-ignore extensions
+# always ignore files
*.DS_Store
-*.csv
-*.dat
-*.diff
-*.err
-*.gz
-*.log
-*.orig
-*.out
-*.pid
-*.rar
-*.rej
-*.seed
-*.swo
-*.swp
-*.vi
-*.yo-rc.json
-*.zip
-*~
-.ruby-version
-lib-cov
-npm-debug.log
+*.sublime-*
-# Always-ignore dirs
-/bower_components/
-/node_modules/
-/temp/
-/tmp/
-/vendor/
-_gh_pages
+# test related, or directories generated by tests
+test/actual
+actual
+coverage
+.nyc*
-# OS or Editor folders
-*.esproj
-*.komodoproject
-.komodotools
-*.sublime-*
-._*
-.cache
-.DS_Store
-.idea
-.project
-.settings
-.tmproj
-nbproject
-Thumbs.db
+# npm
+node_modules
+npm-debug.log
-# grunt-html-validation
-validation-status.json
-validation-report.json
+# yarn
+yarn.lock
+yarn-error.log
# misc
-TODO.md
\ No newline at end of file
+_gh_pages
+_draft
+_drafts
+bower_components
+vendor
+temp
+tmp
+TODO.md
+package-lock.json
\ No newline at end of file
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 6e5a84a..0000000
--- a/.jshintrc
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "asi": false,
- "boss": true,
- "curly": true,
- "eqeqeq": true,
- "eqnull": true,
- "esnext": true,
- "immed": true,
- "latedef": false,
- "laxcomma": false,
- "mocha": true,
- "newcap": true,
- "noarg": true,
- "node": true,
- "sub": true,
- "undef": true,
- "unused": true
-}
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index f9cffe6..699a13f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,17 @@
sudo: false
+os:
+ - linux
+ - osx
language: node_js
node_js:
- - "0.10"
- - "0.12"
- - "iojs"
+ - node
+ - iojs
+ - '8'
+ - '7'
+ - '6'
+ - '5'
+ - '4'
+ - '0.12'
+ - '0.10'
git:
depth: 10
diff --git a/.verb.md b/.verb.md
index 0ff58ee..e52f0f5 100644
--- a/.verb.md
+++ b/.verb.md
@@ -1,12 +1,5 @@
-# {%= name %} {%= badge("fury") %}
-
-> {%= description %}
-
Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check if the value is an object and not an array or null.
-## Install
-{%= include("install-npm", {save: true}) %}
-
## Usage
```js
@@ -42,20 +35,3 @@ isPlainObject(null);
isPlainObject(Object.create(null));
//=> false
```
-
-## Related projects
-{%= related(['is-plain-object', 'kind-of', 'for-own', 'extend-shallow', 'isobject', 'for-in', 'assign-deep', 'merge-deep']) %}
-
-## Running tests
-{%= include("tests") %}
-
-## Author
-{%= include("author") %}
-
-## License
-{%= copyright() %}
-{%= license() %}
-
-***
-
-{%= include("footer") %}
diff --git a/LICENSE b/LICENSE
index 317b8ac..3f2eca1 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014-2015, object Object.
+Copyright (c) 2014-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 1847a7d..1f9d0c8 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,17 @@
-# is-plain-object [![NPM version](https://badge.fury.io/js/is-plain-object.svg)](http://badge.fury.io/js/is-plain-object)
+# is-plain-object [![NPM version](https://img.shields.io/npm/v/is-plain-object.svg?style=flat)](https://www.npmjs.com/package/is-plain-object) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![NPM total downloads](https://img.shields.io/npm/dt/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-plain-object.svg? [...]
> Returns true if an object was created by the `Object` constructor.
-Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check if the value is an object and not an array or null.
-
## Install
-Install with [npm](https://www.npmjs.com/)
+Install with [npm](https://www.npmjs.com/):
```sh
-$ npm i is-plain-object --save
+$ npm install --save is-plain-object
```
+Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check if the value is an object and not an array or null.
+
## Usage
```js
@@ -48,37 +48,57 @@ isPlainObject(Object.create(null));
//=> false
```
-## Related projects
+## About
+
+### Related projects
+
+* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.")
+* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
+* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
-* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object.
-* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
-* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own)
-* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in)
-* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
-* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
-* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
-* [merge-deep](https://github.com/jonschlinkert/merge-deep): Recursively merge values in a javascript object.
+### Contributors
+
+| **Commits** | **Contributor** |
+| --- | --- |
+| 17 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 6 | [stevenvachon](https://github.com/stevenvachon) |
+| 3 | [onokumus](https://github.com/onokumus) |
+| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
+
+### Building docs
+
+_(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.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
-## Running tests
+### Running tests
-Install dev dependencies:
+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:
```sh
-$ npm i -d && npm test
+$ npm install && npm test
```
-## Author
+### Author
**Jon Schlinkert**
-+ [github/jonschlinkert](https://github.com/jonschlinkert)
-+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
-## License
+### License
-Copyright © 2015 Jon Schlinkert
-Released under the MIT license.
+Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
***
-_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on May 28, 2015._
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 11, 2017._
\ No newline at end of file
diff --git a/bower.json b/bower.json
index 633b9a5..714967f 100644
--- a/bower.json
+++ b/bower.json
@@ -11,29 +11,55 @@
"index.js"
],
"dependencies": {
- "isobject": "^1.0.0"
+ "isobject": "^3.0.0"
},
"devDependencies": {
- "browserify": "*",
- "chai": "*",
- "mocha": "*",
- "mocha-phantomjs": "*",
- "phantomjs": "*",
- "uglify-js": "*"
+ "browserify": "^14.3.0",
+ "chai": "^4.0.0",
+ "gulp-format-md": "^0.1.12",
+ "mocha": "^3.4.2",
+ "mocha-phantomjs": "^4.1.0",
+ "phantomjs": "^2.1.7",
+ "uglify-js": "^3.0.12"
},
"keywords": [
- "object",
+ "check",
"is",
"is-object",
"isobject",
- "plain",
- "value",
- "type",
+ "javascript",
"kind",
"kind-of",
+ "object",
+ "plain",
+ "type",
"typeof",
- "javascript",
- "check",
- "type"
- ]
+ "value"
+ ],
+ "version": "2.0.3",
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/is-plain-object/issues"
+ },
+ "files": [
+ "index.d.ts",
+ "index.js"
+ ],
+ "ignore": [
+ "actual",
+ "bower_components",
+ "fixtures",
+ "node_modules",
+ "temp",
+ "test",
+ "test.js",
+ "tmp"
+ ],
+ "contributors": [
+ "(https://github.com/wtgtybhertgeghgtwtg)",
+ "Jon Schlinkert (http://twitter.com/jonschlinkert)",
+ "Osman Nuri Okumuş (http://onokumus.com)",
+ "Steven Vachon (https://svachon.com)"
+ ],
+ "types": "index.d.ts",
+ "typings": "index.d.ts"
}
\ No newline at end of file
diff --git a/index.d.ts b/index.d.ts
new file mode 100644
index 0000000..74a44e9
--- /dev/null
+++ b/index.d.ts
@@ -0,0 +1,5 @@
+export = isPlainObject;
+
+declare function isPlainObject(o: any): boolean;
+
+declare namespace isPlainObject {}
diff --git a/index.js b/index.js
index 69b95c1..c328484 100644
--- a/index.js
+++ b/index.js
@@ -1,8 +1,8 @@
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
- * Copyright (c) 2014-2015, Jon Schlinkert.
- * Licensed under the MIT License.
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
*/
'use strict';
@@ -16,22 +16,22 @@ function isObjectObject(o) {
module.exports = function isPlainObject(o) {
var ctor,prot;
-
+
if (isObjectObject(o) === false) return false;
-
+
// If has modified constructor
ctor = o.constructor;
if (typeof ctor !== 'function') return false;
-
+
// If has modified prototype
prot = ctor.prototype;
if (isObjectObject(prot) === false) return false;
-
+
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}
-
+
// Most likely a plain Object
return true;
};
diff --git a/package.json b/package.json
index f86398f..dd60498 100644
--- a/package.json
+++ b/package.json
@@ -1,15 +1,22 @@
{
"name": "is-plain-object",
"description": "Returns true if an object was created by the `Object` constructor.",
- "version": "2.0.1",
+ "version": "2.0.4",
"homepage": "https://github.com/jonschlinkert/is-plain-object",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "contributors": [
+ "Jon Schlinkert (http://twitter.com/jonschlinkert)",
+ "Osman Nuri Okumuş (http://onokumus.com)",
+ "Steven Vachon (https://svachon.com)",
+ "(https://github.com/wtgtybhertgeghgtwtg)"
+ ],
"repository": "jonschlinkert/is-plain-object",
"bugs": {
"url": "https://github.com/jonschlinkert/is-plain-object/issues"
},
"license": "MIT",
"files": [
+ "index.d.ts",
"index.js"
],
"main": "index.js",
@@ -23,29 +30,50 @@
"test": "npm run test_node && npm run browserify && npm run test_browser"
},
"dependencies": {
- "isobject": "^1.0.0"
+ "isobject": "^3.0.1"
},
"devDependencies": {
- "browserify": "*",
- "chai": "*",
- "mocha": "*",
- "mocha-phantomjs": "*",
- "phantomjs": "*",
- "uglify-js": "*"
+ "browserify": "^14.4.0",
+ "chai": "^4.0.2",
+ "gulp-format-md": "^1.0.0",
+ "mocha": "^3.4.2",
+ "mocha-phantomjs": "^4.1.0",
+ "phantomjs": "^2.1.7",
+ "uglify-js": "^3.0.24"
},
"keywords": [
- "object",
+ "check",
"is",
"is-object",
"isobject",
- "plain",
- "value",
- "type",
+ "javascript",
"kind",
"kind-of",
+ "object",
+ "plain",
+ "type",
"typeof",
- "javascript",
- "check",
- "type"
- ]
+ "value"
+ ],
+ "types": "index.d.ts",
+ "verb": {
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "related": {
+ "list": [
+ "is-number",
+ "isobject",
+ "kind-of"
+ ]
+ },
+ "lint": {
+ "reflinks": true
+ }
+ }
}
diff --git a/test/server.js b/test/server.js
index 74e3dee..6a45b52 100644
--- a/test/server.js
+++ b/test/server.js
@@ -1,34 +1,34 @@
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
- * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Copyright (c) 2014-2017, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
-/* deps:mocha */
-var expect = require('chai').expect;
-var isPlainObject = require('../');
+require('mocha');
+var assert = require('assert');
+var isPlainObject = require('..');
describe('Same-Realm Server Tests', function() {
it('should return `true` if the object is created by the `Object` constructor.', function() {
- expect( isPlainObject(Object.create({})) ).to.be.true;
- expect( isPlainObject(Object.create(Object.prototype)) ).to.be.true;
- expect( isPlainObject({foo: 'bar'}) ).to.be.true;
- expect( isPlainObject({}) ).to.be.true;
+ assert(isPlainObject(Object.create({})));
+ assert(isPlainObject(Object.create(Object.prototype)));
+ assert(isPlainObject({foo: 'bar'}));
+ assert(isPlainObject({}));
});
it('should return `false` if the object is not created by the `Object` constructor.', function() {
function Foo() {this.abc = {};};
- expect( isPlainObject(/foo/) ).to.be.false;
- expect( isPlainObject(function () {}) ).to.be.false;
- expect( isPlainObject(1) ).to.be.false;
- expect( isPlainObject(['foo', 'bar']) ).to.be.false;
- expect( isPlainObject([]) ).to.be.false;
- expect( isPlainObject(new Foo) ).to.be.false;
- expect( isPlainObject(null) ).to.be.false;
- expect( isPlainObject(Object.create(null)) ).to.be.false;
+ assert(!isPlainObject(/foo/));
+ assert(!isPlainObject(function() {}));
+ assert(!isPlainObject(1));
+ assert(!isPlainObject(['foo', 'bar']));
+ assert(!isPlainObject([]));
+ assert(!isPlainObject(new Foo));
+ assert(!isPlainObject(null));
+ assert(!isPlainObject(Object.create(null)));
});
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-is-plain-object.git
More information about the Pkg-javascript-commits
mailing list