Skip to content

Commit

Permalink
fix: 处理last rest 类型
Browse files Browse the repository at this point in the history
  • Loading branch information
pearone committed Oct 7, 2023
1 parent 4531557 commit d57e2b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/event/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dpdfe/event-utils",
"version": "0.0.24",
"version": "0.0.25",
"description": "通用方法",
"author": "pearone",
"homepage": "https://github.com/DPDFE/react-layout/tree/main/packages/event",
Expand Down
13 changes: 9 additions & 4 deletions packages/event/src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ export const log = (...args: any[]) => {
const style: {
color: string;
background: string;
version: string;
} = typeof last_rest === 'object' ? last_rest : {};

const _style = `color:${style.color}; background: ${style.background}; font-size: 12px`;
const _style = `color:${style?.color}; background: ${style?.background}; font-size: 12px`;

let version = 'v0.0.1';
if (last_rest.color || last_rest.background || last_rest.version) {
if (last_rest.version) {
version = last_rest.version;
if (
style.color != undefined ||
style.background != undefined ||
style.version != undefined
) {
if (style.version != undefined) {
version = style.version;
}
args.pop();
}
Expand Down

0 comments on commit d57e2b7

Please sign in to comment.