unityscript
Advanced tools
| const { Workspace } = require('../index.js'); | ||
| Workspace.newF("parseMs", function(string) { | ||
| if (typeof string != "string") { | ||
| return parseFloat(string)*1000; | ||
| } | ||
| let t = string.split(""); | ||
| let thing = t.pop(); | ||
| if (thing == "s") { return parseFloat(t.join(""))*1000; } | ||
| else if (thing == "ms") { return parseFloat(t.join("")); } | ||
| else if (thing == "m") { return parseFloat(t.join(""))*60*1000; } | ||
| else if (thing == "h") { return parseFloat(t.join(""))*60*60*1000; } | ||
| else if (thing == "d") { return parseFloat(t.join(""))*60*60*24*1000; } | ||
| else if (thing == "w") { return parseFloat(t.join(""))*60*60*24*7*1000; } | ||
| else if (thing == "y") { return parseFloat(t.join(""))*60*60*24*365*1000; } | ||
| else { return parseFloat(string)*1000; } | ||
| }); |
| const { Workspace } = require('../index.js'); | ||
| function parseTime(string) { | ||
| if (typeof string != "string") { | ||
| return parseFloat(string); | ||
| } | ||
| let t = string.split(""); | ||
| let thing = t.pop(); | ||
| if (thing == "s") { return parseFloat(t.join("")); } | ||
| else if (thing == "ms") { return parseFloat(t.join(""))*1000; } | ||
| else if (thing == "m") { return parseFloat(t.join(""))*60; } | ||
| else if (thing == "h") { return parseFloat(t.join(""))*60*60; } | ||
| else if (thing == "d") { return parseFloat(t.join(""))*60*60*24; } | ||
| else if (thing == "w") { return parseFloat(t.join(""))*60*60*24*7; } | ||
| else if (thing == "y") { return parseFloat(t.join(""))*60*60*24*365; } | ||
| else { return parseFloat(string); } | ||
| } | ||
| Workspace.newF("parseTime", parseTime); | ||
| module.exports = parseTime; |
+4
-2
| { | ||
| "name": "unityscript", | ||
| "version": "0.0.7", | ||
| "version": "0.0.8", | ||
| "author": "paishee", | ||
@@ -28,3 +28,5 @@ "description": "A JavaScript-to-C# Compiler for Unity", | ||
| "gamedev", | ||
| "unityscript" | ||
| "unityscript", | ||
| "compiler", | ||
| "transpiler" | ||
| ], | ||
@@ -31,0 +33,0 @@ "homepage": "https://github.com/paishee/unityscript", |
+6
-0
@@ -0,1 +1,7 @@ | ||
| [dear penguins]: => ( | ||
| I KNOW IT'S A TRANSPILER NOT A COMPILER NERD SILENCE | ||
| ) | ||
| --- | ||
@@ -2,0 +8,0 @@ |
@@ -36,2 +36,10 @@ /* | ||
| // workspace type (2D or 3D) | ||
| this.type = 0; | ||
| if (settings.type) { | ||
| if (typeof settings.type == "string") this.type = (settings.type.toLowerCase() == "3d") ? 0 : (settings.type.toLowerCase() == "2d") ? 1 : 0; | ||
| else this.type = settings.type; | ||
| } | ||
@@ -117,3 +125,7 @@ // instances | ||
| // parseTime for sleep | ||
| const parseTime = require('./Resources/parseTime.js'); | ||
| /* group exports that automatically define so you don't have to import them manually | ||
@@ -129,2 +141,13 @@ | ||
| return [ ObjectHideFlags ] = [ flags ]; | ||
| return [ | ||
| ObjectHideFlags, | ||
| sleep, | ||
| sleepMs | ||
| ] = [ | ||
| flags, | ||
| function(time) { return new Promise(resolve => setTimeout(resolve, parseTime(time)*1000)) }, | ||
| function(time) { return new Promise(resolve => setTimeout(resolve, parseTime(time))) } | ||
| ]; |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
40631
5.81%54
3.85%892
5.94%104
6.12%6
-14.29%