mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 20:00:29 +01:00
Merge branch 'main' into main
This commit is contained in:
@@ -323,7 +323,7 @@ impl Parser {
|
||||
let is_valid = if start_pos == self.pos {
|
||||
ch.is_alphanumeric() || ch == '_' // The first char is more restrictive
|
||||
} else {
|
||||
ch.is_alphanumeric() || ch == '_' || ch == '-'
|
||||
ch.is_alphanumeric() || ch == '_' || ch == '-' || ch == '.'
|
||||
};
|
||||
if is_valid {
|
||||
text.push(ch);
|
||||
@@ -545,6 +545,22 @@ mod tests {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn var_dots() -> Result<()> {
|
||||
let mut p = Parser::new("${[ a.b ]}");
|
||||
assert_eq!(
|
||||
p.parse()?.tokens,
|
||||
vec![
|
||||
Token::Tag {
|
||||
val: Val::Var { name: "a.b".into() }
|
||||
},
|
||||
Token::Eof
|
||||
]
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn var_prefixes() -> Result<()> {
|
||||
let mut p = Parser::new("${[ -a ]}${[ $a ]}");
|
||||
|
||||
@@ -74,7 +74,7 @@ export function EnvironmentEditor({ environment, hideName, className, setRef }:
|
||||
const validateName = useCallback((name: string) => {
|
||||
// Empty just means the variable doesn't have a name yet and is unusable
|
||||
if (name === '') return true;
|
||||
return name.match(/^[a-z_][a-z0-9_-]*$/i) != null;
|
||||
return name.match(/^[a-z_][a-z0-9_.-]*$/i) != null;
|
||||
}, []);
|
||||
|
||||
const valueType = !isEncryptionEnabled && valueVisibility.value ? 'text' : 'password';
|
||||
|
||||
Reference in New Issue
Block a user