minify emoji json
This commit is contained in:
parent
6b019b60f8
commit
acf036cc11
2 changed files with 14 additions and 23480 deletions
23480
assets/emoji.json
23480
assets/emoji.json
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,4 @@
|
||||||
|
import "dart:convert";
|
||||||
import "dart:io";
|
import "dart:io";
|
||||||
|
|
||||||
import "package:http/http.dart";
|
import "package:http/http.dart";
|
||||||
|
|
@ -13,8 +14,19 @@ void main(List<String> args) async {
|
||||||
throw Exception("Failed to load emoji data");
|
throw Exception("Failed to load emoji data");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print("Fetched emoji data. Minifying...");
|
||||||
|
final jsonValue = json.decode(response.body);
|
||||||
|
|
||||||
|
for (final item in jsonValue) {
|
||||||
|
if (item is Map<String, dynamic>) {
|
||||||
|
item
|
||||||
|
..remove('unicode_version')
|
||||||
|
..remove('ios_version');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await File.fromUri(Platform.script.resolve("../assets/emoji.json"))
|
await File.fromUri(Platform.script.resolve("../assets/emoji.json"))
|
||||||
.writeAsString(response.body);
|
.writeAsString(json.encode(jsonValue));
|
||||||
|
|
||||||
print("Emoji list written!");
|
print("Emoji list written!");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue