Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_regeneratorRuntime.mark(function _callee(settings) {
var _context, e, digest, url, data;
return _regeneratorRuntime.wrap(function _callee$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.prev = 0;
settings = settings || {};
settings.cache = settings.cache === false ? false : true;
url = settings.url || this.url;
if (!url) url = _sliceInstanceProperty(_context = window.location.href.split("/")).call(_context, 0, 3).join("/");
url = url.toLowerCase();
if (_indexOfInstanceProperty(url).call(url, "_api") !== -1) url = url.split("_api")[0];else if (_indexOfInstanceProperty(url).call(url, "_vti_bin/client.svc/processquery") !== -1) url = url.split("_vti_bin/client.svc/processquery")[0]; // check cache
if (settings.cache) digest = global._SP_CACHE_REQUESTDIGEST[url];
if (!digest) {
_context2.next = 11;
break;
_regeneratorRuntime.mark(function _callee() {
var _len2,
args,
_key2,
item,
_args = arguments;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
for (_len2 = _args.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = _args[_key2];
}
if (!(_this2.queue.length > 0)) {
_context.next = 4;
break;
}
item = _this2.queue.shift();
return _context.abrupt("return", item.fct.apply(_this2, item.args).then(function () {
return fct.apply(_this2, args);
}));
_regeneratorRuntime.mark(function _callee(options) {
var bodyContent, prop, params, url;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
bodyContent = "";
if (options.service) {
_context.next = 4;
break;
}
throw "Error 'webService': the option 'service' is required";
case 4:
if (options.operation) {
_context.next = 6;
_regeneratorRuntime.mark(function _callee(username, setup) {
var data,
aResult,
children,
name,
value,
i,
lenR,
j,
lenC,
_args = arguments;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.t0 = _args.length;
_context.next = _context.t0 === 0 ? 4 : _context.t0 === 1 ? 7 : 9;
break;
case 4:
username = "";
setup = {};
return _context.abrupt("break", 9);
case 7:
if (typeof username === "string") setup = {};else {
setup = username;