This commit is contained in:
2022-09-30 05:39:11 +00:00
parent 41ee9463ae
commit 4687fa49bc
11418 changed files with 1312504 additions and 0 deletions

View File

@ -0,0 +1,11 @@
var adapter = require('./');
/**
* Extracts the values from process.env.
*
* @type {Function}
* @public
*/
module.exports = adapter(function hash() {
return /(debug|diagnostics)=([^&]+)/i.exec(window.location.hash)[2];
});

View File

@ -0,0 +1,18 @@
var enabled = require('enabled');
/**
* Creates a new Adapter.
*
* @param {Function} fn Function that returns the value.
* @returns {Function} The adapter logic.
* @public
*/
module.exports = function create(fn) {
return function adapter(namespace) {
try {
return enabled(namespace, fn());
} catch (e) { /* Any failure means that we found nothing */ }
return false;
};
}

View File

@ -0,0 +1,11 @@
var adapter = require('./');
/**
* Extracts the values from process.env.
*
* @type {Function}
* @public
*/
module.exports = adapter(function storage() {
return localStorage.getItem('debug') || localStorage.getItem('diagnostics');
});

View File

@ -0,0 +1,11 @@
var adapter = require('./');
/**
* Extracts the values from process.env.
*
* @type {Function}
* @public
*/
module.exports = adapter(function processenv() {
return process.env.DEBUG || process.env.DIAGNOSTICS;
});