Skip to content

Commit

Permalink
🔥 Removes the assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Nov 2, 2023
1 parent cceccce commit 7872a20
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions plugins/cookie_manager/lib/src/cookie_mgr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import 'dart:io';
import 'package:cookie_jar/cookie_jar.dart';
import 'package:dio/dio.dart';

const _kIsWeb = bool.hasEnvironment('dart.library.js_util')
? bool.fromEnvironment('dart.library.js_util')
: identical(0, 0.0);

/// - `(?<=)` is a positive lookbehind assertion that matches a comma (",")
/// only if it's preceded by a specific pattern. In this case, the lookbehind
/// assertion is empty, which means it matches any comma that's preceded by any character.
Expand All @@ -21,9 +17,7 @@ final _setCookieReg = RegExp('(?<=)(,)(?=[^;]+?=)');

/// Cookie manager for HTTP requests based on [CookieJar].
class CookieManager extends Interceptor {
const CookieManager(
this.cookieJar,
) : assert(!_kIsWeb, "Don't use the manager in Web environments.");
const CookieManager(this.cookieJar);

final CookieJar cookieJar;

Expand Down

0 comments on commit 7872a20

Please sign in to comment.