hatch-surf/node_modules/is-document.all/index.js
Riley Zhang df378d33ef
Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Merge GitHub main into Gitea repo (allow unrelated histories)
Resolved conflicts by taking GitHub versions for:
- .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml

Kept deploy.sh updated to:
- Pull from GitHub (primary source)
- Push to Gitea (push-mirror)
- Build from site/ directory (GitHub structure)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-25 05:20:46 +02:00

38 lines
1.2 KiB
JavaScript

'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;