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

@zargu/couchdb-designer

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zargu/couchdb-designer - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

52

build/testing/createTestJavascriptSection.js

@@ -34,32 +34,36 @@ "use strict";

return new Promise((resolve, reject) => {
const testModule = createTestJavascriptModule(contextProps.contextId, fileContent);
try {
const testModule = createTestJavascriptModule(contextProps.contextId, fileContent);
if (testModule && Object.keys(testModule).length > 0) {
let testModuleKeys = Object.keys(testModule);
if (testModule && Object.keys(testModule).length > 0) {
let testModuleKeys = Object.keys(testModule);
if (!fileStats.isLib && testModuleKeys.length === 1 && testModuleKeys[0] === fileStats.name) {
const mockFunction = (0, _createMockFunction.default)(fileStats, contextProps, testModuleKeys[0], testModule[testModuleKeys[0]]);
resolve({
[fileStats.name]: mockFunction
});
} else {
let testElementsObject = {
__sourceProperties__: fileStats
};
if (!fileStats.isLib && testModuleKeys.length === 1 && testModuleKeys[0] === fileStats.name) {
const mockFunction = (0, _createMockFunction.default)(fileStats, contextProps, testModuleKeys[0], testModule[testModuleKeys[0]]);
resolve({
[fileStats.name]: mockFunction
});
} else {
let testElementsObject = {
__sourceProperties__: fileStats
};
for (let moduleElementName of testModuleKeys) {
if (typeof testModule[moduleElementName] === 'function') {
const mockFunction = (0, _createMockFunction.default)(fileStats, contextProps, moduleElementName, testModule[moduleElementName]);
testElementsObject[moduleElementName] = mockFunction;
} else {
testElementsObject[moduleElementName] = testModule[moduleElementName];
for (let moduleElementName of testModuleKeys) {
if (typeof testModule[moduleElementName] === 'function') {
const mockFunction = (0, _createMockFunction.default)(fileStats, contextProps, moduleElementName, testModule[moduleElementName]);
testElementsObject[moduleElementName] = mockFunction;
} else {
testElementsObject[moduleElementName] = testModule[moduleElementName];
}
}
resolve({
[fileStats.name]: testElementsObject
});
}
resolve({
[fileStats.name]: testElementsObject
});
} else {
reject(`The module ${fileStats.filePath} does not exist't export anything! You must export function/s with module.exports = {...}`);
}
} else {
reject(`The module ${fileStats.filePath} does not exist't export anything! You must export function/s with module.exports = {...}`);
} catch (moduleError) {
reject(`Can not evaluate ${fileStats.filePath}\n ${moduleError.message}`);
}

@@ -66,0 +70,0 @@ });

{
"name": "@zargu/couchdb-designer",
"version": "0.6.0",
"version": "0.6.1",
"description": "Create and testing couchdb design document form directory structure.",

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

@@ -9,3 +9,3 @@ import {testEnvironment} from '../../build/testing/testEnvironment';

const isArray = Array.isArray;
return eval(fileContent);
return eval(fileContent);
}

@@ -16,24 +16,28 @@

return new Promise((resolve, reject) => {
const testModule = createTestJavascriptModule(contextProps.contextId, fileContent);
if(testModule && Object.keys(testModule).length > 0){
let testModuleKeys = Object.keys(testModule);
if(!fileStats.isLib && testModuleKeys.length === 1 && testModuleKeys[0] === fileStats.name){
const mockFunction = createMockFunction(fileStats, contextProps, testModuleKeys[0], testModule[testModuleKeys[0]]);
resolve({[fileStats.name]:mockFunction});
try{
const testModule = createTestJavascriptModule(contextProps.contextId, fileContent);
if(testModule && Object.keys(testModule).length > 0){
let testModuleKeys = Object.keys(testModule);
if(!fileStats.isLib && testModuleKeys.length === 1 && testModuleKeys[0] === fileStats.name){
const mockFunction = createMockFunction(fileStats, contextProps, testModuleKeys[0], testModule[testModuleKeys[0]]);
resolve({[fileStats.name]:mockFunction});
}else{
let testElementsObject = {__sourceProperties__:fileStats};
for(let moduleElementName of testModuleKeys){
if(typeof testModule[moduleElementName] === 'function'){
const mockFunction = createMockFunction(fileStats,contextProps,moduleElementName,testModule[moduleElementName]);
testElementsObject[moduleElementName] = mockFunction;
}else{
testElementsObject[moduleElementName] = testModule[moduleElementName];
}
}
resolve({[fileStats.name]:testElementsObject});
}
}else{
let testElementsObject = {__sourceProperties__:fileStats};
for(let moduleElementName of testModuleKeys){
if(typeof testModule[moduleElementName] === 'function'){
const mockFunction = createMockFunction(fileStats,contextProps,moduleElementName,testModule[moduleElementName]);
testElementsObject[moduleElementName] = mockFunction;
}else{
testElementsObject[moduleElementName] = testModule[moduleElementName];
}
}
resolve({[fileStats.name]:testElementsObject});
}
}else{
reject(`The module ${fileStats.filePath} does not exist't export anything! You must export function/s with module.exports = {...}`);
}
reject(`The module ${fileStats.filePath} does not exist't export anything! You must export function/s with module.exports = {...}`);
}
}catch(moduleError){
reject(`Can not evaluate ${fileStats.filePath}\n ${moduleError.message}`);
}
});

@@ -40,0 +44,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