mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-30 18:15:46 +03:00
nodejs fix: empty dependencies not detected sometimes
This commit is contained in:
parent
1beb1eaab5
commit
c6723cb1a5
@ -2,8 +2,7 @@
|
||||
l = lib // builtins;
|
||||
in rec {
|
||||
getPackageJsonDeps = packageJson: noDev:
|
||||
packageJson.dependencies
|
||||
or {}
|
||||
(packageJson.dependencies or {})
|
||||
// (lib.optionalAttrs (! noDev) (packageJson.devDependencies or {}));
|
||||
|
||||
getWorkspaceLockFile = tree: project: fname: let
|
||||
@ -17,9 +16,9 @@ in rec {
|
||||
(tree.getNodeFromPath "${dirRelPath}/package.json").jsonContent;
|
||||
|
||||
hasNoDependencies =
|
||||
! packageJson ? dependencies
|
||||
&& ! packageJson ? devDependencies
|
||||
&& ! packageJson ? workspaces;
|
||||
((packageJson.dependencies or {}) == {})
|
||||
&& ((packageJson.devDependencies or {}) == {})
|
||||
&& (! packageJson ? workspaces);
|
||||
in
|
||||
if hasNoDependencies
|
||||
then null
|
||||
|
Loading…
Reference in New Issue
Block a user