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

prisma-safety

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-safety - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

13

dist/prisma-safety.js

@@ -29,3 +29,3 @@ import { exec } from 'child_process';

const allIssues = [];
const currentTables = tablesFromSchema(currentSchema);
const currentModels = modelsFromSchema(currentSchema);
const tableChanges = diffModels(previousSchema, currentSchema);

@@ -46,3 +46,3 @@ allIssues.push(...tableChanges.deleted.flatMap((model) => {

if (typeof field.fieldType === 'string') {
if (currentTables.has(field.fieldType)) {
if (currentModels.has(field.fieldType)) {
return true;

@@ -106,2 +106,11 @@ }

}
function modelsFromSchema(schema) {
const models = new Map();
for (const block of schema.list) {
if (block.type === 'model') {
models.set(block.name, block);
}
}
return models;
}
function diffModels(previousSchema, currentSchema) {

@@ -108,0 +117,0 @@ const previousTables = tablesFromSchema(previousSchema);

4

package.json
{
"name": "prisma-safety",
"version": "0.0.5",
"version": "0.0.6",
"description": "A safe migration checker for Prisma.",

@@ -43,3 +43,3 @@ "repository": {

"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.5.0",
"@typescript-eslint/parser": "^8.1.0",
"eslint": "^8.46.0",

@@ -46,0 +46,0 @@ "eslint-config-prettier": "^9.0.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