add util fn to check if string is valid prop name

pull/8015/head
Arman Ozak 5 years ago
parent e4bf25c583
commit ab9ee98e28

@ -10,6 +10,7 @@ export * from './import';
export * from './model';
export * from './namespace';
export * from './path';
export * from './prop';
export * from './rule';
export * from './service';
export * from './source';

@ -0,0 +1,9 @@
export const isValidProp = (name: string) => {
try {
new Function(name, 'var ' + name);
} catch (_) {
return false;
}
return true;
};
Loading…
Cancel
Save