Git Product home page Git Product logo

ovidijusparsiunas / condition-inverter Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 30.77 MB

Invert conditions for all modern programming languages and frameworks :twisted_rightwards_arrows:

Home Page: http://conditioninverter.com

License: MIT License

JavaScript 0.28% TypeScript 98.89% CSS 0.62% HTML 0.19% Vue 0.03%
condition conditional-statement conditions if if-else if-statement invert inverter reverser else-if

condition-inverter's Introduction

Banner

Description

A simple tool used to invert conditions for all modern programming languages and frameworks! It can be used to invert if statements, ternary operators, conditional assignments and much more - in both standard code files and html templates!

Platforms

Website - conditioninverter.com, Github

Website gif

VS Code Extension - Marketplace, Github

Extension gif

Theory

This tool takes an input condition, analyzes it and produces a new condition that yields an absolute opposite result. This is illustrated by the following example:

Properties Original condition Result Inverted condition Result
dog = true, cat = false dog && cat false !dog | | !cat true
dog = 3, cat = 2 dog < cat false dog >= cat true

Language Support

Condition Inverter supports all modern progrogramming languages and frameworks. This includes technologies that have been ranked as the most popular on the Stack Overflow Developer Survey.
Disclaimer - this tool does not currently support query, shell scripting or assembly based languages.

Contributions

Open source is built by the community for the community. All contributions to this project are welcome!
Additionally, if you have any suggestions for enhancements, ideas on how to take the project further or have discovered a bug, do not hesitate to create a new issue ticket and we will look into it as soon as possible!

condition-inverter's People

Contributors

ovidijusparsiunas avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

condition-inverter's Issues

Strange things happen when used with Clojure

Hi! Cool extension!

I tried this with Clojure, which is a LISP, and the edits produced non-compliant code. Here I is on a piece of code from a VS Code extension of mine:

(filter #(and (map? %)
              (:name %)) all-replacers)

Running Invert Text on this gives me:

(filter #(or !(map? %)
              (:name %)) all-replacers)

Which is not valid Clojure code.

I'm not really expecting this to work with Clojure, since it's not a very big language. Just letting you know. Maybe there is a way the command can figure out that the language is not supported and inform about that, rather than do funny stuff with the code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.