Sign In

@topogram/cli

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@topogram/cli - npm Package Compare versions

Comparing version
0.3.121
to
0.3.122
+1
-1
package.json
{
"name": "@topogram/cli",
"version": "0.3.121",
"version": "0.3.122",
"description": "Topogram CLI for checking Topogram workspaces and generating app bundles.",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -14,3 +14,3 @@ // @ts-check

} from "./model-helpers.js";
import { validatePortableIdentifier } from "./safe-values.js";
import { validatePortableIdentifier, validateProjectedFieldName } from "./safe-values.js";

@@ -165,3 +165,3 @@ /**

const [fromItem, toItem] = items;
validatePortableIdentifier(errors, `Shape ${statement.id} rename target`, toItem.value, toItem.loc);
validateProjectedFieldName(errors, `Shape ${statement.id} rename target`, toItem.value, toItem.loc);

@@ -168,0 +168,0 @@ if (!baseFieldSet.has(fromItem.value)) {

@@ -10,2 +10,3 @@ // @ts-check

export const DOWNLOAD_FILENAME_PATTERN = /^[^/\\\x00-\x1F\x7F]+$/;
export const PROJECTED_FIELD_NAME_PATTERN = /^[a-z][A-Za-z0-9_]*$/;

@@ -32,2 +33,15 @@ /**

*/
export function validateProjectedFieldName(errors, label, value, loc) {
if (!value || !PROJECTED_FIELD_NAME_PATTERN.test(value)) {
pushError(errors, `${label} '${value || ""}' must match ${PROJECTED_FIELD_NAME_PATTERN.source}`, loc);
}
}
/**
* @param {ValidationErrors} errors
* @param {string} label
* @param {string | null | undefined} value
* @param {TopogramLocation | null | undefined} loc
* @returns {void}
*/
export function validateHttpHeaderName(errors, label, value, loc) {

@@ -34,0 +48,0 @@ if (value && !HTTP_HEADER_NAME_PATTERN.test(value)) {