Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function extractValues(input) {
- // Extract object name
- let start = input.indexOf("'") + 1;
- let end = input.indexOf("'", start);
- const objectName = input.substring(start, end);
- // Extract field name
- start = input.indexOf("'$.") + 3;
- end = input.indexOf("'", start);
- const fieldName = input.substring(start, end);
- // Extract rejected value
- start = input.indexOf("[") + 1;
- end = input.indexOf("]", start);
- const rejectedValue = input.substring(start, end);
- return { objectName, fieldName, rejectedValue };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement