New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@compas/code-gen

Package Overview
Dependencies
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compas/code-gen - npm Package Compare versions

Comparing version 0.0.124 to 0.0.125

10

package.json
{
"name": "@compas/code-gen",
"version": "0.0.124",
"version": "0.0.125",
"description": "Generate various boring parts of your server",

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

"dependencies": {
"@compas/cli": "0.0.124",
"@compas/insight": "0.0.124",
"@compas/stdlib": "0.0.124"
"@compas/cli": "0.0.125",
"@compas/insight": "0.0.125",
"@compas/stdlib": "0.0.125"
},

@@ -44,3 +44,3 @@ "maintainers": [

},
"gitHead": "11f6c1b6b808aa80ee6746db8f489ab4f2ef03cc"
"gitHead": "a44a773801f5fd21f6b92a751cef57d3e3e563c6"
}

@@ -48,6 +48,13 @@ import { isPlainObject } from "@compas/stdlib";

return new ObjectType().keys(value).build();
} else if (Array.isArray(value) && value.length !== 0) {
} else if (Array.isArray(value) && value.length === 1) {
return new ArrayType().values(value[0]).build();
}
if (Array.isArray(value) && value.length !== 1) {
throw new Error(
`Inferred arrays can only have a single element. Found '${value}' which has ${value.length} elements.`,
);
}
throw new Error(`Could not infer type of '${value}'`);
}

@@ -22,3 +22,3 @@ import { js } from "./tag/tag.js";

contents: generateCommonReactQueryFile(),
relativePath: `./common/reactQuery${context.extension}`,
relativePath: `./common/reactQuery${context.extension}x`,
});

@@ -25,0 +25,0 @@ }

@@ -142,2 +142,26 @@ const RoutePrio = {

if (path.length === 1) {
if (child.uniqueName) {
let fullPath = `${path[0]}`;
if (!trie.parent) {
// The root path is POST / so handle that case
fullPath += ` /`;
}
let _trie = trie;
while (_trie.parent) {
_trie = _trie.parent;
if (!_trie.parent?.parent) {
// The root is `POST` or `GET` so handle that case
fullPath = `${_trie.path} /${fullPath}`;
break;
} else {
fullPath = `${_trie.path}/${fullPath}`;
}
}
throw new Error(
`Duplicate route for path '${fullPath}'. Both '${child.uniqueName}' and '${uniqueName}' have the same route path.`,
);
}
child.uniqueName = uniqueName;

@@ -144,0 +168,0 @@ } else {

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