<commit_before>#
# Wrap .js into .bat
# http://www.dostips.com/forum/viewtopic.php?p=37780#p37780
#
fs = require "fs"
iconv = require "iconv-lite"
ini = require '../package'

module.exports =
me = (options)->

me::apply = (compiler)->
  compiler.plugin "done", (compilation)->
    for k, z of compilation.compilation.assets
      dst = z.existsAt
      continue unless /[.]js$/.test dst
      fs.unlink dst
      dst = dst.replace /[.].*?$/, '.bat'
      fs.writeFile dst, toANSI """
0</*! ::
@echo off
REM See #{ini.homepage}
cscript //nologo //e:javascript "%~f0" %*
goto :EOF */0;
#{do z.source}

      """
    return

toANSI = (s)->
  iconv.encode s, 'cp1251'<commit_msg>Move URL to first line<commit_after>#
# Wrap .js into .bat
# http://www.dostips.com/forum/viewtopic.php?p=37780#p37780
#
fs = require "fs"
iconv = require "iconv-lite"
ini = require '../package'

module.exports =
me = (options)->

me::apply = (compiler)->
  compiler.plugin "done", (compilation)->
    for k, z of compilation.compilation.assets
      dst = z.existsAt
      continue unless /[.]js$/.test dst
      fs.unlink dst
      dst = dst.replace /[.].*?$/, '.bat'
      fs.writeFile dst, toANSI """
0</*! :: See #{ini.homepage}
@echo off
cscript //nologo //e:javascript "%~f0" %*
goto :EOF */0;
#{do z.source}

      """
    return

toANSI = (s)->
  iconv.encode s, 'cp1251'
{'fraction_non_alphanumeric': 0.1918819188191882, 'fraction_numerical': 0.025092250922509225, 'mean_word_length': 2.852272727272727, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6473340', 'n_tokens_mistral': 534, 'n_tokens_neox': 512, 'n_words': 128}