@lwrjs/diagnostics
Advanced tools
Comparing version 0.0.2-alpha46 to 0.0.2-alpha47
@@ -47,2 +47,9 @@ import { DiagnosticLocation } from '../types.js'; | ||
}; | ||
INVALID_PROPERTY: (configProperty: string, prop: string) => Pick<{ | ||
category: "lwrConfig/invalidSchema"; | ||
message: string; | ||
}, "category"> & { | ||
advice: import("../types.js").DiagnosticAdvice; | ||
message: string; | ||
}; | ||
NON_EMPTY_STRING: (configProperty: string, actualProp: string) => Pick<{ | ||
@@ -49,0 +56,0 @@ category: "lwrConfig/invalidSchema"; |
@@ -26,47 +26,51 @@ import { createDiagnosticsCategory } from './index.js'; | ||
}), | ||
INVALID_PROPERTY: (configProperty, prop) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Unexpected property "${prop}" in "${configProperty}" configuration`, | ||
}), | ||
NON_EMPTY_STRING: (configProperty, actualProp) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" must be a non-empty string, received ${actualProp}.`, | ||
message: `Property "${configProperty}" must be a non-empty string, received ${actualProp}`, | ||
}), | ||
NON_EMPTY_ARRAY: (configProperty, actualProp) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" must be a non-empty array, received ${actualProp}.`, | ||
message: `Property "${configProperty}" must be a non-empty array, received ${actualProp}`, | ||
}), | ||
INVALID_PORT: (configProperty, actualProp) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" must be a valid port number, received ${actualProp}.`, | ||
message: `Property "${configProperty}" must be a valid port number, received ${actualProp}`, | ||
}), | ||
INVALID_METHOD: (configProperty, actualProp) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" must be "get" or "post", received ${actualProp}.`, | ||
message: `Property "${configProperty}" must be "get" or "post", received ${actualProp}`, | ||
}), | ||
INVALID_STATUS: (configProperty, actualProp) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" must be 404 or 500, received ${actualProp}.`, | ||
message: `Property "${configProperty}" must be 404 or 500, received ${actualProp}`, | ||
}), | ||
INVALID_SPECIFIER: (configProperty, actualProp) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" must be a valid specifier, received ${actualProp}.`, | ||
message: `Property "${configProperty}" must be a valid specifier, received ${actualProp}`, | ||
}), | ||
INVALID_PATH: (configProperty, actualProp) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" must be a URI path string which starts but does not end with a slash, received ${actualProp}.`, | ||
message: `Property "${configProperty}" must be a URI path string which starts but does not end with a slash, received ${actualProp}`, | ||
}), | ||
INVALID_SERVICE: (configProperty, actualProp) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" must be a valid service (a non-empty string or array with [non-empty string, any]), received ${actualProp}.`, | ||
message: `Property "${configProperty}" must be a valid service (a non-empty string or array with [non-empty string, any]), received ${actualProp}`, | ||
}), | ||
MISSING_ONE_OF: (configProperty, childProps) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `A "${configProperty}" must contain at least one of [${childProps}].`, | ||
message: `A "${configProperty}" must contain at least one of [${childProps}]`, | ||
}), | ||
MISSING_REQUIRED: (configProperty, childProps) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Property "${configProperty}" is missing required properties [${childProps}].`, | ||
message: `Property "${configProperty}" is missing required properties [${childProps}]`, | ||
}), | ||
DUPLICATE_IDS: (configProperty, dupeIds) => ({ | ||
category: 'lwrConfig/invalidSchema', | ||
message: `Each "${configProperty}" must have a unique "id", found duplicates [${dupeIds}].`, | ||
message: `Each "${configProperty}" must have a unique "id", found duplicates [${dupeIds}]`, | ||
}), | ||
}); | ||
//# sourceMappingURL=configParser.js.map |
@@ -50,2 +50,6 @@ import { DiagnosticDescription, DiagnosticAdvice, StaticMarkup } from '../types'; | ||
}; | ||
INVALID_PROPERTY: (configProperty: string, prop: string) => { | ||
category: "lwrConfig/invalidSchema"; | ||
message: string; | ||
}; | ||
NON_EMPTY_STRING: (configProperty: string, actualProp: string) => { | ||
@@ -52,0 +56,0 @@ category: "lwrConfig/invalidSchema"; |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.0.2-alpha46", | ||
"version": "0.0.2-alpha47", | ||
"homepage": "https://lwr.dev/", | ||
@@ -34,3 +34,3 @@ "repository": { | ||
"devDependencies": { | ||
"@lwrjs/types": "0.0.2-alpha46" | ||
"@lwrjs/types": "0.0.2-alpha47" | ||
}, | ||
@@ -40,3 +40,3 @@ "engines": { | ||
}, | ||
"gitHead": "68c660a224d1a4f6e40a17d04aa2825be5cdd776" | ||
"gitHead": "dc5c32b835bd20abadf39d08889d4ac3e99d6ce2" | ||
} |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
32911
803
1