HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/zaklada/html/node_modules/regexpu/bin/regexpu
#!/usr/bin/env node
(function() {

	var fs = require('fs');
	var jsesc = require('jsesc');
	var regexpu = require('../regexpu.js');
	var strings = process.argv.splice(2);
	var option = strings.shift();
	var stdin = process.stdin;
	var isFile = false;
	var data;
	var timeout;
	var options = {};
	var log = console.log;

	var main = function() {

		if (/^(?:-h|--help|undefined)$/.test(option)) {
			log(
				'regexpu v%s - https://mths.be/regexpu',
				regexpu.version
			);
			log([
				'\nUsage:\n',
				'\tregexpu [-c | --code] [snippet ...]',
				'\tregexpu [-f | --file] [file ...]',
				'\tregexpu [-v | --version]',
				'\tregexpu [-h | --help]',
				'\nExamples:\n',
				'\tregexpu -f foo-es6.js > foo-es5.js',
				'\tregexpu -c \'var x = /foo.bar/u;\'',
				'\techo \'var x = /foo.bar/u;\' | regexpu -c'
			].join('\n'));
			return process.exit(1);
		}

		if (/^(?:-v|--version)$/.test(option)) {
			log('v%s', regexpu.version);
			return process.exit(1);
		}

		if (/^(?:-f|--file)$/.test(option)) {
			isFile = true;
		} else if (!/^(?:-c|--code)$/.test(option)) {
			log('Unrecognized option `%s`.', option);
			log('Try `regexpu --help` for more information.');
			return process.exit(1);
		}

		if (!strings.length) {
			log('Error: option `%s` requires an argument.', option);
			log('Try `regexpu --help` for more information.');
			return process.exit(1);
		}

		strings.forEach(function(snippet) {
			var result;
			if (isFile) {
				try {
					snippet = fs.readFileSync(snippet, 'utf8');
				} catch (exception) {
					log('Error: no such file. (`%s`)', snippet);
					return process.exit(1);
				}
			}
			try {
				result = regexpu.transpileCode(snippet);
				log(result);
			} catch (exception) {
				log(exception.message + '\n');
				log('Error: failed to transpile. Make sure the JavaScript code is valid.');
				log('If you think this is a bug in regexpu, please report it:');
				log('https://github.com/mathiasbynens/regexpu/issues/new');
				log('\nStack trace using regexpu@%s:\n', regexpu.version);
				log(exception.stack);
				return process.exit(1);
			}
		});
		// Return with exit status 0 outside of the `forEach` loop, in case
		// multiple snippets or files were passed in.
		return process.exit(0);
	};

	if (stdin.isTTY) {
		// handle shell arguments
		main();
	} else {
		// Either the script is called from within a non-TTY context, or `stdin`
		// content is being piped in.
		if (!process.stdout.isTTY) {
			// The script was called from a non-TTY context. This is a rather uncommon
			// use case we don’t actively support. However, we don’t want the script
			// to wait forever in such cases, so…
			timeout = setTimeout(function() {
				// …if no piped data arrived after a whole minute, handle shell
				// arguments instead.
				main();
			}, 60000);
		}
		data = '';
		stdin.on('data', function(chunk) {
			clearTimeout(timeout);
			data += chunk;
		});
		stdin.on('end', function() {
			strings.push(data.trim());
			main();
		});
		stdin.resume();
	}

}());