pax_global_header00006660000000000000000000000064152420230760014513gustar00rootroot0000000000000052 comment=74620fdf57c9d2809c6b0d112bb12ceaae3d7308 jonschlinkert-is-plain-object-74620fd/000077500000000000000000000000001524202307600177045ustar00rootroot00000000000000jonschlinkert-is-plain-object-74620fd/.editorconfig000066400000000000000000000004411524202307600223600ustar00rootroot00000000000000# 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 jonschlinkert-is-plain-object-74620fd/.gitattributes000066400000000000000000000001771524202307600226040ustar00rootroot00000000000000# Enforce Unix newlines * text eol=lf # binaries *.ai binary *.psd binary *.jpg binary *.gif binary *.png binary *.jpeg binaryjonschlinkert-is-plain-object-74620fd/.github/000077500000000000000000000000001524202307600212445ustar00rootroot00000000000000jonschlinkert-is-plain-object-74620fd/.github/workflows/000077500000000000000000000000001524202307600233015ustar00rootroot00000000000000jonschlinkert-is-plain-object-74620fd/.github/workflows/ci.yml000066400000000000000000000027041524202307600244220ustar00rootroot00000000000000name: CI on: push: branches: - master pull_request: jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Use Node.js 24 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '24' - name: Install dependencies run: npm install --ignore-scripts - name: Build package run: npm run build - name: Upload build uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: dist path: dist test: needs: build strategy: fail-fast: false matrix: node-version: - '0.10' - '0.12' - '20' - '22' - '24' runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: ${{ matrix.node-version }} - name: Download build uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: dist path: dist - name: Run Node.js tests run: npm test jonschlinkert-is-plain-object-74620fd/.github/workflows/release.yml000066400000000000000000000013531524202307600254460ustar00rootroot00000000000000name: Release on: release: types: - published permissions: contents: read id-token: write jobs: publish: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Use Node.js 24 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '24' registry-url: https://registry.npmjs.org - name: Use npm 11 run: npm install --global npm@11 - name: Install dependencies run: npm install - name: Run tests run: npm test - name: Publish package run: npm publish --provenance --access public jonschlinkert-is-plain-object-74620fd/.gitignore000066400000000000000000000004561524202307600217010ustar00rootroot00000000000000# always ignore files *.DS_Store *.sublime-* # test related, or directories generated by tests test/actual actual coverage .nyc* # npm node_modules npm-debug.log # yarn yarn.lock yarn-error.log # misc _gh_pages _draft _drafts bower_components vendor temp tmp TODO.md package-lock.json browser dist jonschlinkert-is-plain-object-74620fd/LICENSE000066400000000000000000000021001524202307600207020ustar00rootroot00000000000000The MIT License (MIT) 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 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. jonschlinkert-is-plain-object-74620fd/README.md000066400000000000000000000042741524202307600211720ustar00rootroot00000000000000# is-plain-object [![npm version](https://img.shields.io/npm/v/is-plain-object.svg)](https://www.npmjs.com/package/is-plain-object) [![npm downloads](https://img.shields.io/npm/dm/is-plain-object.svg)](https://www.npmjs.com/package/is-plain-object) [![CI](https://github.com/jonschlinkert/is-plain-object/actions/workflows/ci.yml/badge.svg)](https://github.com/jonschlinkert/is-plain-object/actions/workflows/ci.yml) > Returns `true` if an object was created by the `Object` constructor or with a `null` prototype. Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and starring the project to show your ❤️ and support. Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check whether a value is an object and not an array or `null`. ## Install ```sh npm install is-plain-object ``` ## Usage With ES modules: ```js import { isPlainObject } from 'is-plain-object'; isPlainObject({}); // true isPlainObject({ foo: 'bar' }); // true isPlainObject(Object.create(null)); // true isPlainObject(Object.create({})); // true isPlainObject(); // false isPlainObject(null); // false isPlainObject([]); // false isPlainObject(new Date()); // false isPlainObject(/foo/); // false isPlainObject(() => {}); // false ``` With CommonJS: ```js const { isPlainObject } = require('is-plain-object'); ``` ## API ### `isPlainObject(value)` Returns `true` when `value` is a plain object. Objects created by the `Object` constructor and objects with a `null` prototype are considered plain. ## Development Install dependencies, build the CommonJS and ES module bundles, and run the tests: ```sh npm install npm run build npm test ``` ## Related projects - [is-number](https://www.npmjs.com/package/is-number): Check if a value is a finite number. - [isobject](https://www.npmjs.com/package/isobject): Check if a 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. ## License [MIT](LICENSE) © Jon Schlinkert jonschlinkert-is-plain-object-74620fd/SECURITY.md000066400000000000000000000002011524202307600214660ustar00rootroot00000000000000# Security Policy Please report security vulnerabilities to maintainer: [opensource@trysound.io](mailto:opensource@trysound.io) jonschlinkert-is-plain-object-74620fd/is-plain-object.d.ts000066400000000000000000000003421524202307600234550ustar00rootroot00000000000000/** * Returns true if an object was created by the `Object` constructor, or Object.create(null). * * @param value The value to test */ export function isPlainObject(value: unknown): value is Record; jonschlinkert-is-plain-object-74620fd/is-plain-object.js000066400000000000000000000013431524202307600232230ustar00rootroot00000000000000/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function isObject(o) { return Object.prototype.toString.call(o) === '[object Object]'; } export function isPlainObject(o) { var ctor,prot; if (isObject(o) === false) return false; // If has modified constructor ctor = o.constructor; if (ctor === undefined) return true; // If has modified prototype prot = ctor.prototype; if (isObject(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; }; jonschlinkert-is-plain-object-74620fd/package.json000066400000000000000000000031261524202307600221740ustar00rootroot00000000000000{ "name": "is-plain-object", "description": "Returns true if an object was created by the `Object` constructor, or Object.create(null).", "version": "5.1.0", "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)", "Bogdan Chadkin (https://github.com/TrySound)" ], "repository": "jonschlinkert/is-plain-object", "bugs": { "url": "https://github.com/jonschlinkert/is-plain-object/issues" }, "license": "MIT", "main": "dist/is-plain-object.js", "module": "dist/is-plain-object.mjs", "types": "is-plain-object.d.ts", "files": [ "is-plain-object.d.ts", "dist" ], "exports": { ".": { "import": "./dist/is-plain-object.mjs", "require": "./dist/is-plain-object.js", "types": "./is-plain-object.d.ts" }, "./package.json": "./package.json" }, "engines": { "node": ">=0.10.0" }, "scripts": { "build": "rollup is-plain-object.js --format cjs --file dist/is-plain-object.js && rollup is-plain-object.js --format esm --file dist/is-plain-object.mjs", "test": "node test.js", "prepare": "npm run build" }, "devDependencies": { "rollup": "^4.62.5" }, "keywords": [ "check", "is", "is-object", "isobject", "javascript", "kind", "kind-of", "object", "plain", "type", "typeof", "value" ] } jonschlinkert-is-plain-object-74620fd/test.js000066400000000000000000000013651524202307600212260ustar00rootroot00000000000000/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Licensed under the MIT License. */ 'use strict'; var assert = require('assert'); var isPlainObject = require('./dist/is-plain-object.js').isPlainObject; function Foo() { this.abc = {}; } assert(isPlainObject(Object.create({}))); assert(isPlainObject(Object.create(Object.prototype))); assert(isPlainObject({ foo: 'bar' })); assert(isPlainObject({})); assert(isPlainObject(Object.create(null))); assert(!isPlainObject(/foo/)); assert(!isPlainObject(function() {})); assert(!isPlainObject(1)); assert(!isPlainObject(['foo', 'bar'])); assert(!isPlainObject([])); assert(!isPlainObject(new Foo())); assert(!isPlainObject(null));