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

FontoXML / fontoxpath / 10652762231

01 Sep 2024 09:15AM UTC coverage: 91.567%. Remained the same
10652762231

Pull #648

github

web-flow
Bump karma from 6.4.2 to 6.4.4

Bumps [karma](https://github.com/karma-runner/karma) from 6.4.2 to 6.4.4.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.4.2...v6.4.4)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #648: Bump karma from 6.4.2 to 6.4.4

5002 of 5811 branches covered (86.08%)

Branch coverage included in aggregate %.

10775 of 11419 relevant lines covered (94.36%)

96665.35 hits per line

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

20.0
/src/expressions/dataTypes/casting/castToNumeric.ts
1
import { ValueType } from '../Value';
2
import CastResult from './CastResult';
3

4
const numericTypes = [
15✔
5
        ValueType.XSDOUBLE,
6
        ValueType.XSFLOAT,
7
        ValueType.XSDECIMAL,
8
        ValueType.XSINTEGER,
9
];
10

11
export default function castToNumeric(
15✔
12
        inputType: ValueType,
13
        castToPrimitiveType: (
14
                inputType: ValueType,
15
                outputType: ValueType,
16
        ) => (value: any) => CastResult,
17
): (value: any) => CastResult {
18
        return (value) => {
×
19
                for (const outputType of numericTypes) {
×
20
                        const result = castToPrimitiveType(inputType, outputType)(value);
×
21
                        if (result.successful) {
×
22
                                return result;
×
23
                        }
24
                }
25
                // In the case of failure, return the result of the last attempt
26
                return {
×
27
                        successful: false,
28
                        error: new Error(
29
                                `XPTY0004: Casting not supported from "${value}" given type to xs:numeric or any of its derived types.`,
30
                        ),
31
                };
32
        };
33
}
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

© 2025 Coveralls, Inc