<commit_before>module Jekyll
  module Converters
    class Browserify < Converter
      safe true
      priority :low

      def initialize config
        super
        @browserify = nil

        system "npm install" if npm_install?
      end

      def matches ext
        exts.include? ext.downcase
      end

      def output_ext ext
        ".js"
      end

      def convert content
        setup unless @browserify
        @browserify.compile(content)
      end

      def setup
        require "browserify_rb"
        if use_nvm?
          @browserify = BrowserifyRb::Nvm::Browserify.new(
            required_modules: nvm_modules,
            browserify_opts: nvm_option,
            nvm_dir: File.join(ENV["PWD"], ".nvm"),
            node_ver: nvm_node_ver
          )
        else
          @browserify = BrowserifyRb::Browserify.new(
            command: command
          )
        end
      end

      def exts
        (config("browserify", "exts") || [".js"]).map(&:downcase)
      end

      def npm_install?
        b = config("browserify", "npm_install")
        (b == true) or (b.downcase == "true")
      end

      def command
        config("browserify", "command") || "browserify -"
      end
<commit_msg>Check the type on npm_install?<commit_after>module Jekyll
  module Converters
    class Browserify < Converter
      safe true
      priority :low

      def initialize config
        super
        @browserify = nil

        system "npm install" if npm_install?
      end

      def matches ext
        exts.include? ext.downcase
      end

      def output_ext ext
        ".js"
      end

      def convert content
        setup unless @browserify
        @browserify.compile(content)
      end

      def setup
        require "browserify_rb"
        if use_nvm?
          @browserify = BrowserifyRb::Nvm::Browserify.new(
            required_modules: nvm_modules,
            browserify_opts: nvm_option,
            nvm_dir: File.join(ENV["PWD"], ".nvm"),
            node_ver: nvm_node_ver
          )
        else
          @browserify = BrowserifyRb::Browserify.new(
            command: command
          )
        end
      end

      def exts
        (config("browserify", "exts") || [".js"]).map(&:downcase)
      end

      def npm_install?
        b = config("browserify", "npm_install")
        (b == true) or (b.is_a? String and b.downcase == "true")
      end

      def command
        config("browserify", "command") || "browserify -"
      end

{'fraction_non_alphanumeric': 0.09109149277688604, 'fraction_numerical': 0.0, 'mean_word_length': 1.706840390879479, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2997201', 'n_tokens_mistral': 753, 'n_tokens_neox': 715, 'n_words': 185}