Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/** @module lib/template */
const _ = require('lodash');
const beautify = require('js-beautify').html;
const config = require('./config');
const deepExtend = require('deep-extend');
const handlebars = require('handlebars');
const handlebarsLayouts = require('handlebars-layouts');
const loader = require('./loader');
const { lsSync } = require('@jsdoc/core').fs;
const MessageFormat = require('messageformat');
const logger = require('jsdoc/util/logger');
const path = require('path');
const { readFileSync } = require('fs');
const yaml = require('js-yaml');
// Maximum file size that we'll try to beautify.
const MAX_BEAUTIFY_SIZE = 1024 * 128;
function loadYaml(filepath) {
let parsedObject;
try {
if (filepath) {
parsedObject = yaml.load(readFileSync(filepath, 'utf8'));
}
/**
* @module jsdoc/src/scanner
*/
const { EventEmitter } = require('events');
const logger = require('jsdoc/util/logger');
const { lsSync } = require('@jsdoc/core').fs;
const path = require('path');
const { statSync } = require('fs');
/**
* @extends module:events.EventEmitter
*/
class Scanner extends EventEmitter {
constructor() {
super();
}
/**
* Recursively searches the given searchPaths for js files.
* @param {Array.} searchPaths
* @param {number} [depth]
* @fires sourceFileFound