Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Dec 7, 2024
1 parent 4fd541e commit 923879e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/finder.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export class Finder
paths = if pathEnv then pathEnv.split(if Finder.isWindows then ";" else delimiter) else []

# The list of executable file extensions.
@extensions = new Set extensions.map (extension) -> extension.toLowerCase()
@extensions = new Set extensions.map ($) -> $.toLowerCase()

# The list of system paths.
@paths = new Set paths.map((item) -> item.replace /^"|"$/g, "").filter (item) -> item.length
@paths = new Set paths.map(($) -> $.replace /^"|"$/g, "").filter ($) -> $.length

# Value indicating whether the current platform is Windows.
Object.defineProperty @, "isWindows",
Expand Down
4 changes: 2 additions & 2 deletions test/finder_test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ describe "Finder", ->
describe "constructor()", ->
it "should set the `paths` property to the value of the `PATH` environment variable by default", ->
pathEnv = env.PATH or ""
paths = new Set if pathEnv then pathEnv.split(if Finder.isWindows then ";" else delimiter).filter (item) -> item.length else []
paths = new Set if pathEnv then pathEnv.split(if Finder.isWindows then ";" else delimiter).filter ($) -> $.length else []
equal new Finder().paths.symmetricDifference(paths).size, 0

it "should set the `extensions` property to the value of the `PATHEXT` environment variable by default", ->
pathExt = env.PATHEXT or ""
extensions = new Set if pathExt then pathExt.split(";").map (item) -> item.toLowerCase() else [".exe", ".cmd", ".bat", ".com"]
extensions = new Set if pathExt then pathExt.split(";").map ($) -> $.toLowerCase() else [".exe", ".cmd", ".bat", ".com"]
equal new Finder().extensions.symmetricDifference(extensions).size, 0

it "should put in lower case the list of file extensions", ->
Expand Down

0 comments on commit 923879e

Please sign in to comment.