Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
shrinktofit committed Aug 8, 2023
1 parent 8d8fa16 commit 6a24bc0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cocos/serialization/compiled/builtin-value-type.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JSB } from 'internal:constants';
import { Vec2, Vec3, Vec4, Color, Size, Rect, Quat, Mat4, assertIsTrue } from '../../core';
import { Vec2, Vec3, Vec4, Color, Size, Rect, Quat, Mat4, assertIsTrue, ValueType } from '../../core';
import type { IRuntimeFileData } from '../deserialize';

const constructorMap = [
Expand Down Expand Up @@ -69,10 +69,7 @@ const setterMap: SetterMap = [
},
];

export function serializeBuiltinValueType (obj: unknown): ValueTypeData | null {
if (typeof obj !== 'object' || !obj) {
return null;
}
export function serializeBuiltinValueType (obj: ValueType): ValueTypeData | null {
const ctor = obj.constructor;
const typeId = (constructorMap as readonly any[]).indexOf(ctor);
switch (ctor) {
Expand Down

0 comments on commit 6a24bc0

Please sign in to comment.