pax_global_header00006660000000000000000000000064126166210070014513gustar00rootroot0000000000000052 comment=b687098cc30d85bbec07f1633dee4c2d6acb1aa5 is-plain-obj-1.1.0/000077500000000000000000000000001261662100700137765ustar00rootroot00000000000000is-plain-obj-1.1.0/.editorconfig000066400000000000000000000003471261662100700164570ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,*.yml}] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false is-plain-obj-1.1.0/.gitattributes000066400000000000000000000000141261662100700166640ustar00rootroot00000000000000* text=auto is-plain-obj-1.1.0/.gitignore000066400000000000000000000000151261662100700157620ustar00rootroot00000000000000node_modules is-plain-obj-1.1.0/.jshintrc000066400000000000000000000002521261662100700156220ustar00rootroot00000000000000{ "node": true, "esnext": true, "bitwise": true, "curly": true, "immed": true, "newcap": true, "noarg": true, "undef": true, "unused": "vars", "strict": true } is-plain-obj-1.1.0/.travis.yml000066400000000000000000000001101261662100700160770ustar00rootroot00000000000000sudo: false language: node_js node_js: - 'iojs' - '0.12' - '0.10' is-plain-obj-1.1.0/index.js000066400000000000000000000004051261662100700154420ustar00rootroot00000000000000'use strict'; var toString = Object.prototype.toString; module.exports = function (x) { var prototype; return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); }; is-plain-obj-1.1.0/license000066400000000000000000000021371261662100700153460ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. is-plain-obj-1.1.0/package.json000066400000000000000000000011341261662100700162630ustar00rootroot00000000000000{ "name": "is-plain-obj", "version": "1.1.0", "description": "Check if a value is a plain object", "license": "MIT", "repository": "sindresorhus/is-plain-obj", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "node test.js" }, "files": [ "index.js" ], "keywords": [ "obj", "object", "is", "check", "test", "type", "plain", "vanilla", "pure", "simple" ], "devDependencies": { "ava": "0.0.4" } } is-plain-obj-1.1.0/readme.md000066400000000000000000000011671261662100700155620ustar00rootroot00000000000000# is-plain-obj [![Build Status](https://travis-ci.org/sindresorhus/is-plain-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-plain-obj) > Check if a value is a plain object An object is plain if it's created by either `{}`, `new Object()` or `Object.create(null)`. ## Install ``` $ npm install --save is-plain-obj ``` ## Usage ```js var isPlainObj = require('is-plain-obj'); isPlainObj({foo: 'bar'}); //=> true isPlainObj([1, 2, 3]); //=> false ``` ## Related - [is-obj](https://github.com/sindresorhus/is-obj) - Check if a value is an object ## License MIT © [Sindre Sorhus](http://sindresorhus.com) is-plain-obj-1.1.0/test.js000066400000000000000000000014671261662100700153230ustar00rootroot00000000000000'use strict'; var test = require('ava'); var fn = require('./'); function Foo(x) { this.x = 1; } function ObjectConstructor() { } ObjectConstructor.prototype.constructor = Object; test(function (t) { t.assert(fn({})); t.assert(fn({foo: true})); t.assert(fn({constructor: Foo})); t.assert(fn({valueOf: 0})); t.assert(fn(Object.create(null))); t.assert(fn(new Object())); t.assert(!fn(arguments)); t.assert(!fn(['foo', 'bar'])); t.assert(!fn(new Foo(1))); t.assert(!fn(Math)); t.assert(!fn(Error)); t.assert(!fn(function () {})); t.assert(!fn(/./)); t.assert(!fn(null)); t.assert(!fn(undefined)); t.assert(!fn(NaN)); t.assert(!fn('')); t.assert(!fn(0)); t.assert(!fn(false)); t.assert(!fn(new ObjectConstructor())); var foo = new Foo(); foo.constructor = Object; t.assert(!fn(foo)); t.end(); });