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

babel-plugin-caralho

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-caralho - npm Package Compare versions

Comparing version 0.0.0 to 0.1.0

23

lib/index.js

@@ -1,8 +0,6 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var words = require('curse-words-common');
exports.default = function (_ref) {
module.exports = function (_ref) {
var t = _ref.types;

@@ -14,11 +12,16 @@

words.map(function (word) {
if (path.node.value.raw.includes('!' + word)) {
path.node.value.raw = path.node.value.raw.replace('!' + word, '!important');
if (path.node.value.raw.includes("!" + word)) {
path.node.value.raw = path.node.value.raw.replace("!" + word, "!important");
}
});
},
StringLiteral: function StringLiteral(path) {
words.map(function (word) {
if (path.node.value.includes("!" + word)) {
path.node.value = path.node.value.replace("!" + word, "!important");
}
});
}
}
};
};
var words = require('curse-words-common');
};
{
"version": "0.0.0",
"version": "0.1.0",
"description": "Babel plugin for writing curse words instead of important because reasons",

@@ -4,0 +4,0 @@ "repository": "https://github.com/SaraVieira/babel-caralho",

@@ -1,5 +0,3 @@

Read babel plugin handbook -> https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md
THIS IS NOT WORKING AND IDK WHY
Try http://astexplorer.net/#/Pcw9baefXI for a visual understanding.
# babel-plugin-boilerplate

@@ -6,0 +4,0 @@

const words = require('curse-words-common');
export default function({ types: t }) {
module.exports = function({ types: t }) {
return {
visitor: {
TemplateElement(path) {
TemplateElement(path) {
words.map(word => {
if (path.node.value.raw.includes(`!${word}`)) {
path.node.value.raw = path.node.value.raw.replace(
`!${word}`,
'!important'
);
path.node.value.raw = path.node.value.raw.replace(`!${word}`, "!important");
}
});
},
StringLiteral(path) {
words.map(word => {
if (path.node.value.includes(`!${word}`)) {
path.node.value = path.node.value.replace(`!${word}`, "!important");
}
});
}

@@ -16,0 +20,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