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

busca-br

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

busca-br - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

39

buscaBR.js

@@ -5,21 +5,3 @@ function buscaBR(){

buscaBR.prototype.codes = [ [/BL|BR/, 'B'],
['PH', 'F'],
[/GL|GR|MG|NG|RG/, 'G'],
['Y', 'I'],
[/GE|GI|RJ|MJ/, 'J'],
[/CA|CO|CU|CK|Q/, 'K'],
['N', 'M'],
[/AO|AUM|GM|MD|OM|ON/, 'M'],
['PR', 'P'],
['L', 'R'],
[/CE|CI|CH|CS|RS|TS|X|Z/, 'S'],
[/TR|TL/, 'T'],
[/CT|RT|ST|PT/, 'T'],
[/\b[UW]/, 'V'],
['RM', 'SM'],
[/[MRS]+\b/, ''],
[/[AEIOUH]/, ''] ];
buscaBR.prototype.searchSync = function(str, array){

@@ -42,5 +24,22 @@ var results = [];

str = removeAcento(str.toUpperCase());
for(var i = 0; i < this.codes.length; i++){
var codes = [ [/BL|BR/, 'B'],
['PH', 'F'],
[/GL|GR|MG|NG|RG/, 'G'],
['Y', 'I'],
[/GE|GI|RJ|MJ/, 'J'],
[/CA|CO|CU|CK|Q/, 'K'],
['N', 'M'],
[/AO|AUM|GM|MD|OM|ON/, 'M'],
['PR', 'P'],
['L', 'R'],
[/CE|CI|CH|CS|RS|TS|X|Z/, 'S'],
[/TR|TL/, 'T'],
[/CT|RT|ST|PT/, 'T'],
[/\b[UW]/, 'V'],
['RM', 'SM'],
[/[MRS]+\b/, ''],
[/[AEIOUH]/, ''] ];
for(var i = 0; i < codes.length; i++){
// str = str.replace(this.codes[i][0],this.codes[i][1]);
str = str.split(this.codes[i][0]).join(this.codes[i][1])
str = str.split(codes[i][0]).join(codes[i][1])
}

@@ -47,0 +46,0 @@

@@ -19,3 +19,3 @@ {

],
"version": "0.1.2",
"version": "0.1.3",
"author": {

@@ -22,0 +22,0 @@ "name": "Jayr Alencar",

@@ -53,6 +53,13 @@ # buscaBR.js

```js
var buscabr = new buscaBR();
console.log(console.log(buscaBR.encode('paralelepipedo')));
var buscabr = require('busca-br').encode();
console.log(buscabr('paralalepipedo'));
//Vai retornar
```
Ou no browser..
```js
var buscabr = new buscaBR();
alert(buscabr.encode('paralalepipedo'))
```
## Exemplos de respostas

@@ -77,2 +84,1 @@ <table>

</table>
```
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