MCPcopy Create free account
hub / github.com/TruthHun/BookStack / parseModel

Function parseModel

static/vuejs/vue.esm.js:5613–5639  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

5611var expressionEndPos;
5612
5613function parseModel (val) {
5614 str = val;
5615 len = str.length;
5616 index$1 = expressionPos = expressionEndPos = 0;
5617
5618 if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
5619 return {
5620 exp: val,
5621 idx: null
5622 }
5623 }
5624
5625 while (!eof()) {
5626 chr = next();
5627 /* istanbul ignore if */
5628 if (isStringStart(chr)) {
5629 parseString(chr);
5630 } else if (chr === 0x5B) {
5631 parseBracket(chr);
5632 }
5633 }
5634
5635 return {
5636 exp: val.substring(0, expressionPos),
5637 idx: val.substring(expressionPos + 1, expressionEndPos)
5638 }
5639}
5640
5641function next () {
5642 return str.charCodeAt(++index$1)

Callers 1

genAssignmentCodeFunction · 0.70

Calls 5

eofFunction · 0.70
nextFunction · 0.70
isStringStartFunction · 0.70
parseStringFunction · 0.70
parseBracketFunction · 0.70

Tested by

no test coverage detected