pax_global_header 0000666 0000000 0000000 00000000064 15212624244 0014514 g ustar 00root root 0000000 0000000 52 comment=61ea90828bde7a9ba85e8cec24a10b207fca0b79
inspect-js-is-document.all-543e080/ 0000775 0000000 0000000 00000000000 15212624244 0017041 5 ustar 00root root 0000000 0000000 inspect-js-is-document.all-543e080/.github/ 0000775 0000000 0000000 00000000000 15212624244 0020401 5 ustar 00root root 0000000 0000000 inspect-js-is-document.all-543e080/.github/FUNDING.yml 0000664 0000000 0000000 00000001112 15212624244 0022211 0 ustar 00root root 0000000 0000000 # 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/ 0000775 0000000 0000000 00000000000 15212624244 0022436 5 ustar 00root root 0000000 0000000 inspect-js-is-document.all-543e080/.github/workflows/node-aught.yml 0000664 0000000 0000000 00000000533 15212624244 0025215 0 ustar 00root root 0000000 0000000 name: '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.yml 0000664 0000000 0000000 00000000245 15212624244 0025573 0 ustar 00root root 0000000 0000000 name: '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.yml 0000664 0000000 0000000 00000000547 15212624244 0025063 0 ustar 00root root 0000000 0000000 name: '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.yml 0000664 0000000 0000000 00000000536 15212624244 0025752 0 ustar 00root root 0000000 0000000 name: '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.yml 0000664 0000000 0000000 00000000473 15212624244 0024426 0 ustar 00root root 0000000 0000000 name: 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.yml 0000664 0000000 0000000 00000000515 15212624244 0027060 0 ustar 00root root 0000000 0000000 name: 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/.gitignore 0000664 0000000 0000000 00000004324 15212624244 0021034 0 ustar 00root root 0000000 0000000 # 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/.npmrc 0000664 0000000 0000000 00000000067 15212624244 0020164 0 ustar 00root root 0000000 0000000 package-lock=false
allow-same-version=true
message=v%s
inspect-js-is-document.all-543e080/.nycrc 0000664 0000000 0000000 00000000213 15212624244 0020154 0 ustar 00root root 0000000 0000000 {
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}
inspect-js-is-document.all-543e080/CHANGELOG.md 0000664 0000000 0000000 00000001041 15212624244 0020646 0 ustar 00root root 0000000 0000000 # 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/LICENSE 0000664 0000000 0000000 00000002053 15212624244 0020046 0 ustar 00root root 0000000 0000000 MIT 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.md 0000664 0000000 0000000 00000002632 15212624244 0020323 0 ustar 00root root 0000000 0000000 # 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.mjs 0000664 0000000 0000000 00000000222 15212624244 0022312 0 ustar 00root root 0000000 0000000 import ljharbConfig from '@ljharb/eslint-config/flat';
export default [
...ljharbConfig,
{
rules: {
'no-extra-parens': 'off',
},
},
];
inspect-js-is-document.all-543e080/index.d.ts 0000664 0000000 0000000 00000000145 15212624244 0020742 0 ustar 00root root 0000000 0000000 declare function isDocumentAll(value: unknown): value is HTMLAllCollection;
export = isDocumentAll;
inspect-js-is-document.all-543e080/index.js 0000664 0000000 0000000 00000002305 15212624244 0020506 0 ustar 00root root 0000000 0000000 '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.json 0000664 0000000 0000000 00000004353 15212624244 0021334 0 ustar 00root root 0000000 0000000 {
"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/ 0000775 0000000 0000000 00000000000 15212624244 0020020 5 ustar 00root root 0000000 0000000 inspect-js-is-document.all-543e080/test/index.js 0000664 0000000 0000000 00000002565 15212624244 0021475 0 ustar 00root root 0000000 0000000 '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.json 0000664 0000000 0000000 00000000162 15212624244 0021547 0 ustar 00root root 0000000 0000000 {
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "ES2021",
},
"exclude": [
"coverage"
]
}