UNPKG

@sanity/default-layout

Version:

The default layout components for Sanity

24 lines (23 loc) 888 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.debugWithName = debugWithName; exports.default = void 0; exports.isDebugMode = isDebugMode; var _debug = _interopRequireDefault(require("debug")); var _constants = require("../constants"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var rootName = 'sanity-default-layout:navbar:search:'; var _default = (0, _debug.default)(rootName); exports.default = _default; function debugWithName(name) { var namespace = "".concat(rootName).concat(name); if (_debug.default && _debug.default.enabled(namespace)) { return (0, _debug.default)(namespace); } return (0, _debug.default)(rootName); } function isDebugMode() { return typeof window === 'undefined' ? false : window.location.hash.slice(1).split(';').includes(_constants.DEBUG_FRAGMENT); }