• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

realm / realm-core / github_pull_request_312964

19 Feb 2025 07:31PM UTC coverage: 90.814% (-0.3%) from 91.119%
github_pull_request_312964

Pull #8071

Evergreen

web-flow
Bump serialize-javascript and mocha

Bumps [serialize-javascript](https://github.com/yahoo/serialize-javascript) to 6.0.2 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together.


Updates `serialize-javascript` from 6.0.0 to 6.0.2
- [Release notes](https://github.com/yahoo/serialize-javascript/releases)
- [Commits](https://github.com/yahoo/serialize-javascript/compare/v6.0.0...v6.0.2)

Updates `mocha` from 10.2.0 to 10.8.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.2.0...v10.8.2)

---
updated-dependencies:
- dependency-name: serialize-javascript
  dependency-type: indirect
- dependency-name: mocha
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #8071: Bump serialize-javascript and mocha

96552 of 179126 branches covered (53.9%)

212672 of 234185 relevant lines covered (90.81%)

3115802.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.07
/src/realm/util/bson/regular_expression.cpp
1
/*************************************************************************
2
 *
3
 * Copyright 2020 Realm Inc.
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 *
17
 **************************************************************************/
18

19
#include <realm/util/bson/regular_expression.hpp>
20
#include <numeric>
21

22
namespace realm {
23
namespace bson {
24

25
RegularExpression::RegularExpression(const std::string pattern, const std::string& options)
26
    : m_pattern(pattern)
10✔
27
    , m_options(std::accumulate(options.begin(), options.end(), RegularExpression::Option::None,
10✔
28
                                [](RegularExpression::Option a, char b) {
11✔
29
                                    return a | option_char_to_option(b);
11✔
30
                                }))
11✔
31
{
10✔
32
}
10✔
33

34
RegularExpression::RegularExpression(const std::string pattern, Option options)
35
    : m_pattern(pattern)
×
36
    , m_options(options)
×
37
{
×
38
}
×
39

40
const std::string RegularExpression::pattern() const
41
{
17✔
42
    return m_pattern;
17✔
43
}
17✔
44

45
RegularExpression::Option RegularExpression::options() const
46
{
23✔
47
    return m_options;
23✔
48
}
23✔
49

50
constexpr RegularExpression::Option RegularExpression::option_char_to_option(const char option)
51
{
11✔
52
    switch (option) {
11✔
53
        case 'i':
5✔
54
            return Option::IgnoreCase;
5✔
55
        case 'm':
4✔
56
            return Option::Multiline;
4✔
57
        case 's':
✔
58
            return Option::Dotall;
×
59
        case 'x':
2✔
60
            return Option::Extended;
2✔
61
        default:
✔
62
            throw std::runtime_error("invalid regex option type");
×
63
    }
11✔
64
}
11✔
65

66
std::ostream& operator<<(std::ostream& out, const RegularExpression::Option& option)
67
{
6✔
68
    using Option = RegularExpression::Option;
6✔
69

70
    if ((option & Option::IgnoreCase) != Option::None)
6✔
71
        out << 'i';
3✔
72
    if ((option & Option::Multiline) != Option::None)
6✔
73
        out << 'm';
2✔
74
    if ((option & Option::Dotall) != Option::None)
6✔
75
        out << 's';
×
76
    if ((option & Option::Extended) != Option::None)
6✔
77
        out << 'x';
1✔
78

79
    return out;
6✔
80
}
6✔
81

82
} // namespace bson
83
} // namespace realm
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc