feat: add type for value in dev
This commit is contained in:
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSUInteger, DoricJSRemoteArgType) {
|
||||
DoricJSRemoteArgTypeNil = 0,
|
||||
DoricJSRemoteArgTypeInteger,
|
||||
DoricJSRemoteArgTypeNumber,
|
||||
DoricJSRemoteArgTypeBool,
|
||||
DoricJSRemoteArgTypeString,
|
||||
DoricJSRemoteArgTypeObject,
|
||||
@@ -20,4 +20,5 @@ typedef NS_ENUM(NSUInteger, DoricJSRemoteArgType) {
|
||||
|
||||
DoricJSRemoteArgType DoricargTypeWithArg(id arg);
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -6,7 +6,16 @@
|
||||
//
|
||||
|
||||
#import "DoricJSRemoteArgType.h"
|
||||
DoricJSRemoteArgType DoricargTypeWithArg(id arg) {
|
||||
// TODO: 类型缺失
|
||||
return DoricJSRemoteArgTypeString;
|
||||
DoricJSRemoteArgType DoricargTypeWithArg(id arg) {
|
||||
DoricJSRemoteArgType type = DoricJSRemoteArgTypeNil;
|
||||
if ([arg isKindOfClass:[NSNumber class]]) {
|
||||
type = DoricJSRemoteArgTypeNumber;
|
||||
}else if ([arg isKindOfClass:[NSString class]]) {
|
||||
type = DoricJSRemoteArgTypeString;
|
||||
}else if ([arg isKindOfClass:[NSDictionary class]]) {
|
||||
type = DoricJSRemoteArgTypeObject;
|
||||
}else if ([arg isKindOfClass:[NSMutableArray class]]) {
|
||||
type = DoricJSRemoteArgTypeArray;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
Reference in New Issue
Block a user