mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-23 07:09:01 +01:00
chore: collection and folder as request names are reserved
This commit is contained in:
parent
2d149d94ef
commit
53eb53e062
2
package-lock.json
generated
2
package-lock.json
generated
@ -20025,7 +20025,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"mustache": "^4.2.0",
|
||||
"qs": "^6.11.0",
|
||||
"socks-proxy-agent": "*",
|
||||
"socks-proxy-agent": "^8.0.2",
|
||||
"yargs": "^17.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -29,10 +29,10 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => {
|
||||
.required('name is required')
|
||||
.test({
|
||||
name: 'requestName',
|
||||
message: 'The request name "index" is reserved in bruno',
|
||||
message: `The request names - collection and folder is reserved in bruno`,
|
||||
test: (value) => {
|
||||
const regex = /(\s|^)\W*index\W*(\s|$)/i;
|
||||
return value && !regex.test(value);
|
||||
const trimmedValue = value.trim().toLowerCase();
|
||||
return !['collection', 'folder'].includes(trimmedValue);
|
||||
}
|
||||
})
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user