diff --git a/src/sfProject.ts b/src/sfProject.ts index 77f0c04a7..c297d6840 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -729,10 +729,14 @@ export class SfProject { /** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (package and maybe a LOT of other fields) by whether is has the `package` property */ export const isPackagingDirectory = (packageDir: PackageDir): packageDir is PackagePackageDir => - 'package' in packageDir && typeof packageDir.package === 'string'; + isPackagingDir(packageDir); + +/** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (package and maybe a LOT of other fields) by whether is has the `package` property */ export const isNamedPackagingDirectory = (packageDir: NamedPackageDir): packageDir is NamedPackagingDir => - 'package' in packageDir && typeof packageDir.package === 'string'; + isPackagingDir(packageDir); +const isPackagingDir = (packageDir: PackageDir | NamedPackageDir): boolean => + 'package' in packageDir && typeof packageDir.package === 'string'; /** * there is no notion of uniqueness in package directory entries * so an attempt of matching an existing entry is a bit convoluted