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
Releases
latest 7-
3.0.001 Apr 2021Release notes
Open source →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.
Release notes
Open source →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.
-
2.0.128 Nov 2020Release notes
Open source →Additions
- Add example/example.md to make the new examples show up on pub.dev.
Release notes
Open source →Additions
- Add example/example.md to make the new examples show up on pub.dev.
-
2.0.028 Nov 2020Release notes
Open source →API changes
SuffixRulesis no longer static.- Multiple instances can be created with different rule lists.
DefaultSuffixRuleshas been added to provide a statically accessible rules list with a similar API to the oldSuffixRules.PublicSuffixnow takes an optional argument when created to specify theSuffixRulesto use. If unspecified,DefaultSuffixRulesis used (similar to previous version).
- Move
SuffixRules.processandSuffixRules.validateto a new class,SuffixRulesParser. - The default constructor in
PublicSuffixnow takes either a String or a URL. - Add factory methods
PublicSuffix.fromStringand fromUrl with adjustable leniency for invalid URLs (fixes #4).- These allow creation of
PublicSuffixinstances without getting exceptions thrown if the URL is null/empty/invalid. See the documentation for full details.
- These allow creation of
- Rename
PublicSuffix.sourceUritoPublicSuffix.sourceUrl. - Remove export of
public_suffix.dartfrom the helper files. - Rename
public_suffix_io.dartandpublic_suffix_browser.darttoio_helper.dartandbrowser_helper.dart.
Additions
END PRIVATEis 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 aSuffixRulesinstance from an existing list ofRuleobjects.
Fixes
- Fix rule matching not working for rules with wildcards not in the first position (e.g.
a.*.c). - Allow null lists when creating
SuffixRulesobjects (treated as empty lists).
Release notes
Open source →API changes
SuffixRulesis no longer static.- Multiple instances can be created with different rule lists.
DefaultSuffixRuleshas been added to provide a statically accessible rules list with a similar API to the oldSuffixRules.PublicSuffixnow takes an optional argument when created to specify theSuffixRulesto use. If unspecified,DefaultSuffixRulesis used (similar to previous version).
- Move
SuffixRules.processandSuffixRules.validateto a new class,SuffixRulesParser. - The default constructor in
PublicSuffixnow takes either a String or a URL. - Add factory methods
PublicSuffix.fromStringand fromUrl with adjustable leniency for invalid URLs (fixes #4).- These allow creation of
PublicSuffixinstances without getting exceptions thrown if the URL is null/empty/invalid. See the documentation for full details.
- These allow creation of
- Rename
PublicSuffix.sourceUritoPublicSuffix.sourceUrl. - Remove export of
public_suffix.dartfrom the helper files. - Rename
public_suffix_io.dartandpublic_suffix_browser.darttoio_helper.dartandbrowser_helper.dart.
Additions
END PRIVATEis 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 aSuffixRulesinstance from an existing list ofRuleobjects.
Fixes
- Fix rule matching not working for rules with wildcards not in the first position (e.g.
a.*.c). - Allow null lists when creating
SuffixRulesobjects (treated as empty lists).
-
1.2.121 Sep 2019Release notes
Open source →Changes
- Improved the suffix list format documentation in
SuffixRulesand theSuffixRulesHelpers. - Improved documentation of
DomainUtils. - Fixed
DomainUtils.isKnownSuffixnot throwing ifSuffixRuleshasn't been initialised. - Removed the
test_coveragedev dependency (doesn't work for browser tests). - Updated README.md to better explain how to initialise
SuffixRules.
Release notes
Open source →- Improved the suffix list format documentation in
SuffixRulesand theSuffixRulesHelpers. - Improved documentation of
DomainUtils. - Fixed
DomainUtils.isKnownSuffixnot throwing ifSuffixRuleshasn't been initialised. - Removed the
test_coveragedev dependency (doesn't work for browser tests). - Updated README.md to better explain how to initialise
SuffixRules.
- Improved the suffix list format documentation in
-
1.2.004 Sep 2019Release notes
Open source →Additions
- Added a hash map-based
ruleMaptoSuffixRulesto speed up the performance when matching rules. - Added
subdomainandicannSubdomaintoPublicSuffix. - Added
isSubdomainOf,hasKnownSuffixandhasValidDomaintoPublicSuffix. - Added
DomainUtilswith the following static functions:isSubdomainOfisSubdomainisKnownSuffixhasValidDomain
- Added
PublicSuffix.fromStringas a convenience method forPublicSuffix(Uri.parse(string)).
Changes
- Updated docs and parameter names to say URL instead of URI, which is more correct (
PublicSuffix.sourceUriis unchanged to avoid breaking changes).
Release notes
Open source →- Added a hash map-based
ruleMaptoSuffixRulesto speed up the performance when matching rules. - Added
subdomainandicannSubdomaintoPublicSuffix. - Added
isSubdomainOf,hasKnownSuffixandhasValidDomaintoPublicSuffix. - Added
DomainUtilswith the following static functions:isSubdomainOfisSubdomainisKnownSuffixhasValidDomain
- Added
PublicSuffix.fromStringas a convenience method forPublicSuffix(Uri.parse(string)). - Updated docs and parameter names to say URL instead of URI, which is more correct (
PublicSuffix.sourceUriis unchanged to avoid breaking changes).
- Added a hash map-based
-
1.1.024 Aug 2019Release notes
Open source →Additions
- Added primary library
public_suffix.dart, which can be used withoutdart:ioanddart:html(but still requires to be initialised with a suffix list).
Release notes
Open source →- Added primary library
public_suffix.dart, which can be used withoutdart:ioanddart:html(but still requires to be initialised with a suffix list).
- Added primary library
-
1.0.024 Aug 2019Release notes
Open source →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)
- public suffix (e.g.
- 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).
Release notes
Open source →- 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)
- public suffix (e.g.
- 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).