https
https copied to clipboard
[iOS] - Change function AFSuccess(resolve, task: NSURLSessionDataTask, data: NSDictionary<string, any> & NSData & NSArray<any>) {
There's a problem with function:
function AFSuccess(resolve, task: NSURLSessionDataTask, data: NSDictionary<string, any> & NSData & NSArray
if (data.enumerateKeysAndObjectsUsingBlock || data.class().name === 'NSArray' || **(data instanceof NSArray) === true**) {
let serial = NSJSONSerialization.dataWithJSONObjectOptionsError(data, NSJSONWritingOptions.PrettyPrinted);
content = NSString.alloc().initWithDataEncoding(serial, NSUTF8StringEncoding).toString();
} else if (data.class().name === 'NSData' || **(data instanceof NSData) === true**) {
Should be used "instanceof"!
Can you please send a PR?