Skip to content

Commit

Permalink
chore(core): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukaato committed Aug 13, 2024
1 parent 2025a13 commit e6e8574
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@cheese-grinder/stencil-component-config": "^0.3.0-beta.2",
"@cheese-grinder/stencil-component-config": "^0.3.0",
"@cheese-grinder/stencil-custom-readme": "^0.1.5",
"@cheese-grinder/stencil-sass-alias": "~0.2.4",
"@stencil/sass": "^3.0.12",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/config/components.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Configuration } from 'src/components-config';
import type { Configuration } from 'src/components-config';

type Options = Configuration.ComponentsConfig;

Expand All @@ -19,9 +19,9 @@ export class ComponentConfig {

apply<Tag extends keyof Options>(ref: any, tag: Tag, defaultValue: Options[Tag] & Record<string, any>): void {
const component = this.get(tag);
const uniqueKeys = new Set([...Object.keys(component!), ...Object.keys(defaultValue)]);
const uniqueKeys = new Set([...Object.keys(component), ...Object.keys(defaultValue)]);

[...uniqueKeys].forEach(key => (ref[key] ??= component![key] ?? defaultValue[key]));
[...uniqueKeys].forEach(key => (ref[key] ??= component[key] ?? defaultValue[key]));
}

setProp<Tag extends keyof Options, Prop extends keyof Options[Tag]>(
Expand All @@ -42,7 +42,7 @@ export class ComponentConfig {
fallback?: Options[Tag][Prop],
): Options[Tag][Prop] {
const config = this.get(component);
return config![prop] ?? (fallback as Options[Tag][Prop]);
return config[prop] ?? (fallback as Options[Tag][Prop]);
}
}

Expand Down

0 comments on commit e6e8574

Please sign in to comment.