deps: update ada to v1.0.1

Co-authored-by: Daniel Lemire <daniel@lemire.me>
PR-URL: https://github.com/nodejs/node/pull/46550
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
This commit is contained in:
Yagiz NizipliandDaniel Lemire authored and Myles Borins committed 2023-02-20 14:16:30 -05:00
1 parent 87df34ac28
commit 20cb13bf7f
3 files changed
+36 -12

No files matched your search

+18
View File
@@ -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.
+10 -9
View File
@@ -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) {
+8 -3
View File
@@ -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