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

lazysql

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazysql - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"name": "lazysql",
"version": "0.1.2",
"version": "0.1.3",
"description":

@@ -5,0 +5,0 @@ "An unopinionated Sequelize boilerplate builder, with models and associations.",

@@ -20,11 +20,10 @@ class Index {

addAssociations (associations) {
Object.keys(associations).forEach(key => {
const type = Object.keys(associations[key])[0]
const targetObj = associations[key][type]
const target = Object.keys(targetObj)[0]
const options = targetObj[target]
? ', ' + JSON.stringify(targetObj[target])
: ''
associations.forEach(association => {
const source = Object.keys(association)[0]
const type = Object.keys(association[source])[0]
const target = Object.keys(association[source][type])[0]
const option = association[source][type][target]
const line = `${key}.${type}(${target}${options})\n`
const options = option ? ', ' + JSON.stringify(option) : ''
const line = `${source}.${type}(${target}${options})\n`

@@ -31,0 +30,0 @@ this.output += line

@@ -16,7 +16,2 @@ const fs = require('fs')

const operator = (buildPath, data) => {
// Create /destination directory
// if (!fs.existsSync(buildPath)) {
// fs.mkdirSync(buildPath)
// }
// Create root index file

@@ -41,2 +36,3 @@ const index = new Index()

// Create /models/index.js file
// handles model associations
const modelIndex = new ModelIndex(models, data.associations)

@@ -65,9 +61,6 @@ createFile(buildPath + '/models', 'index.js', modelIndex.output)

const prettierFixForJSON = content => {
console.log('---- creating configuration file')
console.log('obj', content)
const fPrettier = 'const file = '
content = fPrettier + JSON.stringify(content, null, '\t')
console.log('stringified -->', content)
content = prettier.format(content, PRETTIER_SETTINGS)
content = content.slice(fPrettier.length)
console.log('final -->', content)
return content

@@ -78,3 +71,4 @@ }

checkPath(buildPath)
const formattedObject = prettierFixForJSON(jsObj)
// const formattedObject = prettierFixForJSON(jsObj)
const formattedObject = JSON.stringify(jsObj)
writeFile(buildPath, fileName, formattedObject)

@@ -81,0 +75,0 @@ console.log(`created configuration file: ${fileName} in ${buildPath}`)

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