pax_global_header00006660000000000000000000000064152126242440014514gustar00rootroot0000000000000052 comment=61ea90828bde7a9ba85e8cec24a10b207fca0b79 inspect-js-is-document.all-543e080/000077500000000000000000000000001521262424400170415ustar00rootroot00000000000000inspect-js-is-document.all-543e080/.github/000077500000000000000000000000001521262424400204015ustar00rootroot00000000000000inspect-js-is-document.all-543e080/.github/FUNDING.yml000066400000000000000000000011121521262424400222110ustar00rootroot00000000000000# 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/is-document.all 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 up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] inspect-js-is-document.all-543e080/.github/workflows/000077500000000000000000000000001521262424400224365ustar00rootroot00000000000000inspect-js-is-document.all-543e080/.github/workflows/node-aught.yml000066400000000000000000000005331521262424400252150ustar00rootroot00000000000000name: '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 node: name: 'node < 10' needs: [tests] runs-on: ubuntu-latest steps: - run: true inspect-js-is-document.all-543e080/.github/workflows/node-pretest.yml000066400000000000000000000002451521262424400255730ustar00rootroot00000000000000name: 'Tests: pretest/posttest' on: [pull_request, push] permissions: contents: read jobs: tests: uses: ljharb/actions/.github/workflows/pretest.yml@main inspect-js-is-document.all-543e080/.github/workflows/node-tens.yml000066400000000000000000000005471521262424400250630ustar00rootroot00000000000000name: 'Tests: node.js 10 - 20' on: [pull_request, push] permissions: contents: read jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: range: '>= 10 < 20' type: minors command: npm run tests-only node: name: 'node 10 - 20' needs: [tests] runs-on: ubuntu-latest steps: - run: true inspect-js-is-document.all-543e080/.github/workflows/node-twenties.yml000066400000000000000000000005361521262424400257520ustar00rootroot00000000000000name: 'Tests: node.js >= 20' on: [pull_request, push] permissions: contents: read jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: range: '>= 20' type: minors command: npm run tests-only node: name: 'node >= 20' needs: [tests] runs-on: ubuntu-latest steps: - run: true inspect-js-is-document.all-543e080/.github/workflows/rebase.yml000066400000000000000000000004731521262424400244260ustar00rootroot00000000000000name: Automatic Rebase on: [pull_request_target] permissions: contents: write # for ljharb/rebase to push code to rebase pull-requests: read # for ljharb/rebase to get info about PR jobs: _: uses: ljharb/actions/.github/workflows/rebase.yml@main secrets: token: ${{ secrets.GITHUB_TOKEN }} inspect-js-is-document.all-543e080/.github/workflows/require-allow-edits.yml000066400000000000000000000005151521262424400270600ustar00rootroot00000000000000name: 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 inspect-js-is-document.all-543e080/.gitignore000066400000000000000000000043241521262424400210340ustar00rootroot00000000000000# Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-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 # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variable files .env .env.* !.env.example # parcel-bundler cache (https://parceljs.org/) .cache .parcel-cache # Next.js build output .next out # Nuxt.js build / generate output .nuxt dist .output # 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 directory .temp # Sveltekit cache directory .svelte-kit/ # vitepress build output **/.vitepress/dist # vitepress cache directory **/.vitepress/cache # Docusaurus cache and generated files .docusaurus # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ # Firebase cache directory .firebase/ # TernJS port file .tern-port # Stores VSCode versions used for testing VSCode extensions .vscode-test # pnpm .pnpm-store # yarn v3 .pnp.* .yarn/* !.yarn/patches !.yarn/plugins !.yarn/releases !.yarn/sdks !.yarn/versions # Vite files vite.config.js.timestamp-* vite.config.ts.timestamp-* .vite/ # Only apps should have lockfiles npm-shrinkwrap.json package-lock.json yarn.lock .npmignore inspect-js-is-document.all-543e080/.npmrc000066400000000000000000000000671521262424400201640ustar00rootroot00000000000000package-lock=false allow-same-version=true message=v%s inspect-js-is-document.all-543e080/.nycrc000066400000000000000000000002131521262424400201540ustar00rootroot00000000000000{ "all": true, "check-coverage": false, "reporter": ["text-summary", "text", "html", "json"], "exclude": [ "coverage", "test" ] } inspect-js-is-document.all-543e080/CHANGELOG.md000066400000000000000000000010411521262424400206460ustar00rootroot00000000000000# 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.0.0 - 2026-06-11 ### Commits - Initial implementation [`8949b64`](https://github.com/inspect-js/is-document.all/commit/8949b6498351956a1689c2b6cc0fb9a0341cd169) - Initial commit [`75a9723`](https://github.com/inspect-js/is-document.all/commit/75a97239ddfd312ba723bf3e71c2f820f1751d29) inspect-js-is-document.all-543e080/LICENSE000066400000000000000000000020531521262424400200460ustar00rootroot00000000000000MIT License Copyright (c) 2026 Inspect JS 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. inspect-js-is-document.all-543e080/README.md000066400000000000000000000026321521262424400203230ustar00rootroot00000000000000# is-document.all [![Version Badge][2]][1] [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][11]][1] Is this value `document.all`, i.e. an object with the [[IsHTMLDDA]] internal slot? ## Example ```js var isDocumentAll = require('is-document.all'); var assert = require('assert'); assert(!isDocumentAll(undefined)); assert(!isDocumentAll(null)); assert(!isDocumentAll({})); assert(!isDocumentAll(function () {})); // in a browser: assert(isDocumentAll(document.all)); ``` ## Tests Simply clone the repo, `npm install`, and run `npm test` [1]: https://npmjs.org/package/is-document.all [2]: https://versionbadg.es/inspect-js/is-document.all.svg [11]: https://nodei.co/npm/is-document.all.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/is-document.all.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/is-document.all.svg [downloads-url]: https://npm-stat.com/charts.html?package=is-document.all [codecov-image]: https://codecov.io/gh/inspect-js/is-document.all/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/is-document.all/ [actions-image]: https://img.shields.io/github/check-runs/inspect-js/is-document.all/main [actions-url]: https://github.com/inspect-js/is-document.all/actions inspect-js-is-document.all-543e080/eslint.config.mjs000066400000000000000000000002221521262424400223120ustar00rootroot00000000000000import ljharbConfig from '@ljharb/eslint-config/flat'; export default [ ...ljharbConfig, { rules: { 'no-extra-parens': 'off', }, }, ]; inspect-js-is-document.all-543e080/index.d.ts000066400000000000000000000001451521262424400207420ustar00rootroot00000000000000declare function isDocumentAll(value: unknown): value is HTMLAllCollection; export = isDocumentAll; inspect-js-is-document.all-543e080/index.js000066400000000000000000000023051521262424400205060ustar00rootroot00000000000000'use strict'; var callBound = require('call-bound'); var toStr = callBound('Object.prototype.toString'); var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, no-magic-numbers var objectClass = '[object Object]'; var ddaClass = '[object HTMLAllCollection]'; /** @type {(() => false) | ((value: unknown) => value is HTMLAllCollection)} */ var isDDA = function isDocumentDotAll() { return /** @type {const} */ (false); }; if (typeof document === 'object') { // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly var all = document.all; if (toStr(all) === toStr(document.all)) { isDDA = /** @type {import('.')} */ (function isDocumentDotAll(value) { /* globals document: false */ // in IE 6-8, typeof document.all is "object" and it's truthy if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { try { // @ts-expect-error nullish will throw var str = toStr(value); // IE 6-8 uses `objectClass` return (str === ddaClass || str === objectClass) && /** @type {Function} */ (value)('') == null; // eslint-disable-line eqeqeq } catch (e) { /**/ } } return false; }); } } module.exports = isDDA; inspect-js-is-document.all-543e080/package.json000066400000000000000000000043531521262424400213340ustar00rootroot00000000000000{ "name": "is-document.all", "version": "1.0.0", "description": "Is this value `document.all`, i.e. an object with the [[IsHTMLDDA]] internal slot?", "main": "index.js", "scripts": { "prepack": "npmignore --auto --commentLines=autogenerated", "prepublishOnly": "safe-publish-latest", "prepublish": "not-in-publish || npm run prepublishOnly", "lint": "eslint .", "postlint": "tsc -p . && attw -P", "pretest": "npm run lint", "tests-only": "nyc tape 'test/**/*.js'", "test": "npm run tests-only", "posttest": "npx npm@'>=10.2' audit --production", "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/inspect-js/is-document.all.git" }, "keywords": [ "document.all", "IsHTMLDDA", "HTMLAllCollection", "document", "all", "is", "undefined" ], "author": "Jordan Harband ", "funding": { "url": "https://github.com/sponsors/ljharb" }, "license": "MIT", "bugs": { "url": "https://github.com/inspect-js/is-document.all/issues" }, "homepage": "https://github.com/inspect-js/is-document.all#readme", "dependencies": { "call-bound": "^1.0.4" }, "devDependencies": { "@arethetypeswrong/cli": "^0.18.3", "@ljharb/eslint-config": "^22.2.3", "@ljharb/tsconfig": "^0.3.2", "@types/for-each": "^0.3.3", "@types/node": "^25.9.3", "@types/object-inspect": "^1.13.0", "auto-changelog": "^2.5.0", "encoding": "^0.1.13", "es-value-fixtures": "^1.7.1", "eslint": "^10.4.1", "for-each": "^0.3.5", "in-publish": "^2.0.1", "jiti": "^0.0.0", "npmignore": "^0.3.5", "nyc": "^10.3.2", "object-inspect": "^1.13.4", "safe-publish-latest": "^2.0.0", "tape": "^5.10.0", "typescript": "next" }, "engines": { "node": ">= 0.4" }, "auto-changelog": { "output": "CHANGELOG.md", "template": "keepachangelog", "unreleased": false, "commitLimit": false, "backfillLimit": false, "hideCredit": true, "autodetectMonorepoDisabled": false }, "publishConfig": { "ignore": [ ".github/workflows" ] }, "testling": { "files": "test/index.js" } } inspect-js-is-document.all-543e080/test/000077500000000000000000000000001521262424400200205ustar00rootroot00000000000000inspect-js-is-document.all-543e080/test/index.js000066400000000000000000000025651521262424400214750ustar00rootroot00000000000000'use strict'; var test = require('tape'); var inspect = require('object-inspect'); var forEach = require('for-each'); var v = require('es-value-fixtures'); var isDocumentAll = require('../'); test('non-DDA values', function (t) { /** @type {unknown[]} */ var nonDDAs = [].concat( // @ts-expect-error TS sucks with concat v.primitives, v.objects, [ [], /a/g, new Date(), function () {} ] ); forEach(nonDDAs, function (nonDDA) { t.equal(isDocumentAll(nonDDA), false, inspect(nonDDA) + ' is not document.all'); }); t.end(); }); test('document.all', { skip: typeof document !== 'object' }, function (t) { t.plan(4); /* globals document: false */ t.equal(isDocumentAll(document.all), true, 'document.all is document.all'); t.equal(isDocumentAll(document), false, 'document is not document.all'); var iframe = document.createElement('iframe'); iframe.style.display = 'none'; // Optional: keep it hidden document.body.appendChild(iframe); t.teardown(function () { document.body.removeChild(iframe); }); iframe.onload = function () { var doc = iframe.contentWindow && iframe.contentWindow.document; t.equal( isDocumentAll(doc && doc.all), true, 'another realm’s document.all is document.all' ); t.equal(isDocumentAll(doc), false, 'another realm’s document is not document.all'); }; iframe.src = 'about:blank'; // or point to a URL }); inspect-js-is-document.all-543e080/tsconfig.json000066400000000000000000000001621521262424400215470ustar00rootroot00000000000000{ "extends": "@ljharb/tsconfig", "compilerOptions": { "target": "ES2021", }, "exclude": [ "coverage" ] }