New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

unityscript

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unityscript - npm Package Compare versions

Comparing version
0.0.7
to
0.0.8
+19
src/Workspace/Resources/parseMs.js
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",

@@ -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))) }
];