@@ -540,7 +540,7 @@ function cleanup (outputPath, outputRoot) {
540540 * @param {String } inputPath Path to location of source files
541541 * @returns {object } docinfo
542542 * Object whose keys are function names, and whose values are objects with
543- * keys name, category, fullpath, relativepath , doc, and issues
543+ * keys name, category, fullPath , doc, and issues
544544 * giving the relevant information
545545 */
546546function collectDocs ( functionNames , inputPath ) {
@@ -560,17 +560,18 @@ function collectDocs (functionNames, inputPath) {
560560 if ( path . indexOf ( 'docs' ) === - 1 && functionIndex !== - 1 ) {
561561 if ( path . indexOf ( 'expression' ) !== - 1 ) {
562562 category = 'expression'
563- } else if ( / ^ .\/ l i b \/ t y p e \/ [ a - z A - Z 0 - 9 _ ] * \/ f u n c t i o n / . test ( fullPath ) ) {
563+ } else if ( / \/ l i b \/ c j s \/ t y p e \/ [ a - z A - Z 0 - 9 _ ] * \/ f u n c t i o n / . test ( fullPath ) ) {
564+ // for type/bignumber/function/bignumber.js, type/fraction/function/fraction.js, etc
564565 category = 'construction'
565- } else if ( / ^ . \/ l i b \/ c o r e \/ f u n c t i o n / . test ( fullPath ) ) {
566+ } else if ( / \/ l i b \/ c j s \/ c o r e \/ f u n c t i o n / . test ( fullPath ) ) {
566567 category = 'core'
567568 } else {
568569 category = path [ functionIndex + 1 ]
569570 }
570- } else if ( fullPath === '. /lib/cjs/expression/parse.js') {
571+ } else if ( fullPath . endsWith ( ' /lib/cjs/expression/parse.js') ) {
571572 // TODO: this is an ugly special case
572573 category = 'expression'
573- } else if ( path . join ( '/' ) === '. /lib/cjs/type') {
574+ } else if ( path . join ( '/' ) . endsWith ( ' /lib/cjs/type') ) {
574575 // for boolean.js, number.js, string.js
575576 category = 'construction'
576577 }
@@ -581,11 +582,14 @@ function collectDocs (functionNames, inputPath) {
581582
582583 if ( category ) {
583584 functions [ name ] = {
584- name : name ,
585- category : category ,
586- fullPath : fullPath ,
587- relativePath : fullPath . substring ( inputPath . length )
585+ name,
586+ category,
587+ fullPath
588588 }
589+ } else {
590+ // TODO: throw a warning that no category could be found (instead of silently ignoring it).
591+ // Right now, this matches too many functions, so to do that, we first must make the glob matching relevant
592+ // files more specific, and we need to extend the list with functions we want to ignore.
589593 }
590594 } )
591595
0 commit comments