Comparing version 1.19.1 to 1.19.2
@@ -0,1 +1,7 @@ | ||
## 3 August 2019 | ||
### [1.19.2](https://github.com/artdecocode/typal/compare/v1.19.1...v1.19.2) | ||
- [deps] Install missing `@wrote/read`. | ||
## 1 August 2019 | ||
@@ -2,0 +8,0 @@ |
@@ -85,6 +85,6 @@ #!/usr/bin/env node | ||
var g = Object.assign({}, e); | ||
e = e.v; | ||
g = (delete g.v, g); | ||
e = e.u; | ||
g = (delete g.u, g); | ||
if (0 == e.length && d) { | ||
return Object.assign({}, {v:e}, g); | ||
return Object.assign({}, {u:e}, g); | ||
} | ||
@@ -100,7 +100,7 @@ const h = a[f]; | ||
} catch (l) { | ||
return Object.assign({}, {v:e}, g); | ||
return Object.assign({}, {u:e}, g); | ||
} | ||
} | ||
return void 0 === k ? Object.assign({}, {v:e}, g) : Object.assign({}, {v:e}, g, {[f]:k}); | ||
}, {v:b}); | ||
return void 0 === k ? Object.assign({}, {u:e}, g) : Object.assign({}, {u:e}, g, {[f]:k}); | ||
}, {u:b}); | ||
}(ha), w = v.source, ja = v.output, ka = v.closure, la = v.externs, ma = v.types, na = v.template, oa = v.migrate, pa = v.help, qa = v.version; | ||
@@ -189,6 +189,6 @@ function ra(a = {usage:{}}) { | ||
b = (delete c.binary, delete c.rs, c); | ||
const {S:f = C(!0), proxyError:g} = a || {}, h = (k, l) => f(l); | ||
const {R:f = C(!0), proxyError:g} = a || {}, h = (k, l) => f(l); | ||
super(b); | ||
this.b = []; | ||
this.P = new Promise((k, l) => { | ||
this.O = new Promise((k, l) => { | ||
this.on("finish", () => { | ||
@@ -218,3 +218,3 @@ let m; | ||
get f() { | ||
return this.P; | ||
return this.O; | ||
} | ||
@@ -224,3 +224,3 @@ } | ||
var b = void 0 === b ? {} : b; | ||
({f:a} = new Ha(Object.assign({}, {rs:a}, b, {S:C(!0)}))); | ||
({f:a} = new Ha(Object.assign({}, {rs:a}, b, {R:C(!0)}))); | ||
return await a; | ||
@@ -362,3 +362,3 @@ }; | ||
;const Oa = a => new RegExp(`%%_RESTREAM_${a.toUpperCase()}_REPLACEMENT_(\\d+)_%%`, "g"), Pa = (a, b) => `%%_RESTREAM_${a.toUpperCase()}_REPLACEMENT_${b}_%%`, Qa = () => { | ||
var a = {T:/^\/\*\*? (documentary|typal) (.+?) externs (.*?)\*\/\n(?:([^\n][\s\S]+?\n))?$/mg}; | ||
var a = {S:/^\/\*\*? (documentary|typal) (.+?) externs (.*?)\*\/\n(?:([^\n][\s\S]+?\n))?$/mg}; | ||
return Object.keys(a).reduce((b, c) => { | ||
@@ -390,4 +390,3 @@ { | ||
async function Ta(a, b) { | ||
b instanceof va ? b.pipe(a) : a.end(b); | ||
return await D(a); | ||
return Ua(a, b); | ||
} | ||
@@ -459,4 +458,8 @@ class L extends y { | ||
} | ||
;function Ua() { | ||
var a = Va; | ||
async function Ua(a, b) { | ||
b instanceof va ? b.pipe(a) : a.end(b); | ||
return await D(a); | ||
} | ||
;function Va() { | ||
var a = Wa; | ||
let b = ""; | ||
@@ -482,3 +485,3 @@ const c = new y({transform(d, e, f) { | ||
return `${a}=${b}`; | ||
}, Wa = ({number:a, O:b, boolean:c, type:d}) => b ? "string" : a ? "number" : c ? "boolean" : d ? d : "*", Xa = a => `${/[^\w\d._]/.test(a) ? `(${a})` : a}|undefined`, Ya = a => `/** | ||
}, Xa = ({number:a, N:b, boolean:c, type:d}) => b ? "string" : a ? "number" : c ? "boolean" : d ? d : "*", Ya = a => `${/[^\w\d._]/.test(a) ? `(${a})` : a}|undefined`, Za = a => `/** | ||
${a} | ||
@@ -529,8 +532,8 @@ */ | ||
} | ||
;const Za = new RegExp(`${/([^\s>=/]+)/.source}(?:\\s*=\\s*${/(?:"([\s\S]*?)"|'([\s\S]*?)')/.source})?`, "g"), $a = new RegExp(`\\s*((?:${Za.source}\\s*)*)`); | ||
const T = (a, b) => S(new RegExp(`<${a}${$a.source}?(?:${/\s*\/>/.source}|${(new RegExp(`>([\\s\\S]+?)?</${a}>`)).source})`, "g"), b, ["a", "v", "v1", "v2", "c"]).map(({a:c = "", c:d = ""}) => { | ||
;const $a = new RegExp(`${/([^\s>=/]+)/.source}(?:\\s*=\\s*${/(?:"([\s\S]*?)"|'([\s\S]*?)')/.source})?`, "g"), ab = new RegExp(`\\s*((?:${$a.source}\\s*)*)`); | ||
const T = (a, b) => S(new RegExp(`<${a}${ab.source}?(?:${/\s*\/>/.source}|${(new RegExp(`>([\\s\\S]+?)?</${a}>`)).source})`, "g"), b, ["a", "v", "v1", "v2", "c"]).map(({a:c = "", c:d = ""}) => { | ||
c = c.replace(/\/$/, "").trim(); | ||
c = ab(c); | ||
return {content:d, u:c}; | ||
}), ab = a => S(Za, a, ["key", "val", "def", "f"]).reduce((b, {key:c, val:d}) => { | ||
c = bb(c); | ||
return {content:d, props:c}; | ||
}), bb = a => S($a, a, ["key", "val", "def", "f"]).reduce((b, {key:c, val:d}) => { | ||
if (void 0 === d) { | ||
@@ -542,3 +545,3 @@ return b[c] = !0, b; | ||
}, {}); | ||
const bb = a => a.split(/([!?=*(),:.<>{}|\s+])/g).filter(b => /\S/.test(b)).map(b => { | ||
const cb = a => a.split(/([!?=*(),:.<>{}|\s+])/g).filter(b => /\S/.test(b)).map(b => { | ||
switch(b) { | ||
@@ -560,3 +563,3 @@ case "function": | ||
}); | ||
function cb(a) { | ||
function db(a) { | ||
let b = 0; | ||
@@ -709,7 +712,7 @@ const c = (d, e) => { | ||
} | ||
;function db(a) { | ||
a = bb(a); | ||
return cb(a); | ||
;function eb(a) { | ||
a = cb(a); | ||
return db(a); | ||
} | ||
;function eb(a, b, {name:c, string:d, "boolean":e, opt:f, number:g, type:h}) { | ||
;function fb(a, b, {name:c, string:d, "boolean":e, opt:f, number:g, type:h}) { | ||
if (!c) { | ||
@@ -720,6 +723,6 @@ throw Error("Argument does not have a name."); | ||
b && (a.description = R(b)); | ||
a.type = Wa({number:g, O:d, boolean:e, type:h}); | ||
a.type = Xa({number:g, N:d, boolean:e, type:h}); | ||
f && (a.optional = !0); | ||
} | ||
class fb { | ||
class gb { | ||
constructor() { | ||
@@ -732,13 +735,13 @@ this.name = null; | ||
} | ||
const gb = a => { | ||
const hb = a => { | ||
let b = a.lastIndexOf("</arg>"), c = a; | ||
var d = []; | ||
-1 != b && (b += 6, d = a.slice(0, b), c = a.slice(b), d = T("arg", d), d = d.map(({content:e, u:f}) => { | ||
const g = new fb; | ||
eb(g, e, f); | ||
-1 != b && (b += 6, d = a.slice(0, b), c = a.slice(b), d = T("arg", d), d = d.map(({content:e, props:f}) => { | ||
const g = new gb; | ||
fb(g, e, f); | ||
return g; | ||
})); | ||
return {V:c, K:d}; | ||
return {U:c, J:d}; | ||
}; | ||
function hb(a, b, {name:c, string:d, "boolean":e, opt:f, number:g, type:h, "default":k, closure:l, alias:m, aliases:n, noParams:p}) { | ||
function ib(a, b, {name:c, string:d, "boolean":e, opt:f, number:g, type:h, "default":k, closure:l, alias:m, aliases:n, noParams:p}) { | ||
if (!c) { | ||
@@ -749,3 +752,3 @@ throw Error("Property does not have a name."); | ||
b && (a.description = R(b)); | ||
a.type = Wa({number:g, O:d, boolean:e, type:h}); | ||
a.type = Xa({number:g, N:d, boolean:e, type:h}); | ||
l ? a.g = l : a.g = a.type; | ||
@@ -757,8 +760,8 @@ void 0 !== k && (a.f = !0); | ||
} | ||
m && (a.A = [m]); | ||
n && (a.A = n.split(/\s*,\s*/)); | ||
m && (a.w = [m]); | ||
n && (a.w = n.split(/\s*,\s*/)); | ||
p && (a.l = p); | ||
if (!a.optional && !a.l) { | ||
try { | ||
a.b = db(a.g); | ||
a.b = eb(a.g); | ||
} catch (q) { | ||
@@ -768,3 +771,3 @@ } | ||
} | ||
function ib(a, b = null, c = !1) { | ||
function jb(a, b = null, c = !1) { | ||
if (!a.name) { | ||
@@ -776,7 +779,7 @@ throw Error("Property does not have a name. Has it been constructed using fromXML?"); | ||
} | ||
function jb(a, b = !1) { | ||
a = ib(a, null, b); | ||
return ` * @prop ${kb(a, !0)}`; | ||
function kb(a, b = !1) { | ||
a = jb(a, null, b); | ||
return ` * @prop ${lb(a, !0)}`; | ||
} | ||
function lb(a) { | ||
function mb(a) { | ||
const b = [], {function:{args:c, return:d}} = a.b; | ||
@@ -793,14 +796,14 @@ c.map(U).forEach((e, f) => { | ||
} | ||
function mb(a, b = "") { | ||
function nb(a, b = "") { | ||
let c = []; | ||
if (a.description) { | ||
let d = kb(a.description); | ||
let d = lb(a.description); | ||
a.default && (d += ` Default \`${a.default}\`.`); | ||
c.push(d); | ||
} | ||
a.b && "function" == a.b.name ? (a = lb(a), c.push(...a)) : c.push(` * @type {${a.optional ? Xa(a.g) : a.g}}`); | ||
a.b && "function" == a.b.name ? (a = mb(a), c.push(...a)) : c.push(` * @type {${a.optional ? Ya(a.g) : a.g}}`); | ||
b && (c = c.map(d => `${b}${d}`)); | ||
return c.join("\n"); | ||
} | ||
function nb(a, b) { | ||
function ob(a, b) { | ||
const c = Object.assign(Object.create(Object.getPrototypeOf(a)), a); | ||
@@ -811,3 +814,3 @@ c.description = `An alias for \`${a.name}\`.`; | ||
} | ||
class ob { | ||
class pb { | ||
constructor(a = []) { | ||
@@ -820,3 +823,3 @@ this.description = this.name = null; | ||
this.optional = !1; | ||
this.A = []; | ||
this.w = []; | ||
this.l = !1; | ||
@@ -827,8 +830,8 @@ this.b = null; | ||
} | ||
J(a, b = "", c = !1) { | ||
a = ib(this, a, c); | ||
I(a, b = "", c = !1) { | ||
a = jb(this, a, c); | ||
return `${b} * @param ${a}`; | ||
} | ||
} | ||
const kb = (a, b = !1) => a.split("\n").map((c, d) => { | ||
const lb = (a, b = !1) => a.split("\n").map((c, d) => { | ||
if (b && !d) { | ||
@@ -895,5 +898,5 @@ return c; | ||
g && (a.description = R(g)); | ||
a.N = !!h; | ||
a.M = !!k; | ||
a.L = !!l; | ||
a.M = !!h; | ||
a.L = !!k; | ||
a.K = !!l; | ||
a.import = !!m; | ||
@@ -903,12 +906,12 @@ n && (a.link = n); | ||
!0 === u && (a.f = u); | ||
!0 === M && (a.I = M); | ||
!0 === M && (a.H = M); | ||
t && (a.extends = t); | ||
if (b) { | ||
c = T("prop", b).map(r => { | ||
var {content:Y, u:z} = r; | ||
r = new ob; | ||
hb(r, Y, z); | ||
var {content:Y, props:z} = r; | ||
r = new pb; | ||
ib(r, Y, z); | ||
return r; | ||
}); | ||
const Ab = T("function", b), Bb = T("fn", b); | ||
const Bb = T("function", b), Cb = T("fn", b); | ||
b = T("static", b).map(r => { | ||
@@ -918,5 +921,5 @@ r.isStatic = !0; | ||
}); | ||
b = [...Ab, ...Bb, ...b].map(r => { | ||
var {content:Y, u:z, isStatic:Cb} = r; | ||
const {V:Db, K:Z} = gb(Y); | ||
b = [...Bb, ...Cb, ...b].map(r => { | ||
var {content:Y, props:z, isStatic:Db} = r; | ||
const {U:Eb, J:Z} = hb(Y); | ||
var B = Object.assign({}, z); | ||
@@ -927,11 +930,11 @@ r = z.async; | ||
let {args:aa = ""} = z; | ||
!aa && Z.length && (aa = Z.map(Eb => { | ||
var {type:xa, optional:Fb} = Eb; | ||
return null !== Fb ? `${xa}=` : xa; | ||
!aa && Z.length && (aa = Z.map(Fb => { | ||
var {type:xa, optional:Gb} = Fb; | ||
return null !== Gb ? `${xa}=` : xa; | ||
}).join(",")); | ||
N = N.replace(/\n\s*/g, " "); | ||
B.type = `function(${aa}): ${r ? `!Promise<${N}>` : N}`; | ||
r = new ob(Z); | ||
hb(r, Db, B); | ||
Cb && (r.o = !0); | ||
r = new pb(Z); | ||
ib(r, Eb, B); | ||
Db && (r.o = !0); | ||
return r; | ||
@@ -943,8 +946,8 @@ }); | ||
} | ||
function pb(a) { | ||
var b = qb(a), c = a.b ? `function(${a.b.map(d => { | ||
function qb(a) { | ||
var b = rb(a), c = a.b ? `function(${a.b.map(d => { | ||
({name:d} = d); | ||
return d; | ||
})}) {}` : null; | ||
b.push(` * @${a.U}`); | ||
b.push(` * @${a.T}`); | ||
b = `/** | ||
@@ -957,7 +960,7 @@ ${b.join("\n")} | ||
d.push(e); | ||
const f = e.A.map(g => nb(e, g)); | ||
const f = e.w.map(g => ob(e, g)); | ||
d.push(...f); | ||
return d; | ||
}, []).map(d => { | ||
let e = mb(d); | ||
let e = nb(d); | ||
e = `/** | ||
@@ -981,14 +984,14 @@ ${e} | ||
} | ||
function rb(a, b) { | ||
function sb(a, b) { | ||
const c = `${a.extends ? "$" : ""}${a.name}`; | ||
return b ? `${a.w}${c}` : c; | ||
return b ? `${a.v}${c}` : c; | ||
} | ||
function sb(a, b, c) { | ||
var d = ` * @typedef {${(b ? a.g : a.type) || "Object"}}${` ${rb(a, b)}${a.o}`}`; | ||
function tb(a, b, c) { | ||
var d = ` * @typedef {${(b ? a.g : a.type) || "Object"}}${` ${sb(a, b)}${a.o}`}`; | ||
a = (a.i ? a.i.reduce((e, f) => { | ||
e.push(f); | ||
const g = f.A.map(h => nb(f, h)); | ||
const g = f.w.map(h => ob(f, h)); | ||
e.push(...g); | ||
return e; | ||
}, []) : []).map(e => jb(e, b)); | ||
}, []) : []).map(e => kb(e, b)); | ||
d = [d, ...a].join("\n"); | ||
@@ -1001,6 +1004,6 @@ b && !c && (d = P(d)); | ||
} | ||
function tb(a, b, c) { | ||
function ub(a, b, c) { | ||
b = void 0 === b ? !1 : b; | ||
c = void 0 === c ? !1 : c; | ||
const d = !!a.extends, e = sb(a, b, c), f = []; | ||
const d = !!a.extends, e = tb(a, b, c), f = []; | ||
if (a.j && b) { | ||
@@ -1015,3 +1018,3 @@ let g = ` * @typedef {${a.h}} ${a.name}${a.o}`; | ||
} | ||
d && (a = ` * @typedef {${a.extends} & ${rb(a, b)}} ${b ? a.h : a.name}${a.o}`, b && !c && (a = P(a)), a = `/** | ||
d && (a = ` * @typedef {${a.extends} & ${sb(a, b)}} ${b ? a.h : a.name}${a.o}`, b && !c && (a = P(a)), a = `/** | ||
${a} | ||
@@ -1023,3 +1026,3 @@ */ | ||
} | ||
function qb(a, b) { | ||
function rb(a, b) { | ||
b = void 0 === b ? "" : b; | ||
@@ -1039,10 +1042,10 @@ let c = []; | ||
this.name = ""; | ||
this.link = this.L = this.import = this.M = this.N = this.description = this.g = this.type = null; | ||
this.link = this.K = this.import = this.L = this.M = this.description = this.g = this.type = null; | ||
this.i = []; | ||
this.j = null; | ||
this.I = this.f = this.isConstructor = !1; | ||
this.H = this.f = this.isConstructor = !1; | ||
this.b = this.extends = null; | ||
} | ||
get W() { | ||
return this.isConstructor || this.f || this.I; | ||
get V() { | ||
return this.isConstructor || this.f || this.H; | ||
} | ||
@@ -1052,3 +1055,3 @@ get o() { | ||
} | ||
get U() { | ||
get T() { | ||
const a = this.l; | ||
@@ -1061,11 +1064,11 @@ if (!a) { | ||
get l() { | ||
return this.isConstructor ? "constructor" : this.f ? "interface" : this.I ? "record" : ""; | ||
return this.isConstructor ? "constructor" : this.f ? "interface" : this.H ? "record" : ""; | ||
} | ||
get w() { | ||
get v() { | ||
return this.j ? `${this.j}.` : ""; | ||
} | ||
get h() { | ||
return `${this.w}${this.name}`; | ||
return `${this.v}${this.name}`; | ||
} | ||
J(a, b, c, d, e) { | ||
I(a, b, c, d, e) { | ||
e = void 0 === e ? !1 : e; | ||
@@ -1075,9 +1078,9 @@ var f = ""; | ||
d = this.description ? ` ${this.description}` : ""; | ||
const g = this.M ? ub(this.i) : e ? this.h : this.name; | ||
const g = this.L ? vb(this.i) : e ? this.h : this.name; | ||
b = `${c || ""} * @param {${f}${g}} ${b ? `[${a}]` : a}${d}`; | ||
f = this.i && !this.L ? this.i.map(h => h.J(a, c, e)) : []; | ||
f = this.i && !this.K ? this.i.map(h => h.I(a, c, e)) : []; | ||
return [b, ...f].join("\n"); | ||
} | ||
} | ||
const ub = (a, b) => { | ||
const vb = (a, b) => { | ||
a = void 0 === a ? [] : a; | ||
@@ -1087,3 +1090,3 @@ b = void 0 === b ? !1 : b; | ||
c.push(d); | ||
const e = d.A.map(f => Object.assign({}, d, {name:f})); | ||
const e = d.w.map(f => Object.assign({}, d, {name:f})); | ||
c.push(...e); | ||
@@ -1095,36 +1098,36 @@ return c; | ||
let e = c.name, f = d; | ||
c.optional && !b ? e = `${c.name}?` : c.optional && b && (f = `(${Xa(d)})`); | ||
c.optional && !b ? e = `${c.name}?` : c.optional && b && (f = `(${Ya(d)})`); | ||
return `${e}: ${f}`; | ||
}).join(", ")} }`; | ||
}; | ||
function vb(a, {name:b, from:c, desc:d, link:e, ns:f}) { | ||
function wb(a, {name:b, from:c, desc:d, link:e, ns:f}) { | ||
a.name = b; | ||
a.from = c; | ||
a.G = d; | ||
a.F = d; | ||
a.link = e; | ||
a.w = f || a.from; | ||
a.v = f || a.from; | ||
} | ||
function wb(a, b = !0) { | ||
function xb(a, b = !0) { | ||
return ` * @typedef {import('${a.from}').${a.name}} ${b ? a.h : a.name}`; | ||
} | ||
class xb { | ||
class yb { | ||
constructor() { | ||
this.from = this.name = this.w = ""; | ||
this.link = this.G = null; | ||
this.from = this.name = this.v = ""; | ||
this.link = this.F = null; | ||
} | ||
get h() { | ||
return `${this.w}.${this.name}`; | ||
return `${this.v}.${this.name}`; | ||
} | ||
} | ||
;function yb(a, b) { | ||
;function zb(a, b) { | ||
b = b.reduce((c, d) => Object.assign({}, c, {[d.h]:d}), {}); | ||
a.F = Object.assign({}, a.F, b); | ||
a.D = Object.assign({}, a.D, b); | ||
} | ||
class zb extends L { | ||
class Ab extends L { | ||
constructor(a, b) { | ||
b = void 0 === b ? {} : b; | ||
super(a); | ||
this.F = {}; | ||
this.D = {}; | ||
this.on("types", c => { | ||
yb(this, c); | ||
zb(this, c); | ||
}); | ||
@@ -1144,9 +1147,9 @@ this.on("namespace", c => { | ||
static get b() { | ||
return xb; | ||
return yb; | ||
} | ||
get types() { | ||
return this.F; | ||
return this.D; | ||
} | ||
} | ||
;const Gb = a => { | ||
;const Hb = a => { | ||
a = T("types", a); | ||
@@ -1156,4 +1159,4 @@ if (!a.length) { | ||
} | ||
const [{content:b, u:{namespace:c, ns:d = c}}] = a, e = void 0 == d ? void 0 : d; | ||
a = T("type", b).map(({content:h, u:k}) => { | ||
const [{content:b, props:{namespace:c, ns:d = c}}] = a, e = void 0 == d ? void 0 : d; | ||
a = T("type", b).map(({content:h, props:k}) => { | ||
const l = new W; | ||
@@ -1163,7 +1166,7 @@ V(l, h, k, e); | ||
}); | ||
var f = T("interface", b).map(({content:h, u:k}) => { | ||
var f = T("interface", b).map(({content:h, props:k}) => { | ||
const l = new W, m = h.search(/<(prop|function|fn|static) /); | ||
let n = "", p = h; | ||
1 != m && (n = h.slice(0, m), p = h.slice(m)); | ||
({K:h} = gb(n)); | ||
({J:h} = hb(n)); | ||
V(l, p, k, e); | ||
@@ -1175,17 +1178,17 @@ l.b = h; | ||
a = [...a, ...f]; | ||
f = T("import", b).map(({u:h, content:k}) => { | ||
const l = new xb; | ||
f = T("import", b).map(({props:h, content:k}) => { | ||
const l = new yb; | ||
k && (h.desc = R(k)); | ||
vb(l, h); | ||
wb(l, h); | ||
return l; | ||
}); | ||
const g = f.map(({name:h, from:k, G:l, link:m, w:n}) => { | ||
const g = f.map(({name:h, from:k, F:l, link:m, v:n}) => { | ||
const p = new W; | ||
V(p, "", {name:h, type:`import('${k}').${h}`, N:!0, import:!0, G:l, link:m}, void 0 == n ? void 0 : n); | ||
V(p, "", {name:h, type:`import('${k}').${h}`, M:!0, import:!0, F:l, link:m}, void 0 == n ? void 0 : n); | ||
return p; | ||
}); | ||
return {j:d, types:a, imports:f, X:g}; | ||
}, Hb = async(a, b = []) => { | ||
return {j:d, types:a, imports:f, W:g}; | ||
}, Ib = async(a, b = []) => { | ||
a = await E(a); | ||
let {j:c = null, types:d, imports:e} = Gb(a); | ||
let {j:c = null, types:d, imports:e} = Hb(a); | ||
d = d.filter(({h:f}) => b.includes(f) ? !1 : !0); | ||
@@ -1195,6 +1198,6 @@ e = e.filter(({h:f}) => b.includes(f) ? !1 : !0); | ||
}; | ||
const Ib = (a, b, c) => { | ||
b = b.map(d => tb(d, !0, c)); | ||
const Jb = (a, b, c) => { | ||
b = b.map(d => ub(d, !0, c)); | ||
a = a.map(d => { | ||
d = wb(d); | ||
d = xb(d); | ||
return `/** | ||
@@ -1206,11 +1209,11 @@ ${c ? d : P(d)} | ||
return [...b, ...a].join(""); | ||
}, Jb = (a, b, c, d = !1) => { | ||
}, Kb = (a, b, c, d = !1) => { | ||
a = [...a.map(e => { | ||
{ | ||
let f; | ||
e.g ? f = ` * @typedef {${e.g}}` : e.W || (f = ` * @typedef {${ub(e.i, !0)}}`); | ||
e.g ? f = ` * @typedef {${e.g}}` : e.V || (f = ` * @typedef {${vb(e.i, !0)}}`); | ||
f ? (e.description && (f = ` * ${e.description}\n${f}`), f = `/** | ||
${f} | ||
*/ | ||
`, e = f += Q(e.j, e.name)) : e = pb(e); | ||
`, e = f += Q(e.j, e.name)) : e = qb(e); | ||
} | ||
@@ -1223,7 +1226,7 @@ return e; | ||
}; | ||
const Lb = {re:/^\/\*\*? (documentary|typal) (.+?) \*\/\n(?:([^\n][\s\S]+?\n))?$/mg, replacement:async function(a, b, c) { | ||
const Mb = {re:/^\/\*\*? (documentary|typal) (.+?) \*\/\n(?:([^\n][\s\S]+?\n))?$/mg, replacement:async function(a, b, c) { | ||
const [d, ...e] = c.split(/\s+/), f = e.includes("closure"), g = e.includes("externs"), h = e.includes("noSuppress"), k = e.includes("skipNsDecl"); | ||
let l = e.find(p => p.startsWith("ignore:")); | ||
l = l ? l.replace("ignore:", "").split(",") : []; | ||
let {D:m, H:n} = this.l; | ||
let {C:m, G:n} = this.l; | ||
f && (m = !0); | ||
@@ -1233,7 +1236,7 @@ g && (n = !0); | ||
this.m("Detected type marker: %s", c); | ||
const {types:p, imports:q, j:t} = await Hb(d, l); | ||
const {types:p, imports:q, j:t} = await Ib(d, l); | ||
this.emit("types", p); | ||
this.emit("types", q); | ||
let u; | ||
m ? u = Ib(q, p, h) : n ? (u = Jb(p, t, this.b, k) + "\n", t && this.emit("namespace", t)) : u = Kb(q, p); | ||
m ? u = Jb(q, p, h) : n ? (u = Kb(p, t, this.b, k) + "\n", t && this.emit("namespace", t)) : u = Lb(q, p); | ||
return `/* ${b} ${c} */\n${u}`; | ||
@@ -1243,11 +1246,11 @@ } catch (p) { | ||
} | ||
}}, Kb = (a, b) => { | ||
b = b.map(c => tb(c)); | ||
a = a.map(c => wb(c, !1)).map(Ya).join(""); | ||
}}, Lb = (a, b) => { | ||
b = b.map(c => ub(c)); | ||
a = a.map(c => xb(c, !1)).map(Za).join(""); | ||
b = b.join(""); | ||
return `${a}${b}`.replace(Mb, " * @typedef"); | ||
}, Mb = / \*\/\n\/\*\*\n \* @typedef/g; | ||
const Ob = {re:/( *) \* @param {(.+?)} (\[)?([^\s\]]+)\]?(?: .+)?((?:\n(?: +)\* @param {(?:.+?)} \[?\4\]?.*)*)/gm, replacement:Nb}; | ||
function Nb(a, b, c, d, e, f, g) { | ||
const {D:h} = this.l; | ||
return `${a}${b}`.replace(Nb, " * @typedef"); | ||
}, Nb = / \*\/\n\/\*\*\n \* @typedef/g; | ||
const Pb = {re:/( *) \* @param {(.+?)} (\[)?([^\s\]]+)\]?(?: .+)?((?:\n(?: +)\* @param {(?:.+?)} \[?\4\]?.*)*)/gm, replacement:Ob}; | ||
function Ob(a, b, c, d, e, f, g) { | ||
const {C:h} = this.l; | ||
let k; | ||
@@ -1262,5 +1265,5 @@ f = () => { | ||
} | ||
m = {line:m, R:b.length + 11}; | ||
m = {line:m, P:b.length + 11}; | ||
} | ||
const {line:n, R:p} = m; | ||
const {line:n, P:p} = m; | ||
this.m("%s:%s:%s", this.file, n, p); | ||
@@ -1270,3 +1273,3 @@ } | ||
try { | ||
k = db(c); | ||
k = eb(c); | ||
} catch (m) { | ||
@@ -1283,3 +1286,3 @@ return this.m("Error while parsing the type %s", c), this.m(process.env.DEBUG ? m.stack : m.message), f(), a; | ||
c = Object.values(this.types).find(({name:m, h:n}) => h ? n == k.name : m == k.name); | ||
return !c || c instanceof zb.b ? a : c.J(e, d, b, k.nullable, h); | ||
return !c || c instanceof Ab.b ? a : c.I(e, d, b, k.nullable, h); | ||
} | ||
@@ -1292,3 +1295,3 @@ const X = (a, b, c, d, e) => { | ||
let h = b.includes(f); | ||
h || (h = Pb.includes(f)); | ||
h || (h = Qb.includes(f)); | ||
if (h) { | ||
@@ -1312,11 +1315,11 @@ return !0; | ||
} | ||
}, Pb = "String Boolean Object Date Number Symbol Buffer Function".split(" "); | ||
var Qb = (a, b = !1) => { | ||
var {T:c} = Qa(); | ||
}, Qb = "String Boolean Object Date Number Symbol Buffer Function".split(" "); | ||
var Rb = (a, b = !1) => { | ||
var {S:c} = Qa(); | ||
const d = Sa(c); | ||
c = Ra(c); | ||
return new zb(b ? [Lb] : [Lb, d, Ob, c], a); | ||
return new Ab(b ? [Mb] : [Mb, d, Pb, c], a); | ||
}; | ||
var Sb = async() => { | ||
const {D:a = !1, H:b = !1, B:c, types:d} = {D:ka, H:la, B:ja, types:ma}; | ||
var Tb = async() => { | ||
const {C:a = !1, G:b = !1, A:c, types:d} = {C:ka, G:la, A:ja, types:ma}; | ||
await Promise.all(w.map(async e => { | ||
@@ -1326,10 +1329,10 @@ var f = await G(x, e); | ||
f.isFile() ? g = [e] : f.isDirectory() && (f = await I(e), g = J(f.content, e)); | ||
await Rb(g, a, b, c, d); | ||
await Sb(g, a, b, c, d); | ||
})); | ||
}; | ||
const Rb = async(a, b = !1, c = !1, d = null, e = null) => { | ||
const Sb = async(a, b = !1, c = !1, d = null, e = null) => { | ||
const f = []; | ||
e && await Promise.all(e.split(",").map(async g => { | ||
g = await E(g); | ||
const {types:h, imports:k} = Gb(g); | ||
const {types:h, imports:k} = Hb(g); | ||
f.push(h, k); | ||
@@ -1339,3 +1342,3 @@ })); | ||
var h = await E(g); | ||
const k = Qb({D:b, H:c}, c); | ||
const k = Rb({C:b, G:c}, c); | ||
f.forEach(l => k.emit("types", l)); | ||
@@ -1350,7 +1353,7 @@ k.file = g; | ||
}; | ||
const Tb = a => { | ||
const Ub = a => { | ||
let b; | ||
"true" == a ? b = !0 : "false" == a ? b = !1 : /^\d+$/.test(a) && (b = parseInt(a, 10)); | ||
return void 0 !== b ? b : a; | ||
}, Ub = /^ \* @prop {(.+?)} (\[)?(.+?)(?:=(["'])?(.+?)\4)?(?:])?(?: (.+?))?(?: Default `(.+?)`.)?$/gm, Vb = "type opt name quote defaultValue description Default".split(" "), Va = new RegExp(`^ \\* @typedef {(.+?)} (.+?)(?: (.+))?\\n((?:${/ \* @prop(?:erty)? .+\n/.source})*)`, "gm"), Wb = (a, b, c, d) => { | ||
}, Vb = /^ \* @prop {(.+?)} (\[)?(.+?)(?:=(["'])?(.+?)\4)?(?:])?(?: (.+?))?(?: Default `(.+?)`.)?$/gm, Wb = "type opt name quote defaultValue description Default".split(" "), Wa = new RegExp(`^ \\* @typedef {(.+?)} (.+?)(?: (.+))?\\n((?:${/ \* @prop(?:erty)? .+\n/.source})*)`, "gm"), Xb = (a, b, c, d) => { | ||
d = d.length; | ||
@@ -1361,3 +1364,3 @@ a = a && "Object" != a ? ` type="${a}"` : ""; | ||
}; | ||
class Xb extends y { | ||
class Yb extends y { | ||
constructor() { | ||
@@ -1368,3 +1371,3 @@ super({writableObjectMode:!0}); | ||
var {type:d, name:e, description:f, i:g} = a; | ||
a = d && d.startsWith("import") ? Yb(d, e) : Wb(d, e, f, g); | ||
a = d && d.startsWith("import") ? Zb(d, e) : Xb(d, e, f, g); | ||
this.push(a); | ||
@@ -1387,3 +1390,3 @@ g.forEach(h => { | ||
} | ||
const Yb = (a, b) => { | ||
const Zb = (a, b) => { | ||
const c = /import\((['"])(.+?)\1\)/.exec(a); | ||
@@ -1396,3 +1399,3 @@ if (!c) { | ||
}; | ||
class Zb extends y { | ||
class $b extends y { | ||
constructor() { | ||
@@ -1403,3 +1406,3 @@ super({objectMode:!0}); | ||
var [, d, e, f, g] = a; | ||
a = S(Ub, g, Vb).map(h => { | ||
a = S(Vb, g, Wb).map(h => { | ||
var k = Object.assign({}, h), l = h.defaultValue; | ||
@@ -1411,5 +1414,5 @@ const m = h.Default; | ||
k = (delete k.defaultValue, delete k.Default, delete k.opt, delete k.name, delete k.type, k); | ||
n = Object.assign({}, k, {name:p, type:h}, l ? {defaultValue:Tb(l)} : {}, m ? {C:Tb(m)} : {}, n ? {optional:!0} : {}); | ||
n = Object.assign({}, k, {name:p, type:h}, l ? {defaultValue:Ub(l)} : {}, m ? {B:Ub(m)} : {}, n ? {optional:!0} : {}); | ||
if (l || m) { | ||
l ? l !== m && void 0 !== n.C && (l = O(p, m, h), console.error("%s[%s] does not match Default `%s`.", e, l, n.C)) : (l = O(p, m, h), console.error("%s[%s] got from Default.", e, l)), n.default = "defaultValue" in n ? n.defaultValue : n.C, delete n.defaultValue, delete n.C; | ||
l ? l !== m && void 0 !== n.B && (l = O(p, m, h), console.error("%s[%s] does not match Default `%s`.", e, l, n.B)) : (l = O(p, m, h), console.error("%s[%s] got from Default.", e, l)), n.default = "defaultValue" in n ? n.defaultValue : n.B, delete n.defaultValue, delete n.B; | ||
} | ||
@@ -1422,4 +1425,4 @@ return n; | ||
} | ||
async function $b(a) { | ||
const b = Ua(), c = new Zb, d = new Xb; | ||
async function ac(a) { | ||
const b = Va(), c = new $b, d = new Yb; | ||
b.pipe(c).pipe(d); | ||
@@ -1443,14 +1446,14 @@ b.end(a); | ||
} | ||
;var ac = async() => { | ||
const {B:a} = {B:ja}; | ||
;var bc = async() => { | ||
const {A:a} = {A:ja}; | ||
await Promise.all(w.map(async b => { | ||
b = await E(b); | ||
b = await $b(b); | ||
b = await ac(b); | ||
a ? await F(a, b) : console.log(b); | ||
})); | ||
}; | ||
const bc = /( *) \* @fnType {(.+?)}/gm; | ||
class cc extends L { | ||
const cc = /( *) \* @fnType {(.+?)}/gm; | ||
class dc extends L { | ||
constructor(a, b) { | ||
super([{re:bc, async replacement(c, d, e) { | ||
super([{re:cc, async replacement(c, d, e) { | ||
e = e.split("."); | ||
@@ -1472,10 +1475,10 @@ let f, g; | ||
if ("constructor" == g) { | ||
return qb(e, d).join("\n"); | ||
return rb(e, d).join("\n"); | ||
} | ||
e = e.i.find(({name:h}) => h == g); | ||
return e ? e.b ? mb(e, d) : (console.error("Property %s of type %s in %s wasn't parsed, possibly parser bug.", g, f, b), c) : (console.error("Property %s of type %s in %s not found", g, f, b), c); | ||
return e ? e.b ? nb(e, d) : (console.error("Property %s of type %s in %s wasn't parsed, possibly parser bug.", g, f, b), c) : (console.error("Property %s of type %s in %s not found", g, f, b), c); | ||
}}]); | ||
} | ||
} | ||
;const dc = async a => { | ||
;const ec = async a => { | ||
if (!a) { | ||
@@ -1491,4 +1494,4 @@ return []; | ||
return c; | ||
}, ec = async a => (await Promise.all(a.map(async b => { | ||
const c = await Hb(b); | ||
}, fc = async a => (await Promise.all(a.map(async b => { | ||
const c = await Ib(b); | ||
return Object.assign({}, c, {location:b}); | ||
@@ -1501,8 +1504,8 @@ }))).reduce((b, c) => { | ||
}, []); | ||
async function fc() { | ||
var a = {B:na, types:ma}; | ||
async function gc() { | ||
var a = {A:na, types:ma}; | ||
a = void 0 === a ? {} : a; | ||
const {B:b, types:c} = a; | ||
a = await dc(c); | ||
const d = await ec(a); | ||
const {A:b, types:c} = a; | ||
a = await ec(c); | ||
const d = await fc(a); | ||
await Promise.all(w.map(async e => { | ||
@@ -1512,6 +1515,6 @@ var f = await G(x, e); | ||
f.isFile() ? g = [e] : f.isDirectory() && (f = await I(e), g = J(f.content, e)); | ||
await gc(g, d, b); | ||
await hc(g, d, b); | ||
})); | ||
} | ||
const gc = async(a, b, c) => { | ||
const hc = async(a, b, c) => { | ||
b = void 0 === b ? [] : b; | ||
@@ -1521,3 +1524,3 @@ c = void 0 === c ? null : c; | ||
var e = await E(d); | ||
const f = new cc(b, d); | ||
const f = new dc(b, d); | ||
f.end(e); | ||
@@ -1537,3 +1540,3 @@ e = await D(f); | ||
try { | ||
return oa ? await ac() : na ? await fc() : await Sb(); | ||
return oa ? await bc() : na ? await gc() : await Tb(); | ||
} catch (a) { | ||
@@ -1540,0 +1543,0 @@ process.env.DEBUG ? console.log(a.stack) : console.log(a.message); |
{ | ||
"name": "typal", | ||
"version": "1.19.1", | ||
"version": "1.19.2", | ||
"description": "Organises TypeDefs By Placing Them Into Types.Xml File To Be Embedded Into Source Code Compatible With VSCode And Google Closure Compiler, Generates Externs And Allows To Place Documentation In README Markdown.", | ||
@@ -68,15 +68,15 @@ "main": "build/index.js", | ||
"@artdeco/clean-stack": "^1.1.1", | ||
"@wrote/read": "^1.0.4", | ||
"@wrote/read-dir-structure": "^1.2.0", | ||
"@wrote/write": "^1.0.4", | ||
"@zoroaster/mask": "^2.2.0", | ||
"alamode": "^2.3.6", | ||
"alamode": "^2.4.0", | ||
"argufy": "^1.7.1", | ||
"catchment": "^3.3.0", | ||
"documentary": "^1.28.2", | ||
"documentary": "^1.30.1", | ||
"erotic": "^2.1.1", | ||
"erte": "^1.2.0", | ||
"eslint-config-artdeco": "1.0.1", | ||
"makepromise": "^3.1.0", | ||
"preact": "8.4.2", | ||
"restream": "^3.7.2", | ||
"preact": "8.5.0", | ||
"restream": "^3.7.3", | ||
"temp-context": "^2.1.3", | ||
@@ -89,5 +89,6 @@ "usually": "^1.2.0", | ||
"@typedefs/parser": "^1.3.2", | ||
"@wrote/read": "^1.0.4", | ||
"mismatch": "^1.2.0", | ||
"rexml": "^2.0.3" | ||
"rexml": "^2.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
301651
5529
4
+ Added@wrote/read@^1.0.4
+ Added@artdeco/clean-stack@1.2.1(transitive)
+ Added@wrote/read@1.0.4(transitive)
+ Addedcatchment@3.3.0(transitive)
+ Addederotic@2.1.1(transitive)
Updatedrexml@^2.1.0