Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brijeshb42 committed Jun 10, 2024
1 parent 71bd651 commit 6332c56
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/pigment-css-react/src/createExtendSxProp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* to reduce bundle size only. DO NOT use it in your codebase.
*/
function extendSxProp(props) {
return props;
return { ...props };
}
export default function createExtendSxProp() {
return extendSxProp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import createExtendSxProp from '../../src/createExtendSxProp';
describe('createExtendSxProp', () => {
it('return the new copy of input', () => {
const original = { color: 'red' };
expect(createExtendSxProp()(original)).to.equal(original);
expect(createExtendSxProp()(original)).not.to.equal(original);
expect(createExtendSxProp()(original)).to.deep.equal({ color: 'red' });
});
});
2 changes: 1 addition & 1 deletion packages/pigment-css-unplugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
}
if (
id.includes('pigment-css-react/theme') ||
id === `${process.env.RUNTIME_PACKAGE_NAME}/theme`
id.includes(`${process.env.RUNTIME_PACKAGE_NAME}/theme`)
) {
return generateThemeSource(theme);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/pigment-css-vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export function pigment(options: PigmentOptions) {
name: 'vite-mui-theme-injection-plugin',
enforce: 'pre',
resolveId(source) {
if (source === `${process.env.RUNTIME_PACKAGE_NAME}/styles.css`) {
if (source.includes(`${process.env.RUNTIME_PACKAGE_NAME}/styles.css`)) {
return VIRTUAL_CSS_FILE;
}
if (source === `${process.env.RUNTIME_PACKAGE_NAME}/theme`) {
if (source.includes(`${process.env.RUNTIME_PACKAGE_NAME}/theme`)) {
return VIRTUAL_THEME_FILE;
}
return null;
Expand Down

0 comments on commit 6332c56

Please sign in to comment.