Browse Source
Merge pull request #24616 from abpframework/auto-merge/rel-10-0/4269
Merge branch rel-10.1 with rel-10.0
pull/24617/head
Ma Liming
4 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
22 additions and
1 deletions
-
npm/ng-packs/packages/schematics/src/utils/methods.ts
-
npm/ng-packs/packages/schematics/src/utils/service.ts
|
|
|
@ -19,4 +19,9 @@ export const getParamValueName = (paramName: string, descriptorName: string) => |
|
|
|
export function isDictionaryType(type?: string, typeSimple?: string): boolean { |
|
|
|
const haystacks = [type || '', typeSimple || '']; |
|
|
|
return haystacks.some(t => /(^|\b)(System\.Collections\.Generic\.)?(I)?Dictionary\s*</.test(t)); |
|
|
|
} |
|
|
|
|
|
|
|
export function isCollectionType(type?: string, typeSimple?: string): boolean { |
|
|
|
const haystacks = [type || '', typeSimple || '']; |
|
|
|
return haystacks.some(t => /(^|\b)(System\.Collections\.Generic\.)?(I)?(List|Enumerable|Collection)\s*</.test(t)); |
|
|
|
} |
|
|
|
@ -14,6 +14,8 @@ import { |
|
|
|
import { sortImports } from './import'; |
|
|
|
import { parseNamespace } from './namespace'; |
|
|
|
import { parseGenerics } from './tree'; |
|
|
|
import { extractGenerics } from './generics'; |
|
|
|
import { isCollectionType } from './methods'; |
|
|
|
import { |
|
|
|
createTypeAdapter, |
|
|
|
createTypeParser, |
|
|
|
@ -144,7 +146,21 @@ export function isRemoteStreamContent(type: string) { |
|
|
|
} |
|
|
|
|
|
|
|
export function isRemoteStreamContentArray(type: string) { |
|
|
|
return VOLO_REMOTE_STREAM_CONTENT.map(x => `${x}[]`).some(x => x === type); |
|
|
|
// Check for array types like Volo.Abp.Content.IRemoteStreamContent[]
|
|
|
|
if (VOLO_REMOTE_STREAM_CONTENT.map(x => `${x}[]`).some(x => x === type)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
// Check for collection types like List<T>, IEnumerable<T>, ICollection<T>, Collection<T>, IList<T>
|
|
|
|
// This matches any generic type from System.Collections.Generic that implements IEnumerable<T>
|
|
|
|
if (isCollectionType(type)) { |
|
|
|
const { generics } = extractGenerics(type); |
|
|
|
if (generics.length > 0 && VOLO_REMOTE_STREAM_CONTENT.includes(generics[0])) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
function getMethodNameFromAction(action: Action): string { |
|
|
|
|