[kbn-pm] Stricter types when creating maps (#16848)

This commit is contained in:
Kim Joar Bekkelund 2018-02-21 21:51:33 +01:00 committed by GitHub
parent eae414ac32
commit 293f280b14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -7,6 +7,7 @@ import {
getProjects,
buildProjectGraph,
topologicallyBatchProjects,
ProjectMap,
} from '../utils/projects';
import {
createProductionPackageJson,
@ -53,7 +54,7 @@ async function getProductionProjects(
) {
const projects = await getProjects(kibanaRoot, projectPaths);
const buildProjects = new Map();
const buildProjects: ProjectMap = new Map();
for (const [name, project] of projects.entries()) {
if (!project.skipFromBuild()) {
buildProjects.set(name, project);

View file

@ -16,7 +16,7 @@ export async function getProjects(
rootPath: string,
projectsPathsPatterns: string[]
) {
const projects = new Map();
const projects: ProjectMap = new Map();
for (const pattern of projectsPathsPatterns) {
const pathsToProcess = await packagesFromGlobPattern({ pattern, rootPath });
@ -31,7 +31,7 @@ export async function getProjects(
`There are multiple projects with the same name [${project.name}]`,
{
name: project.name,
paths: [project.path, projects.get(project.name).path],
paths: [project.path, projects.get(project.name)!.path],
}
);
}
@ -75,7 +75,7 @@ function normalize(dir: string) {
}
export function buildProjectGraph(projects: ProjectMap) {
const projectGraph = new Map();
const projectGraph: ProjectGraph = new Map();
for (const project of projects.values()) {
const projectDeps = [];