Files
app/dashboard/node_modules/side-channel/index.js
renato97 8fc8991efa Add v9.1.1: Device registry and remote blocking system
- Implement DeviceRegistry for remote device management
- Add dashboard for device tracking and blocking
- Remote device blocking capability with admin control
- Support for device aliasing and notes
- Enhanced device management interface
- Dashboard with real-time device status
- Configurable registry URL in build config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 21:37:11 +01:00

44 lines
1.2 KiB
JavaScript

'use strict';
var $TypeError = require('es-errors/type');
var inspect = require('object-inspect');
var getSideChannelList = require('side-channel-list');
var getSideChannelMap = require('side-channel-map');
var getSideChannelWeakMap = require('side-channel-weakmap');
var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
/** @type {import('.')} */
module.exports = function getSideChannel() {
/** @typedef {ReturnType<typeof getSideChannel>} Channel */
/** @type {Channel | undefined} */ var $channelData;
/** @type {Channel} */
var channel = {
assert: function (key) {
if (!channel.has(key)) {
throw new $TypeError('Side channel does not contain ' + inspect(key));
}
},
'delete': function (key) {
return !!$channelData && $channelData['delete'](key);
},
get: function (key) {
return $channelData && $channelData.get(key);
},
has: function (key) {
return !!$channelData && $channelData.has(key);
},
set: function (key, value) {
if (!$channelData) {
$channelData = makeChannel();
}
$channelData.set(key, value);
}
};
// @ts-expect-error TODO: figure out why this is erroring
return channel;
};