UNPKG

speech-rule-engine

Version:

A standalone speech rule engine for XML structures, based on the original engine from ChromeVox.

54 lines (53 loc) 2.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SystemExternal = void 0; const variables_js_1 = require("./variables.js"); const lib_external_js_1 = require("./lib_external.js"); const windowSupported = (() => !(typeof window === 'undefined'))(); const documentSupported = (() => windowSupported && !(typeof window.document === 'undefined'))(); const webworker = (() => !(typeof DedicatedWorkerGlobalScope === 'undefined'))(); const nodeRequire = () => eval('require'); exports.SystemExternal = { extRequire(library) { if (typeof process !== 'undefined' && typeof require !== 'undefined') { return nodeRequire()(library); } return null; }, windowSupported: windowSupported, documentSupported: documentSupported, webworker: webworker, xmldom: lib_external_js_1.xmldom, document: lib_external_js_1.document, mathmapsIePath: 'https://cdn.jsdelivr.net/npm/sre-mathmaps-ie@' + variables_js_1.Variables.VERSION + 'mathmaps_ie.js', fs: documentSupported || webworker ? null : nodeRequire()('fs'), url: variables_js_1.Variables.url, jsonPath: (function () { if (documentSupported || webworker) { return variables_js_1.Variables.url; } if (process.env.SRE_JSON_PATH || global.SRE_JSON_PATH) { return process.env.SRE_JSON_PATH || global.SRE_JSON_PATH; } try { const path = nodeRequire().resolve('speech-rule-engine'); return path.replace(/sre\.js$/, '') + 'mathmaps'; } catch (_err) { } try { const path = nodeRequire().resolve('.'); return path.replace(/sre\.js$/, '') + 'mathmaps'; } catch (_err) { } return typeof __dirname !== 'undefined' ? __dirname + (__dirname.match(/lib?$/) ? '/mathmaps' : '/lib/mathmaps') : process.cwd() + '/lib/mathmaps'; })(), WGXpath: variables_js_1.Variables.WGXpath, wgxpath: null, xpath: lib_external_js_1.xpath };