(
wrapper: InstanceWrapper<T>,
inject: InjectorDependency[] | undefined,
metadata: InstanceWrapper[] | undefined,
)
| 1152 | } |
| 1153 | |
| 1154 | private hasDenseCtorMetadata<T>( |
| 1155 | wrapper: InstanceWrapper<T>, |
| 1156 | inject: InjectorDependency[] | undefined, |
| 1157 | metadata: InstanceWrapper[] | undefined, |
| 1158 | ): boolean { |
| 1159 | if (!metadata) { |
| 1160 | return false; |
| 1161 | } |
| 1162 | |
| 1163 | // The fast path requires a fully populated metadata array. |
| 1164 | // While another request is still registering dependency metadata, |
| 1165 | // sparse entries here would feed request-scoped factories `undefined`. |
| 1166 | const expectedDepsLength = !isNil(inject) |
| 1167 | ? inject.length |
| 1168 | : wrapper.metatype |
| 1169 | ? this.reflectConstructorParams(wrapper.metatype).length |
| 1170 | : 0; |
| 1171 | |
| 1172 | if (metadata.length !== expectedDepsLength) { |
| 1173 | return false; |
| 1174 | } |
| 1175 | |
| 1176 | for (let index = 0; index < expectedDepsLength; index++) { |
| 1177 | if (metadata[index] === undefined) { |
| 1178 | return false; |
| 1179 | } |
| 1180 | } |
| 1181 | |
| 1182 | return true; |
| 1183 | } |
| 1184 | |
| 1185 | private resolveScopedComponentHost( |
| 1186 | item: InstanceWrapper, |
no test coverage detected