function (_super) { __extends(RemoteAddressStrategy, _super); function RemoteAddressStrategy() { return _super.call(this, 'remoteAddress') || this; } RemoteAddressStrategy.prototype.isEnabled = function (parameters, context) { if (!parameters.IPs) { return false; } for (var _i = 0, _a = parameters.IPs.split(/\s*,\s*/); _i < _a.length; _i++) { var range = _a[_i]; try { if (range === context.remoteAddress) { return true; } else if (!ip.isV6Format(range)) { if (ip.cidrSubnet(range).contains(context.remoteAddress)) { return true; } } } catch (e) { continue; } } return false; }; return RemoteAddressStrategy; }(strategy_1.Strategy)