MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / getTransformedText

Function getTransformedText

packages/core/ui/text-base/index.ios.ts:486–501  ·  view source on GitHub ↗
(text: string, textTransform: CoreTypes.TextTransformType)

Source from the content-addressed store, hash-verified

484}
485
486export function getTransformedText(text: string, textTransform: CoreTypes.TextTransformType): string {
487 if (!text || !isString(text)) {
488 return '';
489 }
490
491 switch (textTransform) {
492 case 'uppercase':
493 return NSStringFromNSAttributedString(text).uppercaseString;
494 case 'lowercase':
495 return NSStringFromNSAttributedString(text).lowercaseString;
496 case 'capitalize':
497 return NSStringFromNSAttributedString(text).capitalizedString;
498 default:
499 return text;
500 }
501}
502
503function NSStringFromNSAttributedString(source: NSAttributedString | string): NSString {
504 return NSString.stringWithString((source instanceof NSAttributedString && source.string) || <string>source);

Callers 4

_updateMethod · 0.90
_setNativeTextMethod · 0.70

Calls 2

isStringFunction · 0.90

Tested by

no test coverage detected