UNPKG

card-sharing

Version:

card sharing config generator by parsing online sources

52 lines (39 loc) 2.45 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _core = require('../core'); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var CCcam = function (_Config) { _inherits(CCcam, _Config); function CCcam() { _classCallCheck(this, CCcam); return _possibleConstructorReturn(this, (CCcam.__proto__ || Object.getPrototypeOf(CCcam)).apply(this, arguments)); } return CCcam; }(_core.Config); CCcam.ensureOptions = ['host', 'port', 'username', 'password']; CCcam.blacklist = [ // Block all hosts that belongs to domain: fcnoip.org function () { var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(cccam) { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: return _context.abrupt('return', cccam.host && cccam.host.match('fcnoip.org')); case 1: case 'end': return _context.stop(); } } }, _callee, undefined); })); return function (_x) { return _ref.apply(this, arguments); }; }()]; exports.default = CCcam;