Socket
Socket
Sign inDemoInstall

aeproject-utils

Package Overview
Dependencies
411
Maintainers
8
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.1 to 2.2.0

6

index.js

@@ -37,2 +37,4 @@ const loggerUtils = require('./utils/logger-utils');

const capitalize = aeprojectUtils.capitalize;
const addCaretToDependencyVersion = aeprojectUtils.addCaretToDependencyVersion;
const prompt = aeprojectUtils.prompt;

@@ -89,3 +91,5 @@ const contractUtils = require('./utils/contract-utils');

readErrorSpawnOutput,
capitalize
capitalize,
addCaretToDependencyVersion,
prompt
}

7

package.json
{
"name": "aeproject-utils",
"version": "2.1.1",
"version": "2.2.0",
"description": "",

@@ -10,5 +10,4 @@ "main": "index.js",

"dependencies": {
"@aeternity/aepp-sdk": "6.1.3",
"aeproject-config": "^2.1.1",
"aeproject-logger": "^2.1.1",
"@aeternity/aepp-sdk": "7.0.0",
"aeproject-config": "^2.2.0",
"axios": "^0.19.0",

@@ -15,0 +14,0 @@ "chalk": "^2.4.1",

require = require('esm')(module /*, options */) // use to handle es6 import/export
let axios = require('axios');
const fs = require('fs');
const path = require('path')
const path = require('path');
const prompts = require('prompts');
const AeSDK = require('@aeternity/aepp-sdk');

@@ -315,2 +316,41 @@ const Universal = AeSDK.Universal;

const addCaretToDependencyVersion = (dependecy) => {
let pJson = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), './package.json'), 'utf8'))
let libVersion = pJson.dependencies[dependecy];
if (!libVersion) {
return;
}
if (!libVersion.startsWith('^')) {
pJson.dependencies[dependecy] = '^' + libVersion;
}
fs.writeFileSync(path.resolve(process.cwd(), './package.json'), JSON.stringify(pJson), 'utf8');
}
async function prompt (promptMessage, functionToExecute) {
const args = [...arguments];
// [0] - promptMessage
// [1] - function to execute
// [..] rest = function arguments
// // Prompt user to input data in console.
const response = await prompts({
type: 'text',
name: 'value',
message: `${ promptMessage } (YES/Y/yes/y || No/no/N/n):`
// validate: value => value < 18 ? `some validation text` : true
});
let input = response.value;
if (input === 'YES' || input === 'yes' || input === 'Y' || input === 'y') {
return functionToExecute(...args.slice(2));
}
return null;
}
module.exports = {

@@ -333,3 +373,5 @@ config,

readErrorSpawnOutput,
capitalize
capitalize,
addCaretToDependencyVersion,
prompt
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc