Socket
Socket
Sign inDemoInstall

effects-as-data-generate

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effects-as-data-generate - npm Package Compare versions

Comparing version 2.2.0 to 2.2.2

25

effects/functions/new-fn.js

@@ -44,2 +44,7 @@ const c = require('case');

function* writeFunction({ nameCamel, fileName, settings }) {
const filePath = path.join(settings.functionsPath, fileName + '.js');
const $fnAlreadyExists = yield actions.fileExists(filePath);
if (isFailure($fnAlreadyExists)) return $fnAlreadyExists;
if ($fnAlreadyExists.payload)
return failure(`${nameCamel}() already exists.`);
const $functionTemplate = yield actions.readFile(

@@ -55,10 +60,12 @@ path.join(__dirname, '../../templates/fn.js.txt'),

);
return yield actions.writeFile(
path.join(settings.functionsPath, fileName + '.js'),
functionText,
{ encoding: 'utf8' }
);
return yield actions.writeFile(filePath, functionText, { encoding: 'utf8' });
}
function* writeSpec({ nameCamel, namePascal, fileName, settings }) {
const filePath = path.join(settings.functionsPath, fileName + '.spec.js');
const $specAlreadExists = yield actions.fileExists(filePath);
if (isFailure($specAlreadExists)) return $specAlreadExists;
if ($specAlreadExists.payload)
return failure(`${nameCamel}() spec already exists.`);
const $specTemplate = yield actions.readFile(

@@ -74,7 +81,3 @@ path.join(__dirname, '../../templates/spec.js.txt'),

)($specTemplate.payload);
return yield actions.writeFile(
path.join(settings.functionsPath, fileName + '.spec.js'),
specText,
{ encoding: 'utf8' }
);
return yield actions.writeFile(filePath, specText, { encoding: 'utf8' });
}

@@ -91,3 +94,3 @@

});
const indexString = JSON.stringify(updatedFunctionsIndex);
const indexString = JSON.stringify(updatedFunctionsIndex, true, 2);
const $writeResult = yield actions.writeFile(indexPath, indexString, {

@@ -94,0 +97,0 @@ encoding: 'utf8'

@@ -1,7 +0,7 @@

const {run, buildFunctions} = require('effects-as-data');
const { run, buildFunctions } = require('effects-as-data');
const handlers = require('./handlers');
const functions = require('./functions');
const fxns = buildFunctions(handlers, functions);
const fxns = buildFunctions(handlers, functions, { onFailure: () => {} });
module.exports = fxns;

@@ -21,3 +21,3 @@ const program = require('commander');

function printSuccess(result) {
console.error(chalk.green(result.payload.message));
console.log(chalk.green(result.payload.message));
}

@@ -24,0 +24,0 @@

{
"name": "effects-as-data-generate",
"version": "2.2.0",
"version": "2.2.2",
"description": "",

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc