MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / splitIntoLines

Function splitIntoLines

codebase/sources/dhtmlxscheduler.es.js:18067–18091  ·  view source on GitHub ↗
(s, unfold)

Source from the content-addressed store, hash-verified

18065 return { name: parms[0].toUpperCase(), parms: parms.slice(1), value };
18066}
18067function splitIntoLines(s, unfold) {
18068 if (unfold === void 0) {
18069 unfold = false;
18070 }
18071 s = s && s.trim();
18072 if (!s)
18073 throw new Error("Invalid empty string");
18074 if (!unfold) {
18075 return s.split(/\s/);
18076 }
18077 var lines = s.split("\n");
18078 var i = 0;
18079 while (i < lines.length) {
18080 var line = lines[i] = lines[i].replace(/\s+$/g, "");
18081 if (!line) {
18082 lines.splice(i, 1);
18083 } else if (i > 0 && line[0] === " ") {
18084 lines[i - 1] += line.slice(1);
18085 lines.splice(i, 1);
18086 } else {
18087 i += 1;
18088 }
18089 }
18090 return lines;
18091}
18092function validateDateParm(parms) {
18093 parms.forEach(function(parm) {
18094 if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) {

Callers 1

parseInputFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected