pax_global_header00006660000000000000000000000064152040652210014507gustar00rootroot0000000000000052 comment=9e62644a85743af8a51d3e276bc40c3cd4cafcd1 es-shims-es-object-atoms-4b1aa02/000077500000000000000000000000001520406522100166255ustar00rootroot00000000000000es-shims-es-object-atoms-4b1aa02/.eslintrc000066400000000000000000000003451520406522100204530ustar00rootroot00000000000000{ "root": true, "extends": "@ljharb", "rules": { "eqeqeq": ["error", "allow-null"], "id-length": "off", "new-cap": ["error", { "capIsNewExceptions": [ "RequireObjectCoercible", "ToObject", ], }], }, } es-shims-es-object-atoms-4b1aa02/.github/000077500000000000000000000000001520406522100201655ustar00rootroot00000000000000es-shims-es-object-atoms-4b1aa02/.github/FUNDING.yml000066400000000000000000000010531520406522100220010ustar00rootroot00000000000000# These are supported funding model platforms github: [ljharb] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: npm/es-object community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with a single custom sponsorship URL es-shims-es-object-atoms-4b1aa02/.github/workflows/000077500000000000000000000000001520406522100222225ustar00rootroot00000000000000es-shims-es-object-atoms-4b1aa02/.github/workflows/node-aught.yml000066400000000000000000000004131520406522100247760ustar00rootroot00000000000000name: 'Tests: node.js < 10' on: [pull_request, push] permissions: contents: read jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: range: '< 10' type: minors command: npm run tests-only skip-ls-check: true es-shims-es-object-atoms-4b1aa02/.github/workflows/node-pretest.yml000066400000000000000000000002451520406522100253570ustar00rootroot00000000000000name: 'Tests: pretest/posttest' on: [pull_request, push] permissions: contents: read jobs: tests: uses: ljharb/actions/.github/workflows/pretest.yml@main es-shims-es-object-atoms-4b1aa02/.github/workflows/node-tens.yml000066400000000000000000000003631520406522100246430ustar00rootroot00000000000000name: 'Tests: node.js >= 10' on: [pull_request, push] permissions: contents: read jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: range: '>= 10' type: minors command: npm run tests-only es-shims-es-object-atoms-4b1aa02/.github/workflows/rebase.yml000066400000000000000000000002571520406522100242120ustar00rootroot00000000000000name: Automatic Rebase on: [pull_request_target] jobs: _: uses: ljharb/actions/.github/workflows/rebase.yml@main secrets: token: ${{ secrets.GITHUB_TOKEN }} es-shims-es-object-atoms-4b1aa02/.github/workflows/require-allow-edits.yml000066400000000000000000000005151520406522100266440ustar00rootroot00000000000000name: Require “Allow Edits” on: [pull_request_target] permissions: contents: read jobs: _: permissions: pull-requests: read # for ljharb/require-allow-edits to check 'allow edits' on PR name: "Require “Allow Edits”" runs-on: ubuntu-latest steps: - uses: ljharb/require-allow-edits@main es-shims-es-object-atoms-4b1aa02/.gitignore000066400000000000000000000041361520406522100206210ustar00rootroot00000000000000# Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* .pnpm-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage *.lcov # nyc test coverage .nyc_output # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # Snowpack dependency directory (https://snowpack.dev/) web_modules/ # TypeScript cache *.tsbuildinfo # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional stylelint cache .stylelintcache # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ .rts2_cache_es/ .rts2_cache_umd/ # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variable files .env .env.development.local .env.test.local .env.production.local .env.local # parcel-bundler cache (https://parceljs.org/) .cache .parcel-cache # Next.js build output .next out # Nuxt.js build / generate output .nuxt dist # Gatsby files .cache/ # Comment in the public line in if your project uses Gatsby and not Next.js # https://nextjs.org/blog/next-9-1#public-directory-support # public # vuepress build output .vuepress/dist # vuepress v2.x temp and cache directory .temp .cache # Docusaurus cache and generated files .docusaurus # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ # TernJS port file .tern-port # Stores VSCode versions used for testing VSCode extensions .vscode-test # yarn v2 .yarn/cache .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz .pnp.* # Only apps should have lockfiles npm-shrinkwrap.json package-lock.json yarn.lock .npmignore es-shims-es-object-atoms-4b1aa02/.npmrc000066400000000000000000000000671520406522100177500ustar00rootroot00000000000000package-lock=false allow-same-version=true message=v%s es-shims-es-object-atoms-4b1aa02/CHANGELOG.md000066400000000000000000000050761520406522100204460ustar00rootroot00000000000000# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v1.1.2](https://github.com/es-shims/es-object-atoms/compare/v1.1.1...v1.1.2) - 2026-05-22 ### Commits - [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `auto-changelog`, `eslint`, `npmignore` [`41e3d94`](https://github.com/es-shims/es-object-atoms/commit/41e3d94f6b49237fa490ec598e068f170c8b161e) - [types] improve `isObject` type [`758edc2`](https://github.com/es-shims/es-object-atoms/commit/758edc2280fa6993a294a55957a43cee5951bf51) ## [v1.1.1](https://github.com/es-shims/es-object-atoms/compare/v1.1.0...v1.1.1) - 2025-01-14 ### Commits - [types] `ToObject`: improve types [`cfe8c8a`](https://github.com/es-shims/es-object-atoms/commit/cfe8c8a105c44820cb22e26f62d12ef0ad9715c8) ## [v1.1.0](https://github.com/es-shims/es-object-atoms/compare/v1.0.1...v1.1.0) - 2025-01-14 ### Commits - [New] add `isObject` [`51e4042`](https://github.com/es-shims/es-object-atoms/commit/51e4042df722eb3165f40dc5f4bf33d0197ecb07) ## [v1.0.1](https://github.com/es-shims/es-object-atoms/compare/v1.0.0...v1.0.1) - 2025-01-13 ### Commits - [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `tape` [`38ab9eb`](https://github.com/es-shims/es-object-atoms/commit/38ab9eb00b62c2f4668644f5e513d9b414ebd595) - [types] improve types [`7d1beb8`](https://github.com/es-shims/es-object-atoms/commit/7d1beb887958b78b6a728a210a1c8370ab7e2aa1) - [Tests] replace `aud` with `npm audit` [`25863ba`](https://github.com/es-shims/es-object-atoms/commit/25863baf99178f1d1ad33d1120498db28631907e) - [Dev Deps] add missing peer dep [`c012309`](https://github.com/es-shims/es-object-atoms/commit/c0123091287e6132d6f4240496340c427433df28) ## v1.0.0 - 2024-03-16 ### Commits - Initial implementation, tests, readme, types [`f1499db`](https://github.com/es-shims/es-object-atoms/commit/f1499db7d3e1741e64979c61d645ab3137705e82) - Initial commit [`99eedc7`](https://github.com/es-shims/es-object-atoms/commit/99eedc7b5fde38a50a28d3c8b724706e3e4c5f6a) - [meta] rename repo [`fc851fa`](https://github.com/es-shims/es-object-atoms/commit/fc851fa70616d2d182aaf0bd02c2ed7084dea8fa) - npm init [`b909377`](https://github.com/es-shims/es-object-atoms/commit/b909377c50049bd0ec575562d20b0f9ebae8947f) - Only apps should have lockfiles [`7249edd`](https://github.com/es-shims/es-object-atoms/commit/7249edd2178c1b9ddfc66ffcc6d07fdf0d28efc1) es-shims-es-object-atoms-4b1aa02/LICENSE000066400000000000000000000020571520406522100176360ustar00rootroot00000000000000MIT License Copyright (c) 2024 Jordan Harband 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. es-shims-es-object-atoms-4b1aa02/README.md000066400000000000000000000050531520406522100201070ustar00rootroot00000000000000# es-object-atoms [![Version Badge][npm-version-svg]][package-url] [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] ES Object-related atoms: Object, ToObject, RequireObjectCoercible. ## Example ```js const assert = require('assert'); const $Object = require('es-object-atoms'); const isObject = require('es-object-atoms/isObject'); const ToObject = require('es-object-atoms/ToObject'); const RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible'); assert.equal($Object, Object); assert.throws(() => ToObject(null), TypeError); assert.throws(() => ToObject(undefined), TypeError); assert.throws(() => RequireObjectCoercible(null), TypeError); assert.throws(() => RequireObjectCoercible(undefined), TypeError); assert.equal(isObject(undefined), false); assert.equal(isObject(null), false); assert.equal(isObject({}), true); assert.equal(isObject([]), true); assert.equal(isObject(function () {}), true); assert.deepEqual(RequireObjectCoercible(true), true); assert.deepEqual(ToObject(true), Object(true)); const obj = {}; assert.equal(RequireObjectCoercible(obj), obj); assert.equal(ToObject(obj), obj); ``` ## Tests Simply clone the repo, `npm install`, and run `npm test` ## Security Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. [package-url]: https://npmjs.org/package/es-object-atoms [npm-version-svg]: https://versionbadg.es/ljharb/es-object-atoms.svg [deps-svg]: https://david-dm.org/ljharb/es-object-atoms.svg [deps-url]: https://david-dm.org/ljharb/es-object-atoms [dev-deps-svg]: https://david-dm.org/ljharb/es-object-atoms/dev-status.svg [dev-deps-url]: https://david-dm.org/ljharb/es-object-atoms#info=devDependencies [npm-badge-png]: https://nodei.co/npm/es-object-atoms.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/es-object-atoms.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/es-object.svg [downloads-url]: https://npm-stat.com/charts.html?package=es-object-atoms [codecov-image]: https://codecov.io/gh/ljharb/es-object-atoms/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/ljharb/es-object-atoms/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-object-atoms [actions-url]: https://github.com/ljharb/es-object-atoms/actions es-shims-es-object-atoms-4b1aa02/RequireObjectCoercible.d.ts000066400000000000000000000001731520406522100237730ustar00rootroot00000000000000declare function RequireObjectCoercible(value: T, optMessage?: string): T; export = RequireObjectCoercible; es-shims-es-object-atoms-4b1aa02/RequireObjectCoercible.js000066400000000000000000000004711520406522100235400ustar00rootroot00000000000000'use strict'; var $TypeError = require('es-errors/type'); /** @type {import('./RequireObjectCoercible')} */ module.exports = function RequireObjectCoercible(value) { if (value == null) { throw new $TypeError((arguments.length > 0 && arguments[1]) || ('Cannot call method on ' + value)); } return value; }; es-shims-es-object-atoms-4b1aa02/ToObject.d.ts000066400000000000000000000005401520406522100211270ustar00rootroot00000000000000declare function ToObject(value: number): Number; declare function ToObject(value: boolean): Boolean; declare function ToObject(value: string): String; declare function ToObject(value: bigint): BigInt; declare function ToObject(value: T): T; export = ToObject; es-shims-es-object-atoms-4b1aa02/ToObject.js000066400000000000000000000003721520406522100206760ustar00rootroot00000000000000'use strict'; var $Object = require('./'); var RequireObjectCoercible = require('./RequireObjectCoercible'); /** @type {import('./ToObject')} */ module.exports = function ToObject(value) { RequireObjectCoercible(value); return $Object(value); }; es-shims-es-object-atoms-4b1aa02/index.d.ts000066400000000000000000000000731520406522100205260ustar00rootroot00000000000000declare const Object: ObjectConstructor; export = Object; es-shims-es-object-atoms-4b1aa02/index.js000066400000000000000000000001031520406522100202640ustar00rootroot00000000000000'use strict'; /** @type {import('.')} */ module.exports = Object; es-shims-es-object-atoms-4b1aa02/isObject.d.ts000066400000000000000000000001501520406522100211550ustar00rootroot00000000000000declare function isObject(x: T): x is T & object & Record; export = isObject; es-shims-es-object-atoms-4b1aa02/isObject.js000066400000000000000000000002411520406522100207220ustar00rootroot00000000000000'use strict'; /** @type {import('./isObject')} */ module.exports = function isObject(x) { return !!x && (typeof x === 'function' || typeof x === 'object'); }; es-shims-es-object-atoms-4b1aa02/package.json000066400000000000000000000043111520406522100211120ustar00rootroot00000000000000{ "name": "es-object-atoms", "version": "1.1.2", "description": "ES Object-related atoms: Object, ToObject, RequireObjectCoercible", "main": "index.js", "exports": { ".": "./index.js", "./RequireObjectCoercible": "./RequireObjectCoercible.js", "./isObject": "./isObject.js", "./ToObject": "./ToObject.js", "./package.json": "./package.json" }, "sideEffects": false, "scripts": { "prepack": "npmignore --auto --commentLines=autogenerated", "prepublishOnly": "safe-publish-latest", "prepublish": "not-in-publish || npm run prepublishOnly", "pretest": "npm run lint", "test": "npm run tests-only", "tests-only": "nyc tape 'test/**/*.js'", "posttest": "npx npm@\">= 10.2\" audit --production", "prelint": "evalmd README.md", "lint": "eslint --ext=js,mjs .", "postlint": "tsc -p . && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", "version": "auto-changelog && git add CHANGELOG.md", "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" }, "repository": { "type": "git", "url": "git+https://github.com/ljharb/es-object-atoms.git" }, "keywords": [ "javascript", "ecmascript", "object", "toobject", "coercible" ], "author": "Jordan Harband ", "license": "MIT", "bugs": { "url": "https://github.com/ljharb/es-object-atoms/issues" }, "homepage": "https://github.com/ljharb/es-object-atoms#readme", "dependencies": { "es-errors": "^1.3.0" }, "devDependencies": { "@ljharb/eslint-config": "^22.2.3", "@ljharb/tsconfig": "^0.3.2", "@types/tape": "^5.8.1", "auto-changelog": "^2.5.1", "eclint": "^2.8.1", "eslint": "^8.57.1", "evalmd": "^0.0.19", "in-publish": "^2.0.1", "npmignore": "^0.3.5", "nyc": "^10.3.2", "safe-publish-latest": "^2.0.0", "tape": "^5.9.0", "typescript": "next" }, "auto-changelog": { "output": "CHANGELOG.md", "template": "keepachangelog", "unreleased": false, "commitLimit": false, "backfillLimit": false, "hideCredit": true }, "publishConfig": { "ignore": [ ".github/workflows" ] }, "engines": { "node": ">= 0.4" } } es-shims-es-object-atoms-4b1aa02/test/000077500000000000000000000000001520406522100176045ustar00rootroot00000000000000es-shims-es-object-atoms-4b1aa02/test/index.js000066400000000000000000000021111520406522100212440ustar00rootroot00000000000000'use strict'; var test = require('tape'); var $Object = require('../'); var isObject = require('../isObject'); var ToObject = require('../ToObject'); var RequireObjectCoercible = require('..//RequireObjectCoercible'); test('errors', function (t) { t.equal($Object, Object); // @ts-expect-error t['throws'](function () { ToObject(null); }, TypeError); // @ts-expect-error t['throws'](function () { ToObject(undefined); }, TypeError); // @ts-expect-error t['throws'](function () { RequireObjectCoercible(null); }, TypeError); // @ts-expect-error t['throws'](function () { RequireObjectCoercible(undefined); }, TypeError); t.deepEqual(RequireObjectCoercible(true), true); t.deepEqual(ToObject(true), Object(true)); t.deepEqual(ToObject(42), Object(42)); var f = function () {}; t.equal(ToObject(f), f); t.equal(isObject(undefined), false); t.equal(isObject(null), false); t.equal(isObject({}), true); t.equal(isObject([]), true); t.equal(isObject(function () {}), true); var obj = {}; t.equal(RequireObjectCoercible(obj), obj); t.equal(ToObject(obj), obj); t.end(); }); es-shims-es-object-atoms-4b1aa02/tsconfig.json000066400000000000000000000001601520406522100213310ustar00rootroot00000000000000{ "extends": "@ljharb/tsconfig", "compilerOptions": { "target": "es5", "ignoreDeprecations": "6.0", }, }