olum-compiler 0.2.7 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/bin/build.js +9 -0
- package/bin/compiler.js +23 -0
- package/bin/copySrc.js +22 -0
- package/bin/dev.js +47 -0
- package/bin/index.js +1 -24
- package/bin/mimes.json +340 -0
- package/bin/server.js +77 -0
- package/bin/watcher.js +6 -0
- package/bin/ws.js +54 -0
- package/core/app.js +530 -0
- package/lib/attr.js +39 -0
- package/lib/clean.js +4 -0
- package/lib/colors.js +72 -0
- package/lib/compPlaceholder.js +10 -0
- package/lib/compiler.js +21 -0
- package/lib/cssParser.js +87 -0
- package/lib/domEvents.js +112 -0
- package/lib/events.js +48 -0
- package/lib/for.js +71 -0
- package/lib/getImports.js +48 -0
- package/lib/getTempPath.js +13 -0
- package/lib/helpers.js +509 -0
- package/lib/htmlParser.js +71 -0
- package/lib/if.js +65 -0
- package/lib/jsParser.js +31 -0
- package/lib/lineCounter.js +31 -0
- package/lib/log.txt +0 -0
- package/lib/mode.js +12 -0
- package/lib/models.js +51 -0
- package/lib/parser.js +170 -0
- package/lib/placeholder.js +76 -0
- package/lib/regex.js +12 -0
- package/lib/show.js +22 -0
- package/lib/sourcemap.js +34 -0
- package/lib/styles.js +32 -0
- package/lib/toJs.js +12 -0
- package/lib/tokens.js +14 -0
- package/package.json +7 -39
- package/babel.config.json +0 -4
- package/compiler.js +0 -486
- package/tasks/build.js +0 -24
- package/tasks/bundle.js +0 -33
- package/tasks/catchall.js +0 -39
- package/tasks/clean.js +0 -18
- package/tasks/compile.js +0 -32
- package/tasks/copy-build.js +0 -33
- package/tasks/desktop.js +0 -63
- package/tasks/dev.js +0 -18
- package/tasks/index.js +0 -12
- package/tasks/linux.js +0 -255
- package/tasks/logger.js +0 -19
- package/tasks/mac.js +0 -8
- package/tasks/reload.js +0 -7
- package/tasks/server.js +0 -26
- package/tasks/watch.js +0 -44
- package/tasks/windows.js +0 -8
- package/webpack.config.js +0 -152
package/lib/cssParser.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const { style } = require("./regex");
|
|
2
|
+
|
|
3
|
+
function escapeRe(str) {
|
|
4
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// Rename @keyframes declarations and all their animation/animation-name references
|
|
8
|
+
// to <name>-<compName> so same-named keyframes in different components don't collide.
|
|
9
|
+
function renameKeyframes(css, compName) {
|
|
10
|
+
const names = [];
|
|
11
|
+
css.replace(/@keyframes\s+([\w-]+)/g, (_, name) => names.push(name));
|
|
12
|
+
if (!names.length) return css;
|
|
13
|
+
names.forEach(name => {
|
|
14
|
+
const re = escapeRe(name);
|
|
15
|
+
const newName = name + "-" + compName;
|
|
16
|
+
css = css.replace(new RegExp(`(@keyframes\\s+)${re}\\b`, "g"), "$1" + newName);
|
|
17
|
+
css = css.replace(new RegExp(`(animation-name\\s*:[^;{]*)\\b${re}\\b`, "g"), "$1" + newName);
|
|
18
|
+
css = css.replace(new RegExp(`(animation\\s*:[^;{]*)\\b${re}\\b`, "g"), "$1" + newName);
|
|
19
|
+
});
|
|
20
|
+
return css;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function scopeCSS(css, scopeAttr, compName) {
|
|
24
|
+
css = renameKeyframes(css, compName);
|
|
25
|
+
css = css.replace(/\/\*[\s\S]*?\*\//g, ""); // strip comments
|
|
26
|
+
|
|
27
|
+
const scope = `[data-o-${scopeAttr}]`;
|
|
28
|
+
let out = "";
|
|
29
|
+
let i = 0;
|
|
30
|
+
|
|
31
|
+
function skipWS() {
|
|
32
|
+
while (i < css.length && /\s/.test(css[i])) i++;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function readBlock() {
|
|
36
|
+
let depth = 1, content = "";
|
|
37
|
+
i++; // skip opening {
|
|
38
|
+
while (i < css.length && depth > 0) {
|
|
39
|
+
if (css[i] === "{") depth++;
|
|
40
|
+
else if (css[i] === "}") { depth--; if (depth === 0) { i++; break; } }
|
|
41
|
+
if (depth > 0) content += css[i];
|
|
42
|
+
i++;
|
|
43
|
+
}
|
|
44
|
+
return content;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function scopeSelectors(sel) {
|
|
48
|
+
return sel.split(",").map(s => {
|
|
49
|
+
s = s.trim();
|
|
50
|
+
if (!s) return "";
|
|
51
|
+
if (/^(:root|html|body)\b/.test(s)) return s;
|
|
52
|
+
return scope + " " + s; // descendant combinator — root is now stamped so this covers all cases
|
|
53
|
+
}).filter(Boolean).join(", ");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
while (i < css.length) {
|
|
57
|
+
skipWS();
|
|
58
|
+
if (i >= css.length) break;
|
|
59
|
+
const blockStart = css.indexOf("{", i);
|
|
60
|
+
if (blockStart === -1) break;
|
|
61
|
+
const selector = css.slice(i, blockStart).trim();
|
|
62
|
+
i = blockStart;
|
|
63
|
+
const content = readBlock();
|
|
64
|
+
if (/^@keyframes\b/i.test(selector) || /^@font-face\b/i.test(selector)) {
|
|
65
|
+
out += selector + " {" + content + "}\n";
|
|
66
|
+
} else if (/^@(media|supports|layer|container)\b/i.test(selector)) {
|
|
67
|
+
out += selector + " {" + scopeCSS(content, scopeAttr, compName) + "}\n";
|
|
68
|
+
} else {
|
|
69
|
+
out += scopeSelectors(selector) + " {" + content + "}\n";
|
|
70
|
+
}
|
|
71
|
+
skipWS();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function cssParser(str, scopeAttr, compName) {
|
|
78
|
+
const arr = str.match(style);
|
|
79
|
+
let content = Array.isArray(arr) && arr.length ? arr[arr.length - 1] : "";
|
|
80
|
+
content = content.replace(/(<style.*?>)/, "");
|
|
81
|
+
content = content.replace(/(<\/style>)$/, "");
|
|
82
|
+
content = content.trim();
|
|
83
|
+
if (scopeAttr && compName && content) content = scopeCSS(content, scopeAttr, compName);
|
|
84
|
+
return "__style__() { return `" + content + "`;},\n";
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
module.exports = cssParser;
|
package/lib/domEvents.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
"onsearch",
|
|
3
|
+
"onappinstalled",
|
|
4
|
+
"onbeforeinstallprompt",
|
|
5
|
+
"onbeforexrselect",
|
|
6
|
+
"onabort",
|
|
7
|
+
"onblur",
|
|
8
|
+
"oncancel",
|
|
9
|
+
"oncanplay",
|
|
10
|
+
"oncanplaythrough",
|
|
11
|
+
"onchange",
|
|
12
|
+
"onclick",
|
|
13
|
+
"onclose",
|
|
14
|
+
"oncontextmenu",
|
|
15
|
+
"oncuechange",
|
|
16
|
+
"ondblclick",
|
|
17
|
+
"ondrag",
|
|
18
|
+
"ondragend",
|
|
19
|
+
"ondragenter",
|
|
20
|
+
"ondragleave",
|
|
21
|
+
"ondragover",
|
|
22
|
+
"ondragstart",
|
|
23
|
+
"ondrop",
|
|
24
|
+
"ondurationchange",
|
|
25
|
+
"onemptied",
|
|
26
|
+
"onended",
|
|
27
|
+
"onerror",
|
|
28
|
+
"onfocus",
|
|
29
|
+
"onformdata",
|
|
30
|
+
"oninput",
|
|
31
|
+
"oninvalid",
|
|
32
|
+
"onkeydown",
|
|
33
|
+
"onkeypress",
|
|
34
|
+
"onkeyup",
|
|
35
|
+
"onload",
|
|
36
|
+
"onloadeddata",
|
|
37
|
+
"onloadedmetadata",
|
|
38
|
+
"onloadstart",
|
|
39
|
+
"onmousedown",
|
|
40
|
+
"onmouseenter",
|
|
41
|
+
"onmouseleave",
|
|
42
|
+
"onmousemove",
|
|
43
|
+
"onmouseout",
|
|
44
|
+
"onmouseover",
|
|
45
|
+
"onmouseup",
|
|
46
|
+
"onmousewheel",
|
|
47
|
+
"onpause",
|
|
48
|
+
"onplay",
|
|
49
|
+
"onplaying",
|
|
50
|
+
"onprogress",
|
|
51
|
+
"onratechange",
|
|
52
|
+
"onreset",
|
|
53
|
+
"onresize",
|
|
54
|
+
"onscroll",
|
|
55
|
+
"onsecuritypolicyviolation",
|
|
56
|
+
"onseeked",
|
|
57
|
+
"onseeking",
|
|
58
|
+
"onselect",
|
|
59
|
+
"onslotchange",
|
|
60
|
+
"onstalled",
|
|
61
|
+
"onsubmit",
|
|
62
|
+
"onsuspend",
|
|
63
|
+
"ontimeupdate",
|
|
64
|
+
"ontoggle",
|
|
65
|
+
"onvolumechange",
|
|
66
|
+
"onwaiting",
|
|
67
|
+
"onwebkitanimationend",
|
|
68
|
+
"onwebkitanimationiteration",
|
|
69
|
+
"onwebkitanimationstart",
|
|
70
|
+
"onwebkittransitionend",
|
|
71
|
+
"onwheel",
|
|
72
|
+
"onauxclick",
|
|
73
|
+
"ongotpointercapture",
|
|
74
|
+
"onlostpointercapture",
|
|
75
|
+
"onpointerdown",
|
|
76
|
+
"onpointermove",
|
|
77
|
+
"onpointerup",
|
|
78
|
+
"onpointercancel",
|
|
79
|
+
"onpointerover",
|
|
80
|
+
"onpointerout",
|
|
81
|
+
"onpointerenter",
|
|
82
|
+
"onpointerleave",
|
|
83
|
+
"onselectstart",
|
|
84
|
+
"onselectionchange",
|
|
85
|
+
"onanimationend",
|
|
86
|
+
"onanimationiteration",
|
|
87
|
+
"onanimationstart",
|
|
88
|
+
"ontransitionrun",
|
|
89
|
+
"ontransitionstart",
|
|
90
|
+
"ontransitionend",
|
|
91
|
+
"ontransitioncancel",
|
|
92
|
+
"onafterprint",
|
|
93
|
+
"onbeforeprint",
|
|
94
|
+
"onbeforeunload",
|
|
95
|
+
"onhashchange",
|
|
96
|
+
"onlanguagechange",
|
|
97
|
+
"onmessage",
|
|
98
|
+
"onmessageerror",
|
|
99
|
+
"onoffline",
|
|
100
|
+
"ononline",
|
|
101
|
+
"onpagehide",
|
|
102
|
+
"onpageshow",
|
|
103
|
+
"onpopstate",
|
|
104
|
+
"onrejectionhandled",
|
|
105
|
+
"onstorage",
|
|
106
|
+
"onunhandledrejection",
|
|
107
|
+
"onunload",
|
|
108
|
+
"ondevicemotion",
|
|
109
|
+
"ondeviceorientation",
|
|
110
|
+
"ondeviceorientationabsolute",
|
|
111
|
+
"onpointerrawupdate"
|
|
112
|
+
];
|
package/lib/events.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const events = require("./domEvents");
|
|
2
|
+
const { getLineInfo } = require("./lineCounter");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
|
|
5
|
+
function handleEvents(body, counter, filePath) {
|
|
6
|
+
let name = path.basename(filePath).replace(/\.html/i, "");
|
|
7
|
+
name = name.slice(0, 1).toLowerCase() + name.slice(1); // make compName camel case
|
|
8
|
+
|
|
9
|
+
const elms = new Array().slice.call(body.querySelectorAll("*"));
|
|
10
|
+
elms.forEach(item => {
|
|
11
|
+
events.forEach(e => {
|
|
12
|
+
if (item.hasAttribute(e)) {
|
|
13
|
+
const attrValue = item.getAttribute(e);
|
|
14
|
+
let methods = attrValue.split("),");
|
|
15
|
+
methods = methods.map(str => (str.replace(/\)$/, "") + ")").trim());
|
|
16
|
+
let methodsNames = methods.map(str => (str.trim().split("(")[0]).trim());
|
|
17
|
+
let methodsArgs = methods.map(str => (str.trim().split("(")[1].replace(/\)$/, "")).trim());
|
|
18
|
+
|
|
19
|
+
function handle$event(str) {
|
|
20
|
+
return str.replace(/\$event/g, "'$event'")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// added special delimiters for json in attribute to overcome double quotes issue -[[- , -]]-
|
|
24
|
+
let chain = e+"|"
|
|
25
|
+
methodsNames.forEach((item, index) => {
|
|
26
|
+
if (index === methodsNames.length - 1) return chain += item + "=${JSON.stringify([" + handle$event(methodsArgs[index]) +"])}-]]-"
|
|
27
|
+
chain += item + "=${JSON.stringify([" + handle$event(methodsArgs[index]) + "])}&";
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
chain = chain.replace(/{/g, "<-olum->") // using <-olum-> (<-olum->) as placeholder for "{"
|
|
31
|
+
// console.log({chain});
|
|
32
|
+
item.setAttribute("data-o-event", "-[[-"+chain);
|
|
33
|
+
item.removeAttribute(e);
|
|
34
|
+
// console.log(item.outerHTML);
|
|
35
|
+
|
|
36
|
+
// todo handle direct logic inside event attribute with needing to invoke a method
|
|
37
|
+
const mode = item.getAttribute("mode");
|
|
38
|
+
if (mode) {
|
|
39
|
+
item.setAttribute("data-o-event-mode", mode);
|
|
40
|
+
item.removeAttribute("mode");
|
|
41
|
+
}
|
|
42
|
+
// console.log(item.outerHTML + "\n----------");
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = handleEvents;
|
package/lib/for.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const { getLineInfo } = require("./lineCounter");
|
|
2
|
+
const { forOf, forIn } = require("./regex");
|
|
3
|
+
const { isNum,id } = require("./helpers");
|
|
4
|
+
const { RAW_OPEN, RAW_CLOSE } = require("./tokens");
|
|
5
|
+
|
|
6
|
+
function handleForStatement(body, counter, filePath) {
|
|
7
|
+
// using <-olum-> (<-olum->) as placeholder for "{" inside map method
|
|
8
|
+
const forElms = new Array().slice.call(body.querySelectorAll("for")).reverse(); // we must reverse to start with the very deep if tag which doesn't have nested if tags inside it
|
|
9
|
+
forElms.forEach(item => {
|
|
10
|
+
// console.log(item.outerHTML + "\n----------");
|
|
11
|
+
if (item.hasAttribute("each")) {
|
|
12
|
+
const condition = item.getAttribute("each").trim().replace(/^\{|\}$/g, "");
|
|
13
|
+
|
|
14
|
+
// #3 (keyed reconciliation): if the <for> declares key={expr}, stamp every component
|
|
15
|
+
// placeholder in this loop with data-o-key="{expr}". `expr` references the loop variable, so
|
|
16
|
+
// each iteration emits a distinct key, and the runtime (buildTree) reuses the matching
|
|
17
|
+
// instance by identity instead of by position. <for>s are processed deepest-first, so a
|
|
18
|
+
// nested loop has already stamped its own placeholders — we skip any that are already keyed.
|
|
19
|
+
const keyAttr = item.getAttribute("key");
|
|
20
|
+
if (keyAttr) {
|
|
21
|
+
const keyExpr = keyAttr.trim().replace(/^\{|\}$/g, "");
|
|
22
|
+
new Array().slice.call(item.querySelectorAll("olum")).forEach(olum => {
|
|
23
|
+
if (!olum.hasAttribute("data-o-key")) olum.setAttribute("data-o-key", "{" + keyExpr + "}");
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const innerContent = item.innerHTML;
|
|
28
|
+
|
|
29
|
+
// for of loop
|
|
30
|
+
condition.replace(forOf, (str, $1, $2, $3) => {
|
|
31
|
+
if (isNum($3)) {
|
|
32
|
+
const params = $1.replace(/\(|\)/g, "");
|
|
33
|
+
const [param1] = params.split(",");
|
|
34
|
+
const mkID = id();
|
|
35
|
+
let variable = param1 + "=index"+mkID+"+1";
|
|
36
|
+
// RAW_OPEN/RAW_CLOSE wrap the structural interpolation so #2's escape pass keeps the
|
|
37
|
+
// .map().join('') raw (it produces HTML). <-olum-> is the map callback's own `{` brace.
|
|
38
|
+
const loop = RAW_OPEN + "new Array(" + $3 + ").fill().map(function(" + param1 +", index"+mkID+ ")<-olum->\n"+ variable +"\nreturn`" + innerContent + "`;\n}).join('')" + RAW_CLOSE;
|
|
39
|
+
item.insertAdjacentHTML("beforebegin", loop);
|
|
40
|
+
item.remove();
|
|
41
|
+
} else {
|
|
42
|
+
// console.log({ condition, innerContent });
|
|
43
|
+
// console.log("for of loop", { str, $1, $2, $3 });
|
|
44
|
+
const params = $1.replace(/\(|\)/g, "");
|
|
45
|
+
const loop = RAW_OPEN + $3 + ".map(function(" + params + ")<-olum->\nreturn`" + innerContent + "`;\n}).join('')" + RAW_CLOSE;
|
|
46
|
+
item.insertAdjacentHTML("beforebegin", loop);
|
|
47
|
+
item.remove();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// for in loop
|
|
52
|
+
condition.replace(forIn, (str, $1, $2, $3) => {
|
|
53
|
+
// console.log({ condition, innerContent });
|
|
54
|
+
// console.log("for in loop", { str, $1, $2, $3 });
|
|
55
|
+
const params = $1.replace(/\(|\)/g, "");
|
|
56
|
+
const [param1, param2, param3] = params.split(",");
|
|
57
|
+
// console.log({ param1, param2, param3 });
|
|
58
|
+
const value = param3 ? param3 + "=" + $3 + "[" + param1 + "];" : "";
|
|
59
|
+
const loop = RAW_OPEN + "Object.keys(" + $3 + ").map(function(" + params + ")<-olum->\n" + value + "\nreturn`" + innerContent + "`;\n}).join('')" + RAW_CLOSE;
|
|
60
|
+
item.insertAdjacentHTML("beforebegin", loop);
|
|
61
|
+
item.remove();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
} else {
|
|
65
|
+
const msg = "Missing 'each' attribute:";
|
|
66
|
+
getLineInfo(counter, item, filePath, msg);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
module.exports = handleForStatement;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const esprima = require("esprima");
|
|
2
|
+
const { isFullArr } = require("./helpers");
|
|
3
|
+
// FYI: it ignores the comments by default beacuse it's based on lexial environment not based on regex
|
|
4
|
+
function getImports(str) {
|
|
5
|
+
let finalImports = [];
|
|
6
|
+
let arr = esprima.parse(str, { sourceType: "module" }).body;
|
|
7
|
+
arr.forEach((obj) => {
|
|
8
|
+
if (obj.type === "ImportDeclaration") {
|
|
9
|
+
if (obj.specifiers) {
|
|
10
|
+
if (isFullArr(obj.specifiers)) {
|
|
11
|
+
if (obj.specifiers.length === 1) {
|
|
12
|
+
if (obj.specifiers[0].type == "ImportDefaultSpecifier") {
|
|
13
|
+
// default
|
|
14
|
+
const name = obj.specifiers[0].local.name;
|
|
15
|
+
const statement = "import " + name + " from " + obj.source.raw;
|
|
16
|
+
finalImports.push({ statement, regex: `(from)(\\s+)?(${obj.source.raw}).*`});
|
|
17
|
+
// console.log("default: ", statement);
|
|
18
|
+
} else {
|
|
19
|
+
// non-default
|
|
20
|
+
const name = obj.specifiers[0].local.name;
|
|
21
|
+
const statement = "import { " + name + " } from " + obj.source.raw;
|
|
22
|
+
finalImports.push({ statement, regex: `(from)(\\s+)?(${obj.source.raw}).*` });
|
|
23
|
+
// console.log("Non-default: ", statement);
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
let defaultItem = null;
|
|
27
|
+
let nonDefaultArr = [];
|
|
28
|
+
obj.specifiers.forEach((item) => {
|
|
29
|
+
if (item.type === "ImportDefaultSpecifier") defaultItem = item.local.name;
|
|
30
|
+
if (item.type === "ImportSpecifier") nonDefaultArr.push(item.local.name);
|
|
31
|
+
});
|
|
32
|
+
const statement = "import " + (defaultItem ? defaultItem + ", " : "") + "{ " + nonDefaultArr.join(", ") + " } from " + obj.source.raw;
|
|
33
|
+
finalImports.push({ statement, regex: `(from)(\\s+)?(${obj.source.raw}).*` });
|
|
34
|
+
// console.log("mix: ", statement);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
// import only
|
|
38
|
+
const statement = "import " + obj.source.raw;
|
|
39
|
+
finalImports.push({ statement, type: "noFrom", regex: `(import)(\\s+)?(${obj.source.raw}).*\\n?` });
|
|
40
|
+
// console.log("import only: ", statement);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return finalImports.length ? finalImports : null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = getImports;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const { ls, isFile, isHTML } = require("./helpers");
|
|
3
|
+
const isComp = str => !/^_/.test(str); // if doesn't have underscore
|
|
4
|
+
|
|
5
|
+
function getTempPath() {
|
|
6
|
+
const entryPoint = path.resolve(__dirname, "../src");
|
|
7
|
+
let paths = ls(entryPoint);
|
|
8
|
+
// clean paths
|
|
9
|
+
paths = paths.map((item) => (isFile(item) && isHTML(item) && isComp(path.basename(item)) ? item : null)).filter((item) => item);
|
|
10
|
+
return paths;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = getTempPath;
|