Skip to content

Commit

Permalink
fix: properly handle undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Jan 18, 2024
1 parent 5e00c9a commit 94fe825
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/org/scratchOrgCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { Duration } from '@salesforce/kit';
import { Duration, toBoolean } from '@salesforce/kit';
import { ensureString } from '@salesforce/ts-types';
import { Messages } from '../messages';
import { Logger } from '../logger/logger';
Expand Down Expand Up @@ -341,5 +341,10 @@ const getSignupTargetLoginUrl = async (): Promise<string | undefined> => {

async function getCapitalizeRecordTypesConfig(): Promise<boolean | undefined> {
const configAgg = await ConfigAggregator.create();
return configAgg.getInfo('org-capitalize-record-types').value as boolean | undefined;
const value = configAgg.getInfo('org-capitalize-record-types').value as string | undefined;

if (value !== undefined) return toBoolean(value);

// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return value as undefined;
}

2 comments on commit 94fe825

@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: 94fe825 Previous: 5e00c9a Ratio
Child logger creation 473887 ops/sec (±1.29%) 480851 ops/sec (±0.43%) 1.01
Logging a string on root logger 737715 ops/sec (±6.89%) 799611 ops/sec (±8.92%) 1.08
Logging an object on root logger 498505 ops/sec (±8.39%) 574605 ops/sec (±5.15%) 1.15
Logging an object with a message on root logger 17553 ops/sec (±187.11%) 9702 ops/sec (±203.39%) 0.55
Logging an object with a redacted prop on root logger 377631 ops/sec (±7.33%) 421634 ops/sec (±7.31%) 1.12
Logging a nested 3-level object on root logger 321037 ops/sec (±9.15%) 361117 ops/sec (±8.08%) 1.12

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: 94fe825 Previous: 5e00c9a Ratio
Child logger creation 316884 ops/sec (±0.77%) 335050 ops/sec (±0.61%) 1.06
Logging a string on root logger 822330 ops/sec (±12.25%) 820925 ops/sec (±4.15%) 1.00
Logging an object on root logger 599653 ops/sec (±6.79%) 637473 ops/sec (±6.92%) 1.06
Logging an object with a message on root logger 3879 ops/sec (±220.21%) 5070 ops/sec (±209.66%) 1.31
Logging an object with a redacted prop on root logger 462591 ops/sec (±10.87%) 427237 ops/sec (±5.18%) 0.92
Logging a nested 3-level object on root logger 346534 ops/sec (±5.73%) 310264 ops/sec (±5.06%) 0.90

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

Please sign in to comment.