From 8822874046d3fdd1c4d462715428451cef7226f5 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 7 Feb 2023 17:32:41 -0500 Subject: [PATCH] deps: update ada to v1.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniel Lemire PR-URL: https://github.com/nodejs/node/pull/46550 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Gerhard Stöbich Reviewed-By: Tiancheng "Timothy" Gu --- deps/ada/LICENSE-MIT | 18 ++++++++++++++++++ deps/ada/ada.cpp | 19 ++++++++++--------- deps/ada/ada.h | 11 ++++++++--- 3 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 deps/ada/LICENSE-MIT diff --git a/deps/ada/LICENSE-MIT b/deps/ada/LICENSE-MIT new file mode 100644 index 00000000000000..9f3e50e0db7856 --- /dev/null +++ b/deps/ada/LICENSE-MIT @@ -0,0 +1,18 @@ +Copyright 2023 Ada authors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp index e09f93bb225c60..3ddc5cd305325a 100644 --- a/deps/ada/ada.cpp +++ b/deps/ada/ada.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2023-02-06 08:25:59 -0500. Do not edit! */ +/* auto-generated on 2023-02-07 17:26:54 -0500. Do not edit! */ // dofile: invoked with prepath=/Users/yagiz/Developer/url-parser/src, filename=ada.cpp /* begin file src/ada.cpp */ #include "ada.h" @@ -970,6 +970,13 @@ namespace ada::helpers { } while (true); } } + + ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept { + if (!url.has_opaque_path) return; + if (url.fragment.has_value()) return; + if (url.query.has_value()) return; + while (!url.path.empty() && url.path.back() == ' ') { url.path.resize(url.path.size()-1); } + } } // namespace ada::helpers namespace ada { @@ -1650,7 +1657,7 @@ namespace ada { void url::set_hash(const std::string_view input) { if (input.empty()) { fragment = std::nullopt; - // TODO: Potentially strip trailing spaces from an opaque path with this. + helpers::strip_trailing_spaces_from_opaque_path(*this); return; } @@ -1664,9 +1671,7 @@ namespace ada { void url::set_search(const std::string_view input) { if (input.empty()) { query = std::nullopt; - // Empty this’s query object’s list. - // @todo Implement this if/when we have URLSearchParams. - // Potentially strip trailing spaces from an opaque path with this. + helpers::strip_trailing_spaces_from_opaque_path(*this); return; } @@ -1679,10 +1684,6 @@ namespace ada { ada::character_sets::QUERY_PERCENT_ENCODE; query = ada::unicode::percent_encode(std::string_view(new_value), query_percent_encode_set); - - // Set this’s query object’s list to the result of parsing input. - // @todo Implement this if/when we have URLSearchParams. - return ; } bool url::set_pathname(const std::string_view input) { diff --git a/deps/ada/ada.h b/deps/ada/ada.h index 00203ccd00bbe3..792148af893470 100644 --- a/deps/ada/ada.h +++ b/deps/ada/ada.h @@ -1,4 +1,4 @@ -/* auto-generated on 2023-02-06 08:25:59 -0500. Do not edit! */ +/* auto-generated on 2023-02-07 17:26:54 -0500. Do not edit! */ // dofile: invoked with prepath=/Users/yagiz/Developer/url-parser/include, filename=ada.h /* begin file include/ada.h */ /** @@ -1774,6 +1774,11 @@ namespace ada::helpers { */ ada_really_inline void trim_c0_whitespace(std::string_view& input) noexcept; + /** + * @see https://url.spec.whatwg.org/#potentially-strip-trailing-spaces-from-an-opaque-path + */ + ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept; + } // namespace ada::helpers #endif // ADA_HELPERS_H @@ -4328,14 +4333,14 @@ namespace ada { #ifndef ADA_ADA_VERSION_H #define ADA_ADA_VERSION_H -#define ADA_VERSION "1.0.0" +#define ADA_VERSION "1.0.1" namespace ada { enum { ADA_VERSION_MAJOR = 1, ADA_VERSION_MINOR = 0, - ADA_VERSION_REVISION = 0, + ADA_VERSION_REVISION = 1, }; } // namespace ada