ServiceStack.NativeTypes.TypeScript.TypeScriptGenerator.TypeAlias C# (CSharp) Method

TypeAlias() private method

private TypeAlias ( string type ) : string
type string
return string
        private string TypeAlias(string type)
        {
            type = type.SanitizeType();
            if (type == "Byte[]")
                return TypeAliases["Byte[]"];

            var arrParts = type.SplitOnFirst('[');
            if (arrParts.Length > 1)
                return "{0}[]".Fmt(TypeAlias(arrParts[0]));

            string typeAlias;
            TypeAliases.TryGetValue(type, out typeAlias);

            return typeAlias ?? NameOnly(type);
        }