@socketsecurity/cli-with-sentry 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -147,19 +147,26 @@ async function readJson(filepath, options) {
147
147
  options = { encoding: options }
148
148
  }
149
149
  const { reviver, throws, ...fsOptions } = { __proto__: null, ...options }
150
+ const shouldThrow = throws === undefined || !!throws
150
151
  const fs = getFs()
151
- return jsonParse(
152
- await fs.promises.readFile(filepath, {
152
+ let content = ''
153
+ try {
154
+ content = await fs.promises.readFile(filepath, {
153
155
  __proto__: null,
154
156
  encoding: 'utf8',
155
157
  ...fsOptions
156
- }),
157
- {
158
- filepath,
159
- reviver,
160
- throws
158
+ })
159
+ } catch (e) {
160
+ if (shouldThrow) {
161
+ throw e
161
162
  }
162
- )
163
+ return null
164
+ }
165
+ return jsonParse(content, {
166
+ filepath,
167
+ reviver,
168
+ throws: shouldThrow
169
+ })
163
170
  }
164
171
 
165
172
  /*@__NO_SIDE_EFFECTS__*/
@@ -168,19 +175,26 @@ function readJsonSync(filepath, options) {
168
175
  options = { encoding: options }
169
176
  }
170
177
  const { reviver, throws, ...fsOptions } = { __proto__: null, ...options }
178
+ const shouldThrow = throws === undefined || !!throws
171
179
  const fs = getFs()
172
- return jsonParse(
173
- fs.readFileSync(filepath, {
180
+ let content = ''
181
+ try {
182
+ content = fs.readFileSync(filepath, {
174
183
  __proto__: null,
175
184
  encoding: 'utf8',
176
185
  ...fsOptions
177
- }),
178
- {
179
- filepath,
180
- reviver,
181
- throws
186
+ })
187
+ } catch (e) {
188
+ if (shouldThrow) {
189
+ throw e
182
190
  }
183
- )
191
+ return null
192
+ }
193
+ return jsonParse(content, {
194
+ filepath,
195
+ reviver,
196
+ throws: shouldThrow
197
+ })
184
198
  }
185
199
 
186
200
  /*@__NO_SIDE_EFFECTS__*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/cli-with-sentry",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "CLI for Socket.dev, includes Sentry error handling, otherwise identical to the regular `socket` package",
5
5
  "homepage": "https://github.com/SocketDev/socket-cli",
6
6
  "license": "MIT",
@@ -79,18 +79,18 @@
79
79
  "update:deps": "npx --yes npm-check-updates"
80
80
  },
81
81
  "devDependencies": {
82
- "@babel/core": "7.28.3",
82
+ "@babel/core": "7.28.4",
83
83
  "@babel/plugin-proposal-export-default-from": "7.27.1",
84
84
  "@babel/plugin-transform-export-namespace-from": "7.27.1",
85
85
  "@babel/plugin-transform-runtime": "7.28.3",
86
86
  "@babel/preset-typescript": "7.27.1",
87
- "@babel/runtime": "7.28.3",
88
- "@biomejs/biome": "2.2.2",
87
+ "@babel/runtime": "7.28.4",
88
+ "@biomejs/biome": "2.2.3",
89
89
  "@coana-tech/cli": "14.12.17",
90
90
  "@cyclonedx/cdxgen": "11.7.0",
91
91
  "@dotenvx/dotenvx": "1.49.0",
92
92
  "@eslint/compat": "1.3.2",
93
- "@eslint/js": "9.34.0",
93
+ "@eslint/js": "9.35.0",
94
94
  "@npmcli/arborist": "9.1.4",
95
95
  "@npmcli/config": "10.4.0",
96
96
  "@octokit/graphql": "9.0.1",
@@ -113,8 +113,8 @@
113
113
  "@socketregistry/is-interactive": "1.0.6",
114
114
  "@socketregistry/packageurl-js": "1.0.9",
115
115
  "@socketsecurity/config": "3.0.1",
116
- "@socketsecurity/registry": "1.0.281",
117
- "@socketsecurity/sdk": "1.4.85",
116
+ "@socketsecurity/registry": "1.0.282",
117
+ "@socketsecurity/sdk": "1.4.86",
118
118
  "@types/blessed": "0.1.25",
119
119
  "@types/cmd-shim": "5.0.2",
120
120
  "@types/js-yaml": "4.0.9",
@@ -138,7 +138,7 @@
138
138
  "custompatch": "1.1.8",
139
139
  "del-cli": "6.0.0",
140
140
  "dev-null-cli": "2.0.0",
141
- "eslint": "9.34.0",
141
+ "eslint": "9.35.0",
142
142
  "eslint-import-resolver-typescript": "4.4.4",
143
143
  "eslint-plugin-import-x": "4.16.1",
144
144
  "eslint-plugin-n": "17.21.3",
@@ -177,7 +177,8 @@
177
177
  "which": "5.0.0",
178
178
  "yaml": "2.8.1",
179
179
  "yargs-parser": "22.0.0",
180
- "yoctocolors-cjs": "2.1.3"
180
+ "yoctocolors-cjs": "2.1.3",
181
+ "zod": "4.1.5"
181
182
  },
182
183
  "overrides": {
183
184
  "@octokit/graphql": "$@octokit/graphql",