MCPcopy
hub / github.com/prisma/prisma / intersectionType

Function intersectionType

packages/ts-builders/src/IntersectionType.ts:43–55  ·  view source on GitHub ↗
(types: MemberType[] | MemberType)

Source from the content-addressed store, hash-verified

41}
42
43export function intersectionType<MemberType extends TypeBuilder = TypeBuilder>(types: MemberType[] | MemberType) {
44 if (Array.isArray(types)) {
45 if (types.length === 0) {
46 throw new TypeError('Intersection types array can not be empty')
47 }
48 const intersection = new IntersectionType(types[0])
49 for (let i = 1; i < types.length; i++) {
50 intersection.addType(types[i])
51 }
52 return intersection
53 }
54 return new IntersectionType(types)
55}

Callers 3

mapTypesMethod · 0.85

Calls 1

addTypeMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…