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

lang-map

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lang-map - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

3

build.js

@@ -14,6 +14,7 @@ /*!

var obj = {};
for (var lang in languages) {
var key = lang.toLowerCase();
obj[key] = languages[lang].extensions.map(function (ext) {
return ext.replace(/\./, '');
return ext.slice(1);
});

@@ -20,0 +21,0 @@ }

@@ -11,17 +11,37 @@ /*!

var languages = module.exports = require('./lang.json');
var keys = Object.keys(languages);
languages.lang = function (extension) {
extension = extension.replace(/\./, '');
for (var lang in languages) {
var ext = languages[lang];
if (ext.indexOf(extension) !== -1) {
return lang;
function language(ext) {
if (ext[0] === '.') {
ext = ext.slice(1);
}
var len = keys.length;
var i = 0;
if (languages.hasOwnProperty(ext)) {
return ext;
}
while (i < len) {
var key = keys[i++];
var langs = languages[key];
if (key === ext) {
return key;
}
return extension;
if (langs.indexOf(ext) !== -1) {
return key;
}
}
};
}
languages.ext = function (lang) {
function extension(lang) {
lang = lang.toLowerCase();
return languages[lang] || lang;
};
}
languages.lang = language;
languages.ext = extension;

@@ -112,2 +112,3 @@ {

"cats",
"h",
"w"

@@ -127,2 +128,3 @@ ],

"H",
"h",
"h++",

@@ -134,3 +136,4 @@ "hh",

"tcc",
"tpp"
"tpp",
"ipp"
],

@@ -148,3 +151,3 @@ "c-objdump": [

"cmake",
"cmake.in"
"in"
],

@@ -164,2 +167,5 @@ "cobol": [

],
"chapel": [
"chpl"
],
"chuck": [

@@ -183,3 +189,3 @@ "ck"

"hic",
"cljs.hl"
"hl"
],

@@ -193,3 +199,5 @@ "coffeescript": [

"coldfusion": [
"cfm",
"cfm"
],
"coldfusion cfc": [
"cfc"

@@ -205,4 +213,9 @@ ],

],
"component pascal": [
"cp",
"cps"
],
"coq": [
"coq"
"coq",
"v"
],

@@ -227,2 +240,5 @@ "cpp-objdump": [

],
"cycript": [
"cy"
],
"cython": [

@@ -254,8 +270,5 @@ "pyx",

],
"dcpu-16 asm": [
"dasm16",
"dasm"
],
"diff": [
"diff"
"diff",
"patch"
],

@@ -300,2 +313,3 @@ "dogescript": [

"erl",
"escript",
"hrl"

@@ -342,3 +356,4 @@ ],

"fth",
"4th"
"4th",
"forth"
],

@@ -351,2 +366,5 @@ "frege": [

],
"gams": [
"gms"
],
"gap": [

@@ -366,2 +384,3 @@ "g",

"frag",
"frg",
"fshader",

@@ -373,2 +392,3 @@ "geom",

"vert",
"vrx",
"vshader"

@@ -403,4 +423,10 @@ ],

"gosu": [
"gs"
"gs",
"gst",
"gsx",
"vark"
],
"grace": [
"grace"
],
"grammatical framework": [

@@ -420,3 +446,7 @@ "gf"

"groovy": [
"groovy"
"groovy",
"gradle",
"grt",
"gtpl",
"gvy"
],

@@ -429,3 +459,2 @@ "groovy server pages": [

"htm",
"html.hl",
"st",

@@ -440,5 +469,3 @@ "xhtml"

"erb",
"erb.deface",
"html.erb",
"html.erb.deface"
"deface"
],

@@ -453,10 +480,7 @@ "html+php": [

"haml",
"haml.deface",
"html.haml.deface"
"deface"
],
"handlebars": [
"handlebars",
"hbs",
"html.handlebars",
"html.hbs"
"hbs"
],

@@ -478,3 +502,4 @@ "harbour": [

"idl": [
"pro"
"pro",
"dlm"
],

@@ -507,2 +532,5 @@ "ini": [

],
"isabelle": [
"thy"
],
"j": [

@@ -513,2 +541,3 @@ "ijs"

"json",
"lock",
"sublime-keymap",

@@ -545,2 +574,3 @@ "sublime-mousemap",

"es6",
"frag",
"jake",

@@ -554,3 +584,5 @@ "jsfl",

"sjs",
"ssjs"
"ssjs",
"xsjs",
"xsjslib"
],

@@ -577,4 +609,10 @@ "julia": [

],
"labview": [
"lvproj"
],
"lasso": [
"lasso"
"lasso",
"las",
"lasso9",
"ldml"
],

@@ -614,5 +652,9 @@ "latte": [

],
"lookml": [
"lookml"
],
"lua": [
"lua",
"nse",
"pd_lua",
"rbxs"

@@ -639,2 +681,3 @@ ],

"mkd",
"mkdn",
"mkdown",

@@ -647,3 +690,5 @@ "ron"

"mathematica": [
"mathematica"
"mathematica",
"m",
"nb"
],

@@ -690,3 +735,4 @@ "matlab": [

"nsis": [
"nsi"
"nsi",
"nsh"
],

@@ -706,2 +752,8 @@ "nemerle": [

],
"nit": [
"nit"
],
"nix": [
"nix"
],
"nu": [

@@ -717,2 +769,3 @@ "nu"

"ml",
"eliom",
"eliomi",

@@ -728,3 +781,4 @@ "ml4",

"objective-c": [
"m"
"m",
"h"
],

@@ -749,7 +803,16 @@ "objective-c++": [

"openedge abl": [
"p"
"p",
"cls"
],
"openscad": [
"scad"
],
"org": [
"org"
],
"ox": [
"ox",
"oxh",
"oxo"
],
"oxygene": [

@@ -765,2 +828,3 @@ "oxygene"

"ctp",
"module",
"php3",

@@ -771,2 +835,5 @@ "php4",

],
"pan": [
"pan"
],
"parrot": [

@@ -784,2 +851,3 @@ "parrot"

"dfm",
"dpr",
"lpr"

@@ -790,2 +858,4 @@ ],

"PL",
"cgi",
"fcgi",
"perl",

@@ -796,3 +866,4 @@ "ph",

"pod",
"psgi"
"psgi",
"t"
],

@@ -856,2 +927,3 @@ "perl6": [

"pyde",
"pyp",
"pyt",

@@ -868,5 +940,11 @@ "pyw",

],
"qmake": [
"pro",
"pri"
],
"r": [
"r",
"R",
"Rd",
"rd",
"rsx"

@@ -895,3 +973,4 @@ ],

"rktd",
"rktl"
"rktl",
"scrbl"
],

@@ -931,3 +1010,6 @@ "ragel in ruby host": [

"mspec",
"pluginspec",
"podspec",
"rabl",
"rake",
"rbuild",

@@ -943,5 +1025,12 @@ "rbw",

],
"sas": [
"sas"
],
"scss": [
"scss"
],
"sqf": [
"sqf",
"hqf"
],
"sql": [

@@ -954,2 +1043,5 @@ "sql",

],
"ston": [
"ston"
],
"sage": [

@@ -959,6 +1051,8 @@ "sage"

"sass": [
"sass"
"sass",
"scss"
],
"scala": [
"scala",
"sbt",
"sc"

@@ -973,6 +1067,9 @@ ],

"sls",
"sps",
"ss"
],
"scilab": [
"sci"
"sci",
"sce",
"tst"
],

@@ -984,4 +1081,6 @@ "self": [

"sh",
"bash",
"bats",
"tmux"
"tmux",
"zsh"
],

@@ -997,2 +1096,5 @@ "shellsession": [

],
"slim": [
"slim"
],
"smalltalk": [

@@ -1011,4 +1113,6 @@ "st"

"standard ml": [
"sml",
"fun"
"ML",
"fun",
"sig",
"sml"
],

@@ -1030,2 +1134,5 @@ "stata": [

],
"swift": [
"swift"
],
"systemverilog": [

@@ -1054,6 +1161,9 @@ "sv",

"aux",
"bbx",
"bib",
"cbx",
"cls",
"dtx",
"ins",
"lbx",
"ltx",

@@ -1088,2 +1198,5 @@ "mkii",

],
"vcl": [
"vcl"
],
"vhdl": [

@@ -1113,2 +1226,3 @@ "vhdl",

"bas",
"cls",
"frm",

@@ -1128,2 +1242,3 @@ "frx",

"xml",
"ant",
"axml",

@@ -1133,7 +1248,12 @@ "ccxml",

"cproject",
"csproj",
"ct",
"dita",
"ditamap",
"ditaval",
"filters",
"fsproj",
"glade",
"grxml",
"ivy",
"jelly",

@@ -1143,2 +1263,4 @@ "kml",

"mxml",
"nproj",
"nuspec",
"osm",

@@ -1155,2 +1277,3 @@ "plist",

"svg",
"targets",
"tmCommand",

@@ -1164,2 +1287,4 @@ "tmLanguage",

"urdf",
"vbproj",
"vcxproj",
"vxml",

@@ -1198,2 +1323,10 @@ "wsdl",

],
"xojo": [
"xojo_code",
"xojo_menu",
"xojo_report",
"xojo_script",
"xojo_toolbar",
"xojo_window"
],
"xtend": [

@@ -1211,2 +1344,7 @@ "xtend"

],
"zimpl": [
"zimpl",
"zmpl",
"zpl"
],
"ec": [

@@ -1213,0 +1351,0 @@ "ec",

{
"name": "lang-map",
"description": "Get the language associated with a file extension or the extensions associated with a language using the data from GitHub's [Linguist YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)",
"version": "0.1.3",
"version": "0.2.0",
"homepage": "https://github.com/jonschlinkert/lang-map",

@@ -17,8 +17,16 @@ "author": {

},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/jonschlinkert/lang-map/blob/master/LICENSE-MIT"
}
],
"license": {
"type": "MIT",
"url": "https://github.com/jonschlinkert/lang-map/blob/master/LICENSE-MIT"
},
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha -R spec"
},
"devDependencies": {
"mocha": "*"
},
"keywords": [

@@ -41,15 +49,5 @@ "classify",

],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha -R spec"
},
"devDependencies": {
"language-map": "0.0.2",
"mocha": "*",
"verb": ">= 0.2.6",
"verb-tag-jscomments": ">= 0.1.4"
"dependencies": {
"language-map": "^1.0.0"
}
}
}

@@ -20,5 +20,6 @@ /*!

it('should return the language matching the given extension.', function () {
assert.equal(languages.lang('py'), 'python');
assert.equal(languages.lang('js'), 'javascript');
assert.equal(languages.lang('hbs'), 'handlebars');
assert.equal(languages.lang('.js'), 'javascript');
assert.equal(languages.lang('py'), 'python');
});

@@ -25,0 +26,0 @@

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