summaryrefslogtreecommitdiff
path: root/includes/external/school/node_modules/browser-process-hrtime
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
committerMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
commit3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch)
tree75be5fba4368472fb11c8015aee026b2b9a71888 /includes/external/school/node_modules/browser-process-hrtime
parent8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff)
downloadpluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'includes/external/school/node_modules/browser-process-hrtime')
-rw-r--r--includes/external/school/node_modules/browser-process-hrtime/LICENSE9
-rw-r--r--includes/external/school/node_modules/browser-process-hrtime/README.md27
-rw-r--r--includes/external/school/node_modules/browser-process-hrtime/index.d.ts4
-rw-r--r--includes/external/school/node_modules/browser-process-hrtime/index.js28
-rw-r--r--includes/external/school/node_modules/browser-process-hrtime/package.json15
5 files changed, 83 insertions, 0 deletions
diff --git a/includes/external/school/node_modules/browser-process-hrtime/LICENSE b/includes/external/school/node_modules/browser-process-hrtime/LICENSE
new file mode 100644
index 0000000..d78d076
--- /dev/null
+++ b/includes/external/school/node_modules/browser-process-hrtime/LICENSE
@@ -0,0 +1,9 @@
+Copyright 2014 kumavis
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/includes/external/school/node_modules/browser-process-hrtime/README.md b/includes/external/school/node_modules/browser-process-hrtime/README.md
new file mode 100644
index 0000000..ec0ebc2
--- /dev/null
+++ b/includes/external/school/node_modules/browser-process-hrtime/README.md
@@ -0,0 +1,27 @@
+# browser-process-hrtime
+
+Browser shim for Node.js `process.hrtime()`.
+See [documentation at nodejs.org](http://nodejs.org/api/process.html#process_process_hrtime)
+
+This module does not provide the same level of time precision as node.js, but provides a matching API and response format.
+
+### usage
+Use hrtime independent of environment (node or browser).
+It will use `process.hrtime` first and fallback if not present.
+```js
+const hrtime = require('browser-process-hrtime')
+const start = hrtime()
+// ...
+const delta = hrtime(start)
+```
+
+### monkey-patching
+You can monkey-patch `process.hrtime` for your dependency graph like this:
+```js
+process.hrtime = require('browser-process-hrtime')
+const coolTool = require('module-that-uses-hrtime-somewhere-in-its-depths')
+```
+
+### note
+This was originally pull-requested against [node-process](https://github.com/defunctzombie/node-process),
+but they are trying to stay lean.
diff --git a/includes/external/school/node_modules/browser-process-hrtime/index.d.ts b/includes/external/school/node_modules/browser-process-hrtime/index.d.ts
new file mode 100644
index 0000000..90e3988
--- /dev/null
+++ b/includes/external/school/node_modules/browser-process-hrtime/index.d.ts
@@ -0,0 +1,4 @@
+declare module "browser-process-hrtime" {
+ function hrtime(time?: [number, number]): [number, number];
+ export = hrtime;
+}
diff --git a/includes/external/school/node_modules/browser-process-hrtime/index.js b/includes/external/school/node_modules/browser-process-hrtime/index.js
new file mode 100644
index 0000000..7312c2c
--- /dev/null
+++ b/includes/external/school/node_modules/browser-process-hrtime/index.js
@@ -0,0 +1,28 @@
+module.exports = process.hrtime || hrtime
+
+// polyfil for window.performance.now
+var performance = global.performance || {}
+var performanceNow =
+ performance.now ||
+ performance.mozNow ||
+ performance.msNow ||
+ performance.oNow ||
+ performance.webkitNow ||
+ function(){ return (new Date()).getTime() }
+
+// generate timestamp or delta
+// see http://nodejs.org/api/process.html#process_process_hrtime
+function hrtime(previousTimestamp){
+ var clocktime = performanceNow.call(performance)*1e-3
+ var seconds = Math.floor(clocktime)
+ var nanoseconds = Math.floor((clocktime%1)*1e9)
+ if (previousTimestamp) {
+ seconds = seconds - previousTimestamp[0]
+ nanoseconds = nanoseconds - previousTimestamp[1]
+ if (nanoseconds<0) {
+ seconds--
+ nanoseconds += 1e9
+ }
+ }
+ return [seconds,nanoseconds]
+} \ No newline at end of file
diff --git a/includes/external/school/node_modules/browser-process-hrtime/package.json b/includes/external/school/node_modules/browser-process-hrtime/package.json
new file mode 100644
index 0000000..f9449cf
--- /dev/null
+++ b/includes/external/school/node_modules/browser-process-hrtime/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "browser-process-hrtime",
+ "version": "1.0.0",
+ "description": "Shim for process.hrtime in the browser",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/kumavis/browser-process-hrtime.git"
+ },
+ "author": "kumavis",
+ "license": "BSD-2-Clause"
+}