diff --git a/index.js b/index.js index 9979360..65ae47c 100644 --- a/index.js +++ b/index.js @@ -29539,16 +29539,11 @@ const getMin = (number) => { // myGlobalFields, parameters, }) => { - await external_fs_.promises.appendFile( - fileName, - '#### parameters\n\n', - ); - if (!parameters.length) { + if (parameters.length) { await external_fs_.promises.appendFile( fileName, - '*[none]*\n', + '#### parameters\n\n', ); - } else { await table_header({ headings: [ ['name'], @@ -29584,41 +29579,31 @@ const getMin = (number) => { myDisplayFields, display, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n## reference objects\n', - ); const referenceObjects = myDisplayFields(display) .referenceObjects(); - await sequence( - referenceObjects - .map( - (referenceObject) => () => external_fs_.promises.appendFile( - fileName, - `\n### ${ - referenceObject.name - }\n\n**${ - referenceObject.type - }**\n\n[${ - referenceObject.linkBaseObject - }](../globals/${ - referenceObject.linkBaseObject.split('.')[0] - }/${ - referenceObject.linkBaseObject - }.md)\n\n`, - ).then( - () => parameters({ - fileName, - parameters: referenceObject.parameters, - }), - ), - ), - ); - - if (!referenceObjects.length) { + if (referenceObjects.length) { await external_fs_.promises.appendFile( fileName, - '\n*[none]*\n', + '\n## reference objects\n', + ); + await sequence( + referenceObjects + .map( + (referenceObject) => () => external_fs_.promises.appendFile( + fileName, + `\n### ${referenceObject.name + }\n\n**${referenceObject.type + }**\n\n[${referenceObject.linkBaseObject + }](../globals/${referenceObject.linkBaseObject.split('.')[0] + }/${referenceObject.linkBaseObject + }.md)\n\n`, + ).then( + () => parameters({ + fileName, + parameters: referenceObject.parameters, + }), + ), + ), ); } }); @@ -29632,14 +29617,13 @@ const getMin = (number) => { myDisplayFields, display, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n## display-references\n\n', - ); const references = myDisplayFields(display) .displayReferences(); if (references.length) { - console.log({ displayRef: fileName }); + await external_fs_.promises.appendFile( + fileName, + '\n## display-references\n\n', + ); await sequence( references .map( @@ -29649,11 +29633,6 @@ const getMin = (number) => { ), ), ); - } else { - await external_fs_.promises.appendFile( - fileName, - '*[none]*\n', - ); } }); @@ -29667,11 +29646,11 @@ const getMin = (number) => { fileName, animations, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n#### animations\n\n', - ); if (animations.length) { + await external_fs_.promises.appendFile( + fileName, + '\n#### animations\n\n', + ); await table_header({ fileName, headings: [ @@ -29691,11 +29670,6 @@ const getMin = (number) => { }), ), ); - } else { - await external_fs_.promises.appendFile( - fileName, - '*[none]*\n', - ); } }); @@ -29709,11 +29683,11 @@ const getMin = (number) => { fileName, connections, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n#### connections\n\n', - ); if (connections.length) { + await external_fs_.promises.appendFile( + fileName, + '\n#### connections\n\n', + ); await table_header({ fileName, headings: [ @@ -29733,11 +29707,6 @@ const getMin = (number) => { }), ), ); - } else { - await external_fs_.promises.appendFile( - fileName, - '*[none]*\n', - ); } }); @@ -29806,11 +29775,6 @@ const findDisplay = (line, link) => { ), ); } - } else { - await external_fs_.promises.appendFile( - fileName, - '*[none]*\n', - ); } }); @@ -29824,15 +29788,17 @@ const findDisplay = (line, link) => { command, link, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n#### command\n\n', - ); - await lines({ - fileName, - command, - link, - }); + if (command) { + await external_fs_.promises.appendFile( + fileName, + '\n#### command\n\n', + ); + await lines({ + fileName, + command, + link, + }); + } }); ;// CONCATENATED MODULE: ./src/document/lib/animated/touch.js @@ -29845,15 +29811,17 @@ const findDisplay = (line, link) => { touch, link, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n#### touch\n\n', - ); - await lines({ - fileName, - command: touch, - link, - }); + if (touch) { + await external_fs_.promises.appendFile( + fileName, + '\n#### touch\n\n', + ); + await lines({ + fileName, + command: touch, + link, + }); + } }); ;// CONCATENATED MODULE: ./src/document/displays/animateds/index.js @@ -29870,75 +29838,72 @@ const findDisplay = (line, link) => { display, xml, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n## animated\n', - ); const animateds = myDisplayFields(display) .animated(); - await sequence( - animateds - .map( - (animated) => () => external_fs_.promises.appendFile( - fileName, - `\n### ${animated.name}\n\n *${animated.type}*\n`, - ) - .then( - () => { - const l1 = animated.xml().split(/\r?\n/)[0]; - const l = xml.split(/\r?\n/) - .reduce( - (acc, line, index) => { - if (line.indexOf(l1) > -1) { - return index; - } - return acc; - }, - -1, - ); - return external_fs_.promises.appendFile( - fileName, - `\n[xml](${'../'.repeat(fileName.split('/').length - 1)}${display.file.replaceAll(' ', '%20')}#L${l + 1})\n`, - ); - }, - ) - .then( - () => animations({ - fileName, - animations: animated - .animations(), - }), - ).then( - () => connections({ - fileName, - connections: animated - .connections(), - }), - ) - .then( - () => command({ - fileName, - command: animated - .command(), - link: './', - }), - ) - .then( - () => touch({ - fileName, - touch: animated - .touch(), - link: './', - }), - ), - ), - ); - if (!animateds.length) { await external_fs_.promises.appendFile( fileName, - '*[none]*\n', + '\n## animated\n', ); + + await sequence( + animateds + .map( + (animated) => () => external_fs_.promises.appendFile( + fileName, + `\n### ${animated.name}\n\n *${animated.type}*\n`, + ) + .then( + () => { + const l1 = animated.xml().split(/\r?\n/)[0]; + const l = xml.split(/\r?\n/) + .reduce( + (acc, line, index) => { + if (line.indexOf(l1) > -1) { + return index; + } + return acc; + }, + -1, + ); + return external_fs_.promises.appendFile( + fileName, + `\n[xml](${'../'.repeat(fileName.split('/').length - 1)}${display.file.replaceAll(' ', '%20')}#L${l + 1})\n`, + ); + }, + ) + .then( + () => animations({ + fileName, + animations: animated + .animations(), + }), + ).then( + () => connections({ + fileName, + connections: animated + .connections(), + }), + ) + .then( + () => command({ + fileName, + command: animated + .command(), + link: './', + }), + ) + .then( + () => touch({ + fileName, + touch: animated + .touch(), + link: './', + }), + ), + ), + ); + } }); @@ -29953,13 +29918,13 @@ const findDisplay = (line, link) => { display, displays, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n## reference-object-references\n', - ); const references = myDisplayFields(display) .referenceObjectReferences(); if (references.length) { + await external_fs_.promises.appendFile( + fileName, + '\n## reference-object-references\n', + ); await sequence( references .map( @@ -29985,11 +29950,6 @@ const findDisplay = (line, link) => { ), ), ); - } else { - await external_fs_.promises.appendFile( - fileName, - '\n*[none]*\n', - ); } }); @@ -30002,14 +29962,13 @@ const findDisplay = (line, link) => { myDisplayFields, display, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n## global-references\n\n', - ); const references = myDisplayFields(display) .globalReferences(); if (references.length) { - console.log({global: fileName}); + await external_fs_.promises.appendFile( + fileName, + '\n## global-references\n\n', + ); await sequence( references .map( @@ -30019,11 +29978,6 @@ const findDisplay = (line, link) => { ), ), ); - } else { - await external_fs_.promises.appendFile( - fileName, - '*[none]*\n', - ); } }); @@ -30100,16 +30054,11 @@ const findDisplay = (line, link) => { // myGlobalFields, object, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n## parameters\n\n', - ); - if (!object.parameters.length) { + if (object.parameters.length) { await external_fs_.promises.appendFile( fileName, - '*[none]*\n', + '\n## parameters\n\n', ); - } else { await table_header({ headings: [ ['name'], @@ -30162,16 +30111,11 @@ const findDisplay = (line, link) => { ); const references = object.references(); - await external_fs_.promises.appendFile( - fileName, - '\n## references\n\n', - ); - if (!references.length) { + if (references.length) { await external_fs_.promises.appendFile( fileName, - '*[none]*\n\n', + '\n## references\n\n', ); - } else { await sequence( references .map( @@ -30207,16 +30151,11 @@ const findDisplay = (line, link) => { line: objectLine, file, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n## animated\n', - ); - if (!object.animated.length) { + if (object.animated.length) { await external_fs_.promises.appendFile( fileName, - '*[none]*\n\n', + '\n## animated\n', ); - } else { await sequence( object.animated .map( @@ -30287,76 +30226,71 @@ const findDisplay = (line, link) => { /* harmony default export */ const objects = (async ({ fileName, dir, - myObjectFields, myGlobalFields, myDisplayFields, global, displays, }) => { - await external_fs_.promises.appendFile( - fileName, - '\n## objects\n\n', - ); const objects = myGlobalFields(global) .objects(); - await sequence( - objects - .map( - (object) => () => external_fs_.promises.appendFile( - fileName, - `* [${object.id}](./${object.id}.md)\n`, - ).then( - () => external_fs_.promises.appendFile( - `${dir}/${object.id}.md`, - `# ${object.id}\n\n*object*\n`, - ).then( - () => { - const l1 = object.xml().split(/\r?\n/)[0]; - const l = global.xml().split(/\r?\n/) - .reduce( - (acc, line, index) => { - if (line.indexOf(l1) > -1) { - return index; - } - return acc; - }, - -1, - ); - return external_fs_.promises.appendFile( - `${dir}/${object.id}.md`, - `\n[xml](${'../'.repeat(fileName.split('/').length - 1)}${global.file.replaceAll(' ', '%20')}#L${l + 1})\n`, - ).then(() => l + 1); - }, - ) - .then( - (l) => objects_parameters({ - fileName: `${dir}/${object.id}.md`, - object, - }).then( - () => references({ - fileName: `${dir}/${object.id}.md`, - object, - displays, - myDisplayFields, - }), - ) - .then( - () => animated({ - file: global.file, - line: l, - fileName: `${dir}/${object.id}.md`, - object, - }), - ), - ), - ), - ), - ); - - if (!objects.length) { + if (objects.length) { await external_fs_.promises.appendFile( fileName, - '*[none]*\n', + '\n## objects\n\n', + ); + + await sequence( + objects + .map( + (object) => () => external_fs_.promises.appendFile( + fileName, + `* [${object.id}](./${object.id}.md)\n`, + ).then( + () => external_fs_.promises.appendFile( + `${dir}/${object.id}.md`, + `# ${object.id}\n\n*object*\n`, + ).then( + () => { + const l1 = object.xml().split(/\r?\n/)[0]; + const l = global.xml().split(/\r?\n/) + .reduce( + (acc, line, index) => { + if (line.indexOf(l1) > -1) { + return index; + } + return acc; + }, + -1, + ); + return external_fs_.promises.appendFile( + `${dir}/${object.id}.md`, + `\n[xml](${'../'.repeat(fileName.split('/').length - 1)}${global.file.replaceAll(' ', '%20')}#L${l + 1})\n`, + ).then(() => l + 1); + }, + ) + .then( + (l) => objects_parameters({ + fileName: `${dir}/${object.id}.md`, + object, + }).then( + () => references({ + fileName: `${dir}/${object.id}.md`, + object, + displays, + myDisplayFields, + }), + ) + .then( + () => animated({ + file: global.file, + line: l, + fileName: `${dir}/${object.id}.md`, + object, + }), + ), + ), + ), + ), ); } });