New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.0 to 0.1.1

bower.json

7

index.js

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

var languages = require('./lang.json');
var languages = module.exports = require('./lang.json');
module.exports = function (extension) {
languages.lang = function (extension) {
extension = extension.replace(/\./, '');

@@ -25,3 +24,3 @@ for (var lang in languages) {

module.exports.ext = function (lang) {
languages.ext = function (lang) {
lang = lang.toLowerCase();

@@ -28,0 +27,0 @@ return languages[lang];

{
"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.0",
"version": "0.1.1",
"homepage": "https://github.com/jonschlinkert/lang-map",

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

@@ -10,16 +10,21 @@ /*!

var language = require('./');
var languages = require('./');
var assert = require('assert');
describe('lang-map', function () {
it('should return the full list of languages.', function () {
assert.equal(typeof languages, 'object');
});
it('should return the language matching the given extension.', function () {
assert.equal(language('js'), 'javascript');
assert.equal(language('.js'), 'javascript');
assert.equal(language('py'), 'python');
assert.equal(languages.lang('js'), 'javascript');
assert.equal(languages.lang('.js'), 'javascript');
assert.equal(languages.lang('py'), 'python');
});
it('should return the extensions matching the given language.', function () {
assert.deepEqual(language.ext('asciidoc'), ["asciidoc", "adoc", "asc"]);
assert.deepEqual(language.ext('python'), ["py", "gyp", "lmi", "pyde", "pyt", "pyw", "wsgi", "xpy"]);
assert.deepEqual(languages.ext('asciidoc'), ["asciidoc", "adoc", "asc"]);
assert.deepEqual(languages.ext('python'), ["py", "gyp", "lmi", "pyde", "pyt", "pyw", "wsgi", "xpy"]);
});
});
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