New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

loaded-language-linter

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loaded-language-linter - npm Package Compare versions

Comparing version

to
0.0.4

30

dist/index.js

@@ -1,15 +0,7 @@

'use strict';
"use strict";
var _fs = require('fs');
var _fs = require("fs");
var _fs2 = _interopRequireDefault(_fs);
var _textract = require('textract');
var _textract2 = _interopRequireDefault(_textract);
var _validUrl = require('valid-url');
var _validUrl2 = _interopRequireDefault(_validUrl);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -21,18 +13,6 @@

var text = void 0;
var text = input;
var lowerCaseText = input.toLowerCase();
var matches = [];
if (_validUrl2.default.isUri(input)) {
_textract2.default.fromUrl(input, { preserveLineBreaks: true }, function (error, res) {
if (error) {
console.log(error);
}
text = res;
});
} else {
text = input;
}
var lcText = text.toLowerCase();
var _iteratorNormalCompletion = true;

@@ -46,3 +26,3 @@ var _didIteratorError = false;

if (lcText.indexOf(term) > -1) {
if (lowerCaseText.indexOf(term) > -1) {
matches.push(term);

@@ -49,0 +29,0 @@ }

7

package.json
{
"name": "loaded-language-linter",
"version": "0.0.3",
"version": "0.0.4",
"description": "A small Node.JS library to detect loaded language.",

@@ -28,6 +28,3 @@ "main": "./dist/index.js",

},
"dependencies": {
"textract": "^2.1.1",
"valid-url": "^1.0.9"
}
"dependencies": {}
}

@@ -1,4 +0,2 @@

import fs from 'fs';
import textract from 'textract';
import validUrl from 'valid-url';
import fs from 'fs'

@@ -9,18 +7,8 @@ module.exports = function (input) {

let text;
let text = input;
let lowerCaseText = input.toLowerCase();
let matches = [];
if (validUrl.isUri(input)) {
textract.fromUrl(input, {preserveLineBreaks: true}, function (error, res) {
if (error) { console.log(error) }
text = res;
})
} else {
text = input;
}
let lcText = text.toLowerCase();
for (const term of terms) {
if (lcText.indexOf(term) > -1) {
if (lowerCaseText.indexOf(term) > -1) {
matches.push(term);

@@ -27,0 +15,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet