MCPcopy Create free account
hub / github.com/denoland/std / decimalCharCodeToNumber

Function decimalCharCodeToNumber

yaml/_loader_state.ts:117–121  ·  view source on GitHub ↗

* Converts a decimal character code to its decimal value.

(charCode: number)

Source from the content-addressed store, hash-verified

115 * Converts a decimal character code to its decimal value.
116 */
117function decimalCharCodeToNumber(charCode: number): number {
118 // Check if the character code is in the range for '0' to '9'
119 if (0x30 <= charCode && charCode <= 0x39) return charCode - 0x30; // Convert '0'-'9' to 0-9
120 return -1;
121}
122
123/**
124 * Converts a Unicode code point to a string.

Callers 1

readBlockScalarMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected