mirror of
https://github.com/JonasunderscoreJones/aka-worker.git
synced 2025-10-23 18:09:19 +02:00
Initial commit (by create-cloudflare CLI)
This commit is contained in:
parent
8cb86120f1
commit
fff961078a
1777 changed files with 1011798 additions and 0 deletions
113
cool-dawn-3d3b/node_modules/rollup-plugin-node-polyfills/polyfills/os.js
generated
vendored
Normal file
113
cool-dawn-3d3b/node_modules/rollup-plugin-node-polyfills/polyfills/os.js
generated
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 CoderPuppy
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
var _endianness;
|
||||
export function endianness() {
|
||||
if (typeof _endianness === 'undefined') {
|
||||
var a = new ArrayBuffer(2);
|
||||
var b = new Uint8Array(a);
|
||||
var c = new Uint16Array(a);
|
||||
b[0] = 1;
|
||||
b[1] = 2;
|
||||
if (c[0] === 258) {
|
||||
_endianness = 'BE';
|
||||
} else if (c[0] === 513){
|
||||
_endianness = 'LE';
|
||||
} else {
|
||||
throw new Error('unable to figure out endianess');
|
||||
}
|
||||
}
|
||||
return _endianness;
|
||||
}
|
||||
|
||||
export function hostname() {
|
||||
if (typeof global.location !== 'undefined') {
|
||||
return global.location.hostname
|
||||
} else return '';
|
||||
}
|
||||
|
||||
export function loadavg() {
|
||||
return [];
|
||||
}
|
||||
|
||||
export function uptime() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
export function freemem() {
|
||||
return Number.MAX_VALUE;
|
||||
}
|
||||
|
||||
export function totalmem() {
|
||||
return Number.MAX_VALUE;
|
||||
}
|
||||
|
||||
export function cpus() {
|
||||
return [];
|
||||
}
|
||||
|
||||
export function type() {
|
||||
return 'Browser';
|
||||
}
|
||||
|
||||
export function release () {
|
||||
if (typeof global.navigator !== 'undefined') {
|
||||
return global.navigator.appVersion;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
export function networkInterfaces(){}
|
||||
export function getNetworkInterfaces(){}
|
||||
|
||||
export function arch() {
|
||||
return 'javascript';
|
||||
}
|
||||
|
||||
export function platform() {
|
||||
return 'browser';
|
||||
}
|
||||
|
||||
export function tmpDir() {
|
||||
return '/tmp';
|
||||
}
|
||||
export var tmpdir = tmpDir;
|
||||
|
||||
export var EOL = '\n';
|
||||
export default {
|
||||
EOL: EOL,
|
||||
tmpdir: tmpdir,
|
||||
tmpDir: tmpDir,
|
||||
networkInterfaces:networkInterfaces,
|
||||
getNetworkInterfaces: getNetworkInterfaces,
|
||||
release: release,
|
||||
type: type,
|
||||
cpus: cpus,
|
||||
totalmem: totalmem,
|
||||
freemem: freemem,
|
||||
uptime: uptime,
|
||||
loadavg: loadavg,
|
||||
hostname: hostname,
|
||||
endianness: endianness,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue