UNPKG

@storm-software/linting-tools

Version:

⚡ A package containing various linting tools used to validate syntax, enforce design standards, and format code in a Storm workspace.

34 lines (21 loc) 1.82 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _chunkEFLFSEBJcjs = require('./chunk-EFLFSEBJ.cjs'); var _chunkUB72K2YDcjs = require('./chunk-UB72K2YD.cjs'); // ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs _chunkUB72K2YDcjs.init_cjs_shims.call(void 0, ); // ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs _chunkUB72K2YDcjs.init_cjs_shims.call(void 0, ); var _crypto = require('crypto'); var e = _optionalChain([globalThis, 'access', _ => _.process, 'optionalAccess', _2 => _2.getBuiltinModule, 'optionalCall', _3 => _3("crypto"), 'optionalAccess', _4 => _4.hash]); var r = "sha256"; var s = "base64url"; function digest(t) { if (e) return e(r, t, s); const o = _crypto.createHash.call(void 0, r).update(t); return _optionalChain([globalThis, 'access', _5 => _5.process, 'optionalAccess', _6 => _6.versions, 'optionalAccess', _7 => _7.webcontainer]) ? o.digest().toString(s) : o.digest(s); } // ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs function hash(input) { return digest(_chunkEFLFSEBJcjs.serialize.call(void 0, input)); } exports.digest = digest; exports.hash = hash; exports.isEqual = _chunkEFLFSEBJcjs.isEqual; exports.serialize = _chunkEFLFSEBJcjs.serialize;