Phase 1 PWA: prayer times, qibla, quran, hijri, tasbih, 99 names
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
# 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']
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
# 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)
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
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.
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
# is-document.all <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![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
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import ljharbConfig from '@ljharb/eslint-config/flat';
|
||||
|
||||
export default [
|
||||
...ljharbConfig,
|
||||
{
|
||||
rules: {
|
||||
'no-extra-parens': 'off',
|
||||
},
|
||||
},
|
||||
];
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
declare function isDocumentAll(value: unknown): value is HTMLAllCollection;
|
||||
|
||||
export = isDocumentAll;
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
'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;
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"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 <ljharb@gmail.com>",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
'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
|
||||
});
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "@ljharb/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "ES2021",
|
||||
},
|
||||
"exclude": [
|
||||
"coverage"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user