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

clarity-cli

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clarity-cli - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

2

package.json
{
"name": "clarity-cli",
"version": "1.0.12",
"version": "1.0.13",
"description": "Clarity setup for vscode.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -6,21 +6,32 @@ var fs = require("fs-extra");

const specialTestNames = {
"prepare":true,
"prepare": true,
"destroy": true
};
const promiseFunction = ()=>{
const promiseFunction = () => {
return Promise.resolve(null);
}
const promisify = (fn) => {
return () => {
fn = fn || promiseFunction;
var result = fn();
result = result instanceof Promise ? result : Promise.resolve(result);
return result;
}
}
fs.readdir(testDirectory).then((files) => {
files.forEach((file) => {
if (path.extname(file) === ".js") {
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
var prepare = defaultModules.prepare || promiseFunction;
var destroy = defaultModules.destroy || promiseFunction;
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
Object.keys(defaultModules).filter((testName)=>{
Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;

@@ -49,3 +60,3 @@ }).reduce((promise, testName) => {

});
}, prepare()).then(()=>{
}, prepare()).then(() => {
return destroy();

@@ -52,0 +63,0 @@ }).catch((error) => {

@@ -6,21 +6,32 @@ var fs = require("fs-extra");

const specialTestNames = {
"prepare":true,
"prepare": true,
"destroy": true
};
const promiseFunction = ()=>{
const promiseFunction = () => {
return Promise.resolve(null);
}
const promisify = (fn) => {
return () => {
fn = fn || promiseFunction;
var result = fn();
result = result instanceof Promise ? result : Promise.resolve(result);
return result;
}
}
fs.readdir(testDirectory).then((files) => {
files.forEach((file) => {
if (path.extname(file) === ".js") {
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
var prepare = defaultModules.prepare || promiseFunction;
var destroy = defaultModules.destroy || promiseFunction;
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
Object.keys(defaultModules).filter((testName)=>{
Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;

@@ -49,3 +60,3 @@ }).reduce((promise, testName) => {

});
}, prepare()).then(()=>{
}, prepare()).then(() => {
return destroy();

@@ -52,0 +63,0 @@ }).catch((error) => {

@@ -6,21 +6,32 @@ var fs = require("fs-extra");

const specialTestNames = {
"prepare":true,
"prepare": true,
"destroy": true
};
const promiseFunction = ()=>{
const promiseFunction = () => {
return Promise.resolve(null);
}
const promisify = (fn) => {
return () => {
fn = fn || promiseFunction;
var result = fn();
result = result instanceof Promise ? result : Promise.resolve(result);
return result;
}
}
fs.readdir(testDirectory).then((files) => {
files.forEach((file) => {
if (path.extname(file) === ".js") {
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
var prepare = defaultModules.prepare || promiseFunction;
var destroy = defaultModules.destroy || promiseFunction;
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
Object.keys(defaultModules).filter((testName)=>{
Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;

@@ -49,3 +60,3 @@ }).reduce((promise, testName) => {

});
}, prepare()).then(()=>{
}, prepare()).then(() => {
return destroy();

@@ -52,0 +63,0 @@ }).catch((error) => {

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