PackageTrack
Sign in Get early access

public_suffix

A domain parser based on the Public Suffix List, for identifying the root and suffix/TLD of URLs.

3.0.0 9.3K downloads/mo #3032 most downloaded on pub.dev komposten/public_suffix

What this package is like to depend on

Last release 5 years ago

no release in 18 months

Release timing varies

gaps range from 1 weeks to 1.2 years

Nearly every release is documented

notes for 7 of 7 stable releases

Nothing withdrawn

no release was ever pulled

7 years old

7 releases · first in 2019

0 releases in the last 12 months

see the full history below

Release timeline

7 releases · Aug 2019 to Apr 2021
2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 7
  1. 3.0.0 01 Apr 2021
    Release notes

    API changes

    • Minimum Dart SDK requirement changed to 2.12.0.
    • All components have been updated for the new null-safety system (courtesy of bsutton).

    Fixes

    • Fix a couple of broken references in the API documentation.
    Open source →
    Release notes

    API changes

    • Minimum Dart SDK requirement changed to 2.12.0.
    • All components have been updated for the new null-safety system (courtesy of bsutton).

    Fixes

    • Fix a couple of broken references in the API documentation.
    Open source →
  2. 2.0.1 28 Nov 2020
    Release notes

    Additions

    Open source →
    Release notes

    Additions

    Open source →
  3. 2.0.0 28 Nov 2020
    Release notes

    API changes

    • SuffixRules is no longer static.
      • Multiple instances can be created with different rule lists.
      • DefaultSuffixRules has been added to provide a statically accessible rules list with a similar API to the old SuffixRules.
      • PublicSuffix now takes an optional argument when created to specify the SuffixRules to use. If unspecified, DefaultSuffixRules is used (similar to previous version).
    • Move SuffixRules.process and SuffixRules.validate to a new class, SuffixRulesParser.
    • The default constructor in PublicSuffix now takes either a String or a URL.
    • Add factory methods PublicSuffix.fromString and fromUrl with adjustable leniency for invalid URLs (fixes #4).
      • These allow creation of PublicSuffix instances without getting exceptions thrown if the URL is null/empty/invalid. See the documentation for full details.
    • Rename PublicSuffix.sourceUri to PublicSuffix.sourceUrl.
    • Remove export of public_suffix.dart from the helper files.
    • Rename public_suffix_io.dart and public_suffix_browser.dart to io_helper.dart and browser_helper.dart.

    Additions

    • END PRIVATE is now respected when loading a suffix list. This means that a list can contain the private section anywhere in the list or even have multiple private sections.
    • SuffixRules.hasRules - checks if at least one rule exists.
    • SuffixRules.fromRules - creates a SuffixRules instance from an existing list of Rule objects.

    Fixes

    • Fix rule matching not working for rules with wildcards not in the first position (e.g. a.*.c).
    • Allow null lists when creating SuffixRules objects (treated as empty lists).
    Open source →
    Release notes

    API changes

    • SuffixRules is no longer static.
      • Multiple instances can be created with different rule lists.
      • DefaultSuffixRules has been added to provide a statically accessible rules list with a similar API to the old SuffixRules.
      • PublicSuffix now takes an optional argument when created to specify the SuffixRules to use. If unspecified, DefaultSuffixRules is used (similar to previous version).
    • Move SuffixRules.process and SuffixRules.validate to a new class, SuffixRulesParser.
    • The default constructor in PublicSuffix now takes either a String or a URL.
    • Add factory methods PublicSuffix.fromString and fromUrl with adjustable leniency for invalid URLs (fixes #4).
      • These allow creation of PublicSuffix instances without getting exceptions thrown if the URL is null/empty/invalid. See the documentation for full details.
    • Rename PublicSuffix.sourceUri to PublicSuffix.sourceUrl.
    • Remove export of public_suffix.dart from the helper files.
    • Rename public_suffix_io.dart and public_suffix_browser.dart to io_helper.dart and browser_helper.dart.

    Additions

    • END PRIVATE is now respected when loading a suffix list. This means that a list can contain the private section anywhere in the list or even have multiple private sections.
    • SuffixRules.hasRules - checks if at least one rule exists.
    • SuffixRules.fromRules - creates a SuffixRules instance from an existing list of Rule objects.

    Fixes

    • Fix rule matching not working for rules with wildcards not in the first position (e.g. a.*.c).
    • Allow null lists when creating SuffixRules objects (treated as empty lists).
    Open source →
  4. 1.2.1 21 Sep 2019
    Release notes

    Changes

    • Improved the suffix list format documentation in SuffixRules and the SuffixRulesHelpers.
    • Improved documentation of DomainUtils.
    • Fixed DomainUtils.isKnownSuffix not throwing if SuffixRules hasn't been initialised.
    • Removed the test_coverage dev dependency (doesn't work for browser tests).
    • Updated README.md to better explain how to initialise SuffixRules.
    Open source →
    Release notes
    • Improved the suffix list format documentation in SuffixRules and the SuffixRulesHelpers.
    • Improved documentation of DomainUtils.
    • Fixed DomainUtils.isKnownSuffix not throwing if SuffixRules hasn't been initialised.
    • Removed the test_coverage dev dependency (doesn't work for browser tests).
    • Updated README.md to better explain how to initialise SuffixRules.
    Open source →
  5. 1.2.0 04 Sep 2019
    Release notes

    Additions

    • Added a hash map-based ruleMap to SuffixRules to speed up the performance when matching rules.
    • Added subdomain and icannSubdomain to PublicSuffix.
    • Added isSubdomainOf, hasKnownSuffix and hasValidDomain to PublicSuffix.
    • Added DomainUtils with the following static functions:
      • isSubdomainOf
      • isSubdomain
      • isKnownSuffix
      • hasValidDomain
    • Added PublicSuffix.fromString as a convenience method for PublicSuffix(Uri.parse(string)).

    Changes

    • Updated docs and parameter names to say URL instead of URI, which is more correct (PublicSuffix.sourceUri is unchanged to avoid breaking changes).
    Open source →
    Release notes
    • Added a hash map-based ruleMap to SuffixRules to speed up the performance when matching rules.
    • Added subdomain and icannSubdomain to PublicSuffix.
    • Added isSubdomainOf, hasKnownSuffix and hasValidDomain to PublicSuffix.
    • Added DomainUtils with the following static functions:
      • isSubdomainOf
      • isSubdomain
      • isKnownSuffix
      • hasValidDomain
    • Added PublicSuffix.fromString as a convenience method for PublicSuffix(Uri.parse(string)).
    • Updated docs and parameter names to say URL instead of URI, which is more correct (PublicSuffix.sourceUri is unchanged to avoid breaking changes).
    Open source →
  6. 1.1.0 24 Aug 2019
    Release notes

    Additions

    • Added primary library public_suffix.dart, which can be used without dart:io and dart:html (but still requires to be initialised with a suffix list).
    Open source →
    Release notes
    • Added primary library public_suffix.dart, which can be used without dart:io and dart:html (but still requires to be initialised with a suffix list).
    Open source →
  7. 1.0.0 24 Aug 2019
    Release notes

    This is the first release.

    Changelog

    • Load suffix rule lists from strings or URIs.
    • Parse URLs against suffix lists to obtain:
      • public suffix (e.g. co.uk)
      • root domain (e.g. google)
      • registrable domain (e.g. google.co.uk)
    • Obtain results with and without private (i.e. non-ICANN/IANA) suffix rules.
    • Obtain punycode encoded and decoded results (if a punycoded URL is parsed).
    Open source →
    Release notes
    • Load suffix rule lists from strings or URIs.
    • Parse URLs against suffix lists to obtain:
      • public suffix (e.g. co.uk)
      • root domain (e.g. google)
      • registrable domain (e.g. google.co.uk)
    • Obtain results with and without private (i.e. non-ICANN/IANA) suffix rules.
    • Obtain punycode encoded and decoded results (if a punycoded URL is parsed).
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive