File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/react-native-node-api-modules/cpp Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11#include < utility> // std::move, std::pair, std::make_pair
22#include < vector> // std::vector
33#include < string> // std::string
4- #include < algorithm> // std::all_of
4+ #include < algorithm> // std::equal, std:: all_of
55#include < cctype> // std::isalnum
66#include " CxxNodeApiHostModule.hpp"
77#include " Logger.hpp"
@@ -10,6 +10,15 @@ using namespace facebook;
1010
1111namespace {
1212
13+ bool startsWith (const std::string &str, const std::string &prefix) {
14+ #if __cplusplus >= 202002L // __cpp_lib_starts_ends_with
15+ return str.starts_with (prefix);
16+ #else
17+ return str.size () >= prefix.size ()
18+ && std::equal (prefix.begin (), prefix.end (), str.begin ());
19+ #endif // __cplusplus >= 202002L
20+ }
21+
1322bool isModulePathLike (const std::string_view &path) {
1423 return std::all_of (path.begin (), path.end (), [](unsigned char c) {
1524 return std::isalnum (c) || ' _' == c || ' -' == c
You can’t perform that action at this time.
0 commit comments