Skip to content

Commit

Permalink
refactor: simplify logic for PackagingDir
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jun 17, 2024
1 parent 8a22ca1 commit 60ae76c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sfProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,14 @@ export class SfProject {

/** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (package and maybe a LOT of other fields) by whether is has the `package` property */
export const isPackagingDirectory = (packageDir: PackageDir): packageDir is PackagePackageDir =>
'package' in packageDir && typeof packageDir.package === 'string';
isPackagingDir(packageDir);

/** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (package and maybe a LOT of other fields) by whether is has the `package` property */
export const isNamedPackagingDirectory = (packageDir: NamedPackageDir): packageDir is NamedPackagingDir =>
'package' in packageDir && typeof packageDir.package === 'string';
isPackagingDir(packageDir);

const isPackagingDir = (packageDir: PackageDir | NamedPackageDir): boolean =>
'package' in packageDir && typeof packageDir.package === 'string';
/**
* there is no notion of uniqueness in package directory entries
* so an attempt of matching an existing entry is a bit convoluted
Expand Down

2 comments on commit 60ae76c

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: 60ae76c Previous: 8a22ca1 Ratio
Child logger creation 479106 ops/sec (±0.48%) 474988 ops/sec (±1.33%) 0.99
Logging a string on root logger 751019 ops/sec (±7.15%) 787698 ops/sec (±11.99%) 1.05
Logging an object on root logger 554338 ops/sec (±7.96%) 616533 ops/sec (±6.85%) 1.11
Logging an object with a message on root logger 10703 ops/sec (±198.75%) 5320 ops/sec (±215.03%) 0.50
Logging an object with a redacted prop on root logger 458888 ops/sec (±11.26%) 457319 ops/sec (±11.79%) 1.00
Logging a nested 3-level object on root logger 345880 ops/sec (±8.18%) 376829 ops/sec (±9.11%) 1.09

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: 60ae76c Previous: 8a22ca1 Ratio
Child logger creation 323126 ops/sec (±0.75%) 349014 ops/sec (±0.37%) 1.08
Logging a string on root logger 721665 ops/sec (±5.62%) 793860 ops/sec (±7.25%) 1.10
Logging an object on root logger 590589 ops/sec (±5.42%) 628105 ops/sec (±6.36%) 1.06
Logging an object with a message on root logger 8185 ops/sec (±200.28%) 4511 ops/sec (±210.16%) 0.55
Logging an object with a redacted prop on root logger 482369 ops/sec (±12.23%) 454907 ops/sec (±11.59%) 0.94
Logging a nested 3-level object on root logger 341088 ops/sec (±5.00%) 327353 ops/sec (±5.60%) 0.96

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.