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

Function parseModel

static/vuejs/vue.common.js:5615–5641  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

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