<commit_before>package lime.project;


import haxe.io.Path;
import lime.tools.helpers.FileHelper;
import lime.tools.helpers.ObjectHelper;
import lime.tools.helpers.StringHelper;
import lime.tools.helpers.PathHelper;
import lime.project.AssetType;
import sys.FileSystem;

@:access(lime.tools.helpers.FileHelper)


class Asset {
	
	
	public var data:Dynamic;
	public var embed:Null<Bool>;
	public var encoding:AssetEncoding;
	public var flatName:String;
	public var format:String;
	public var glyphs:String;
	public var id:String;
	public var library:String;
	//public var path:String;
	//public var rename:String;
	public var resourceName:String;
	public var sourcePath:String;
	public var targetPath:String;
	public var type:AssetType;
	
	
	public function new (path:String = "", rename:String = "", type:AssetType = null, embed:Null<Bool> = null, setDefaults:Bool = true) {
		
		if (!setDefaults) return;
		
		this.embed = embed;
		sourcePath = PathHelper.standardize (path);
		
		if (rename == "") {
			
			targetPath = path;
			
		} else {
			
			targetPath = rename;
			
		}
		
		id = targetPath;
		resourceName = targetPath;
		flatName = StringHelper.getFlatName (targetPath);
		format = Path.extension (path).toLowerCase ();
		glyphs = "32-255";
		
		if (type == null) {
			
			var extension = Path.extension (path);
			
			if (FileHelper.knownExtensions.exists (extension)) {
				
				this.type = FileHelper.knownExtensions.get (extension);
				
			} else {
				
				switch (extension.toLowerCase ()) {
					
					case "bundle":
						
						this.type = AssetType.MANIFEST;
					
					case "ogg", "m4a":
						
						if (FileSystem.exists (path)) {<commit_msg>Auto-assign asset type properly ieven if extension is not lower-case (resolve openfl/openfl#1726)<commit_after>package lime.project;


import haxe.io.Path;
import lime.tools.helpers.FileHelper;
import lime.tools.helpers.ObjectHelper;
import lime.tools.helpers.StringHelper;
import lime.tools.helpers.PathHelper;
import lime.project.AssetType;
import sys.FileSystem;

@:access(lime.tools.helpers.FileHelper)


class Asset {
	
	
	public var data:Dynamic;
	public var embed:Null<Bool>;
	public var encoding:AssetEncoding;
	public var flatName:String;
	public var format:String;
	public var glyphs:String;
	public var id:String;
	public var library:String;
	//public var path:String;
	//public var rename:String;
	public var resourceName:String;
	public var sourcePath:String;
	public var targetPath:String;
	public var type:AssetType;
	
	
	public function new (path:String = "", rename:String = "", type:AssetType = null, embed:Null<Bool> = null, setDefaults:Bool = true) {
		
		if (!setDefaults) return;
		
		this.embed = embed;
		sourcePath = PathHelper.standardize (path);
		
		if (rename == "") {
			
			targetPath = path;
			
		} else {
			
			targetPath = rename;
			
		}
		
		id = targetPath;
		resourceName = targetPath;
		flatName = StringHelper.getFlatName (targetPath);
		format = Path.extension (path).toLowerCase ();
		glyphs = "32-255";
		
		if (type == null) {
			
			var extension = Path.extension (path);
			if (extension != null) extension = extension.toLowerCase ();
			
			if (FileHelper.knownExtensions.exists (extension)) {
				
				this.type = FileHelper.knownExtensions.get (extension);
				
			} else {
				
				switch (extension) {
					
					case "bundle":
						
						this.type = AssetType.MANIFEST;
					
					case "ogg", "m4a":
						
						if (FileSystem.exists (path)) {
{'fraction_non_alphanumeric': 0.11479665416786848, 'fraction_numerical': 0.004614940871070089, 'mean_word_length': 3.440460947503201, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7620558', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1061, 'n_words': 266}