Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
51
Frontend-Learner/node_modules/is64bit/browser.js
generated
vendored
Normal file
51
Frontend-Learner/node_modules/is64bit/browser.js
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
const userAgentSignatures = [
|
||||
'amd64',
|
||||
'ia64',
|
||||
'irix64',
|
||||
'ppc64',
|
||||
'sparc64',
|
||||
'win64',
|
||||
'wow64',
|
||||
'x64;', // The semicolon is important to prevent false-positives.
|
||||
'x64_64',
|
||||
'x86-64',
|
||||
'x86_64',
|
||||
];
|
||||
|
||||
export async function is64bit() {
|
||||
if (!globalThis.navigator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const {navigator} = globalThis;
|
||||
|
||||
if (navigator.userAgentData?.getHighEntropyValues) {
|
||||
// It can throw if the user-agent decides that one or more of the hints requested should not be returned.
|
||||
try {
|
||||
const {bitness} = await navigator.userAgentData.getHighEntropyValues(['bitness']);
|
||||
return bitness === '64';
|
||||
} catch {}
|
||||
}
|
||||
|
||||
return is64bitSync();
|
||||
}
|
||||
|
||||
export function is64bitSync() {
|
||||
if (!globalThis.navigator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const {navigator} = globalThis;
|
||||
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
if (userAgentSignatures.some(signature => userAgent.includes(signature))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (navigator.cpuClass.toLowerCase() === 'x64') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
29
Frontend-Learner/node_modules/is64bit/index.d.ts
generated
vendored
Normal file
29
Frontend-Learner/node_modules/is64bit/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
Check whether operating system CPU architecture is 64-bit or 32-bit.
|
||||
|
||||
@example
|
||||
```
|
||||
import {is64bit} from 'is64bit';
|
||||
|
||||
// On ARM64 macOS
|
||||
console.log(await is64bit());
|
||||
//=> true
|
||||
```
|
||||
*/
|
||||
export function is64bit(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
Check whether operating system CPU architecture is 64-bit or 32-bit.
|
||||
|
||||
**Note**: Prefer the async version for browser or cross-platform usage as it has a more reliable check.
|
||||
|
||||
@example
|
||||
```
|
||||
import {is64bitSync} from 'is64bit';
|
||||
|
||||
// On ARM64 macOS
|
||||
console.log(is64bitSync());
|
||||
//=> true
|
||||
```
|
||||
*/
|
||||
export function is64bitSync(): boolean;
|
||||
16
Frontend-Learner/node_modules/is64bit/index.js
generated
vendored
Normal file
16
Frontend-Learner/node_modules/is64bit/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import {systemArchitecture, systemArchitectureSync} from 'system-architecture';
|
||||
|
||||
const archtectures64bit = new Set([
|
||||
'arm64',
|
||||
'x64',
|
||||
'ppc64',
|
||||
'riscv64',
|
||||
]);
|
||||
|
||||
export async function is64bit() {
|
||||
return archtectures64bit.has(await systemArchitecture());
|
||||
}
|
||||
|
||||
export function is64bitSync() {
|
||||
return archtectures64bit.has(systemArchitectureSync());
|
||||
}
|
||||
9
Frontend-Learner/node_modules/is64bit/license
generated
vendored
Normal file
9
Frontend-Learner/node_modules/is64bit/license
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
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.
|
||||
53
Frontend-Learner/node_modules/is64bit/package.json
generated
vendored
Normal file
53
Frontend-Learner/node_modules/is64bit/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"name": "is64bit",
|
||||
"version": "2.0.0",
|
||||
"description": "Check whether operating system CPU architecture is 64-bit or 32-bit (Supports browsers)",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is64bit",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"types": "./index.d.ts",
|
||||
"node": "./index.js",
|
||||
"default": "./browser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"browser.js"
|
||||
],
|
||||
"keywords": [
|
||||
"64-bit",
|
||||
"32-bit",
|
||||
"bitness",
|
||||
"detect",
|
||||
"check",
|
||||
"arch",
|
||||
"architecture",
|
||||
"cpu",
|
||||
"arm64",
|
||||
"arm",
|
||||
"x64",
|
||||
"x86",
|
||||
"browser"
|
||||
],
|
||||
"dependencies": {
|
||||
"system-architecture": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^5.3.1",
|
||||
"xo": "^0.56.0"
|
||||
}
|
||||
}
|
||||
39
Frontend-Learner/node_modules/is64bit/readme.md
generated
vendored
Normal file
39
Frontend-Learner/node_modules/is64bit/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# is64bit
|
||||
|
||||
> Check whether operating system CPU architecture is 64-bit or 32-bit
|
||||
|
||||
This package also works in the browser. It can be useful to serve the correct binary for download.
|
||||
|
||||
On Node.js, [`process.arch` / `os.arch()`](https://nodejs.org/api/process.html#processarch) is generally not useful as it returns the CPU architecture for which the Node.js binary was compiled, not the actual system architecture.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install is64bit
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import {is64bit} from 'is64bit';
|
||||
|
||||
// On ARM64 macOS
|
||||
console.log(await is64bit());
|
||||
//=> true
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### is64bit()
|
||||
|
||||
Returns a `Promise<boolean>` for whether the operating system CPU architecture is 64-bit.
|
||||
|
||||
### is64bitSync()
|
||||
|
||||
Returns a `boolean` for whether the operating system CPU architecture is 64-bit.
|
||||
|
||||
**Note**: Prefer the async version for browser or cross-platform usage as it has a more reliable check.
|
||||
|
||||
## Related
|
||||
|
||||
- [system-architecture](https://github.com/sindresorhus/system-architecture) - Get the operating system CPU architecture
|
||||
Loading…
Add table
Add a link
Reference in a new issue