1 | | | import '../../converters/cast_converter.dart'; |
2 | | | import '../../converters/converter.dart'; |
3 | | | import '../../converters/num_converter.dart'; |
4 | | | import '../../squadron_platform_type.dart'; |
5 | | | import '_patch.dart'; |
6 | | |
|
7 | | | Converter getPlatformConverter() => (1.toDouble() is int) |
8 | | 9 | ? CastConverter.instance // JavaScript |
9 | | | : NumConverter.instance; // Web Assembly |
10 | | |
|
11 | | | SquadronPlatformType getPlatformType() => (1.toDouble() is int) |
12 | | 2 | ? SquadronPlatformType.js // JavaScript |
13 | | | : SquadronPlatformType.wasm; // Web Assembly |
14 | | |
|
15 | | 12 | Uri mapUrl(String url) { |
16 | | 12 | if (url.startsWith('~')) { |
17 | | 12 | final root = getHome(); |
18 | | 12 | if (root != null) { |
19 | | 12 | url = '$root${url.substring(1)}'; |
20 | | | } |
21 | | | } |
22 | | 12 | return Uri.parse(url); |
23 | | 12 | } |