From 551e18f793bbe2032a79d676fecf0b1a415cd16c Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Sun, 2 Jul 2023 19:34:46 +0200 Subject: [PATCH] update readme, replace useless json usage --- README.md | 1 + npm-manifest-check.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fbdc6de..af1ac65 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ positional arguments: optional arguments: -h, --help show this help message and exit + -r, --recursive recursively check all dependencies for mismatches -b, --brief do not show detailed comparisons of mismatching values -c, --color colorize the output ``` diff --git a/npm-manifest-check.py b/npm-manifest-check.py index ece3a1b..6906624 100755 --- a/npm-manifest-check.py +++ b/npm-manifest-check.py @@ -58,11 +58,11 @@ def parse_manifest(pkg): try: dependencies = latest_manifest['dependencies'] except KeyError: - dependencies = json.loads('{}') + dependencies = {} try: scripts = latest_manifest['scripts'] except KeyError: - scripts = json.loads('{}') + scripts = {} name = latest_manifest['name'] return Manifest(name, latest_ver, dependencies, scripts) @@ -96,11 +96,11 @@ def parse_actual_manifest(pkg, ver): try: dependencies = manifest['dependencies'] except KeyError: - dependencies = json.loads('{}') + dependencies = {} try: scripts = manifest['scripts'] except KeyError: - scripts = json.loads('{}') + scripts = {} name = manifest['name'] return Manifest(name, version, dependencies, scripts)