Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-videojs-languages

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-videojs-languages - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

test/lang/de.json

2

package.json
{
"name": "grunt-videojs-languages",
"description": "A grunt task to convert video.js language JSON files in to includable scripts.",
"version": "0.0.3",
"version": "0.0.4",
"homepage": "https://github.com/videojs/grunt-videojs-languages",

@@ -6,0 +6,0 @@ "author": {

'use strict';
var path = require('path');
var util = require('util');

@@ -8,11 +9,29 @@ module.exports = function(grunt) {

this.files.forEach(function(f) {
var languageName = path.basename(f.src, '.json');
var languageData = grunt.file.readJSON(f.src);
var createLanguageFile = function(languageName, languageData, jsFilePath) {
var jsTemplate = 'videojs.addLanguage("' + languageName + '",' + JSON.stringify(languageData,null,' ') + ');';
var jsFilePath = path.join(f.dest, languageName + '.js');
grunt.file.write(jsFilePath, jsTemplate);
grunt.log.writeln('- [' + languageName +'] Language Built. File "' + jsFilePath + '" created.');
};
this.files.forEach(function(f) {
var languageName, languageData, jsFilePath;
// Multiple Files Case
if(util.isArray(f.src)){
for(var i =0; i < f.src.length; i++) {
languageName = path.basename(f.src[i], '.json');
languageData = grunt.file.readJSON(f.src[i]);
jsFilePath = path.join(f.dest, languageName + '.js');
createLanguageFile(languageName, languageData, jsFilePath);
}
}
// Singular File Case
else {
languageName = path.basename(f.src, '.json');
languageData = grunt.file.readJSON(f.src);
jsFilePath = path.join(f.dest, languageName + '.js');
createLanguageFile(languageName, languageData, jsFilePath);
}
});
});
};
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc