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

Function splitIntoLines

codebase/sources/dhtmlxscheduler.js:18071–18095  ·  view source on GitHub ↗
(s, unfold)

Source from the content-addressed store, hash-verified

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

Callers 1

parseInputFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected