Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 3063x 2983x 3063x 80x 80x 80x 80x 80x 80x 3063x | // Copyright (c) ZeroC, Inc.
import { ToStringMode } from "./ToStringMode.js";
import { StringUtil } from "./StringUtil.js";
/**
* Converts an object identity to a string.
*
* @param ident The object identity to convert.
*
* @param toStringMode Specifies if and how non-printable ASCII characters are escaped in the result.
*
* @return The string representation of the object identity.
*/
export function identityToString(ident, toStringMode = ToStringMode.Unicode) {
if (ident.category === null || ident.category.length === 0) {
return StringUtil.escapeString(ident.name, "/", toStringMode);
} else {
return (
StringUtil.escapeString(ident.category, "/", toStringMode) +
"/" +
StringUtil.escapeString(ident.name, "/", toStringMode)
);
}
}
|