Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@squared-functions/module

Package Overview
Dependencies
Maintainers
1
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@squared-functions/module - npm Package Compare versions

Comparing version 0.9.9 to 0.9.10

19

index.js

@@ -1,2 +0,2 @@

/* @squared-functions/module 0.9.9
/* @squared-functions/module 0.9.10
https://github.com/anpham6/squared-functions */

@@ -26,3 +26,3 @@

constructor() {
this.tempDir = 'temp';
this.tempDir = 'tmp';
[this.major, this.minor, this.patch] = process.version.substring(1).split('.').map(value => +value);

@@ -50,2 +50,5 @@ }

}
static isLocalPath(value) {
return /^\.?\.[\\/]/.test(value);
}
supported(major, minor, patch = 0) {

@@ -66,2 +69,14 @@ if (this.major < major) {

}
parseFunction(value) {
if (Module.isLocalPath(value = value.trim())) {
try {
value = fs.readFileSync(path.resolve(value), 'utf8').trim();
}
catch (err) {
this.writeFail(['Could not load function', value], err);
return null;
}
}
return value.startsWith('function') ? eval(`(${value})`) : null;
}
getTempDir(subDir, filename = '') {

@@ -68,0 +83,0 @@ return process.cwd() + path.sep + this.tempDir + path.sep + (subDir ? uuid.v4() + path.sep : '') + (filename.startsWith('.') ? uuid.v4() : '') + filename;

4

package.json
{
"name": "@squared-functions/module",
"version": "0.9.9",
"version": "0.9.10",
"description": "Module extension class for squared-functions",

@@ -18,3 +18,3 @@ "main": "index.js",

"dependencies": {
"@squared-functions/types": "^0.9.9",
"@squared-functions/types": "^0.9.10",
"uuid": "^8.3.2",

@@ -21,0 +21,0 @@ "chalk": "^4.1.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc