MCPcopy
hub / github.com/t4t5/sweetalert / array

Function array

docs/assets/js/add-preview-buttons.js:50971–51004  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50969 // Place holder for the value function.
50970
50971 array = function array() {
50972
50973 // Parse an array value.
50974
50975 var array = [];
50976
50977 if (ch === '[') {
50978 next('[');
50979 white();
50980 while (ch) {
50981 if (ch === ']') {
50982 next(']');
50983 return array; // Potentially empty array
50984 }
50985 // ES5 allows omitting elements in arrays, e.g. [,] and
50986 // [,null]. We don't allow this in JSON5.
50987 if (ch === ',') {
50988 error("Missing array element");
50989 } else {
50990 array.push(value());
50991 }
50992 white();
50993 // If there's no comma after this value, this needs to
50994 // be the end of the array.
50995 if (ch !== ',') {
50996 next(']');
50997 return array;
50998 }
50999 next(',');
51000 white();
51001 }
51002 }
51003 error("Bad array");
51004 },
51005 object = function object() {
51006
51007 // Parse an object value.

Callers 1

Calls 3

nextFunction · 0.70
whiteFunction · 0.70
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…