Skip to content

Commit

Permalink
removed: extra cond
Browse files Browse the repository at this point in the history
  • Loading branch information
binjospookie committed Dec 29, 2023
1 parent 10a1247 commit 611cee0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pure-index",
"type": "module",
"version": "0.0.37",
"version": "0.0.38",
"description": "Utility for monorepos. It helps to find unused exports from packages or get a list of all unique uses of any package",
"main": "./src/index.js",
"bin": "./bin/index.js",
Expand Down
4 changes: 0 additions & 4 deletions src/baseFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const baseFlow = async ({ config }) => {

await fileTraversal({ config, pkg, cmd: exports.delete.bind(exports) })

if (exports.size === 0) {
statusApi.succeed()
}

if (exports.size === originalExportsSize) {
statusApi.failed({
msg: `Nothing is imported from ${pkg.name}. Remove it.`
Expand Down
1 change: 1 addition & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ const createStatusAPI = ({ title }) => {
export { readFile, readJSON, createStatusAPI }
export { getRepoRoot } from './getRepoRoot.js'
export { ObservableSet } from './observableSet.js'
export { Result } from './result.js'
17 changes: 17 additions & 0 deletions src/utils/result.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Result {
constructor(isSuccess, value, error) {
this.isSuccess = isSuccess
this.value = value
this.error = error
}

static Ok(value) {
return new Result(true, value, null)
}

static Err(error) {
return new Result(false, null, error)
}
}

export { Result }

0 comments on commit 611cee0

Please sign in to comment.