//
//  NSURL+HotPocketExtensions.m
//  HotPocket (macOS)
//
//  Created by Tomek Wójcik on 30/09/2025.
//

#import "NSURL+HotPocketExtensions.h"

@implementation NSURL (HotPocketExtensions)

-(BOOL)isUsableInHotPocket {
    static NSArray *supportedSchemes = @[@"http", @"https"];

    if (self.baseURL != nil) {
        return NO;
    }
    
    if (self.scheme == nil || [supportedSchemes containsObject:self.scheme] == NO) {
        return NO;
    }
    
    if (self.host == nil || [@"" isEqualToString:self.host] == YES) {
        return NO;
    }
    
    return YES;
}

@end
