greybel-js
Version:
Transpiler/Interpreter for GreyScript. (GreyHack)
73 lines • 3.88 kB
JavaScript
import { parseFileExtensions } from '../helper/parse-file-extensions.js';
export var ErrorResponseMessage;
(function (ErrorResponseMessage) {
ErrorResponseMessage["OutOfRam"] = "I can not open the program. There is not enough RAM available. Close some program and try again.";
ErrorResponseMessage["DesktopUI"] = "Error: Desktop GUI is not running.";
ErrorResponseMessage["CanOnlyRunOnComputer"] = "Error: this program can only be run on computers.";
ErrorResponseMessage["CannotBeExecutedRemotely"] = "Error: this program can not be executed remotely";
ErrorResponseMessage["CannotLaunch"] = "Can't launch program. Permission denied.";
ErrorResponseMessage["NotAttached"] = "Error: script is not attached to any existing terminal";
ErrorResponseMessage["DeviceNotFound"] = "Error: device not found.";
ErrorResponseMessage["NoInternet"] = "Error: No internet connection";
ErrorResponseMessage["InvalidCommand"] = "Unknown error: invalid command.";
})(ErrorResponseMessage || (ErrorResponseMessage = {}));
export var BeautifyIndentationType;
(function (BeautifyIndentationType) {
BeautifyIndentationType["Tab"] = "tab";
BeautifyIndentationType["Whitespace"] = "whitespace";
})(BeautifyIndentationType || (BeautifyIndentationType = {}));
const defaultOptions = {
outputFilename: null,
fileExtensions: null,
disableBuildFolder: false,
uglify: false,
beautify: false,
beautifyKeepParentheses: false,
beautifyIndentation: BeautifyIndentationType.Tab,
beautifyIndentationSpaces: 2,
obfuscation: false,
installer: false,
autoCompile: false,
allowImport: false,
excludedNamespaces: [],
disableLiteralsOptimization: false,
disableNamespacesOptimization: false,
maxChars: 160000,
envFiles: [],
envVars: [],
ingameDirectory: '/root/',
createIngame: false,
autoCompilePurge: false,
port: 7777
};
export const parseBuildOptions = (options) => {
return {
disableBuildFolder: options.disableBuildFolder ?? defaultOptions.disableBuildFolder,
uglify: options.uglify ?? defaultOptions.uglify,
beautify: options.beautify ?? defaultOptions.beautify,
beautifyKeepParentheses: options.beautifyKeepParentheses ?? defaultOptions.beautifyKeepParentheses,
beautifyIndentation: options.beautifyIndentation ?? defaultOptions.beautifyIndentation,
beautifyIndentationSpaces: options.beautifyIndentationSpaces ??
defaultOptions.beautifyIndentationSpaces,
obfuscation: options.obfuscation ?? defaultOptions.obfuscation,
installer: options.installer ?? defaultOptions.installer,
autoCompile: options.autoCompile ?? defaultOptions.autoCompile,
allowImport: options.allowImport ?? defaultOptions.allowImport,
excludedNamespaces: options.excludedNamespaces ?? defaultOptions.excludedNamespaces,
disableLiteralsOptimization: options.disableLiteralsOptimization ??
defaultOptions.disableLiteralsOptimization,
disableNamespacesOptimization: options.disableNamespacesOptimization ??
defaultOptions.disableNamespacesOptimization,
maxChars: options.maxChars ?? defaultOptions.maxChars,
envFiles: options.envFiles ?? defaultOptions.envFiles,
envVars: options.envVars ?? defaultOptions.envVars,
outputFilename: options.outputFilename ?? defaultOptions.outputFilename,
fileExtensions: parseFileExtensions(options.fileExtensions) ??
defaultOptions.fileExtensions,
ingameDirectory: options.ingameDirectory ?? defaultOptions.ingameDirectory,
createIngame: options.createIngame ?? defaultOptions.createIngame,
autoCompilePurge: options.autoCompilePurge ?? defaultOptions.autoCompilePurge,
port: options.port ?? defaultOptions.port
};
};
//# sourceMappingURL=types.js.map