<commit_before>'use strict';

var through = require('through2');
var clone = require('lodash').clone;
var defaults = require('lodash').defaults;
var path = require('path');
var PluginError = require('gulp-util').PluginError;

var tmpl = require('./template').amd;

function compile(contents, opts){
  opts.name = null;
  if(typeof opts.moduleRoot === 'string'){
    opts.name = path.relative(opts.moduleRoot, opts.file.path).slice(0, -path.extname(opts.file.path).length);
    if(opts.modulePrefix) {
      var prefix = opts.modulePrefix.indexOf('/') > -1 ? opts.modulePrefix : opts.modulePrefix + '/';
      opts.name = prefix + opts.name;
    }<commit_msg>platform agnostic for file path definition, to fix gulp-wrap-amd/issues/11<commit_after>'use strict';

var through = require('through2');
var clone = require('lodash').clone;
var defaults = require('lodash').defaults;
var path = require('path');
var PluginError = require('gulp-util').PluginError;

var tmpl = require('./template').amd;

function compile(contents, opts){
  opts.name = null;
  if(typeof opts.moduleRoot === 'string'){
    opts.name = path.relative(opts.moduleRoot, opts.file.path).slice(0, -path.extname(opts.file.path).length);
    // platform agnostic for file path definition
    opts.name = opts.name.split(path.sep).join('/');

    if(opts.modulePrefix) {
      var prefix = opts.modulePrefix.indexOf('/') > -1 ? opts.modulePrefix : opts.modulePrefix + '/';
      opts.name = prefix + opts.name;
    }
{'fraction_non_alphanumeric': 0.16948008102633355, 'fraction_numerical': 0.0054017555705604325, 'mean_word_length': 4.25531914893617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6448058', 'n_tokens_mistral': 463, 'n_tokens_neox': 453, 'n_words': 100}