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

env-editor

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-editor - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

22

index.js

@@ -79,4 +79,6 @@ 'use strict';

const get = input => {
input = input.toLowerCase().trim();
const bin = input.split(path.sep).pop();
input = input.trim();
const needle = input.toLowerCase();
const id = needle.split(/[/\\]/).pop().replace(/\s/g, '-');
const bin = id.split('-')[0];

@@ -86,4 +88,4 @@ for (const editor of editors()) {

if (
input === editor.id ||
input === editor.name.toLowerCase() ||
needle === editor.id ||
needle === editor.name.toLowerCase() ||
bin === editor.bin

@@ -95,3 +97,3 @@ ) {

for (const p of editor.paths) {
if (path.normalize(input) === path.normalize(p)) {
if (path.normalize(needle) === path.normalize(p)) {
return editor;

@@ -102,3 +104,3 @@ }

for (const keyword of editor.keywords) {
if (input === keyword) {
if (needle === keyword) {
return editor;

@@ -110,6 +112,8 @@ }

return {
id: input,
id,
name: input,
bin: input,
paths: []
bin,
isTerminalEditor: false,
paths: [],
keywords: []
};

@@ -116,0 +120,0 @@ };

{
"name": "env-editor",
"version": "0.3.0",
"version": "0.3.1",
"description": "Get info about the default editor or a specific editor",

@@ -5,0 +5,0 @@ "license": "MIT",

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