open-consul/ui-v2/app/utils/get-form-name-property.js
John Cowen 52a62f2b8d UI: New ACLs (#4789)
UI to accompany the new ACLs APIs
2018-10-19 08:45:05 -07:00

7 lines
141 B
JavaScript

export default function(name) {
if (name.indexOf('[') !== -1) {
return name.match(/(.*)\[(.*)\]/).slice(1);
}
return ['', name];
}