Comparing version 2.3.1 to 2.3.2
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var national = { | ||
@@ -2,0 +3,0 @@ '01/01': 'Confraternização Universal', |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.stringToState = exports.States = void 0; | ||
var States; | ||
(function (States) { | ||
States[States["ac"] = 0] = "ac"; | ||
States[States["am"] = 1] = "am"; | ||
States[States["al"] = 2] = "al"; | ||
States[States["ap"] = 3] = "ap"; | ||
States[States["ba"] = 4] = "ba"; | ||
States[States["ce"] = 5] = "ce"; | ||
States[States["df"] = 6] = "df"; | ||
States[States["es"] = 7] = "es"; | ||
States[States["go"] = 8] = "go"; | ||
States[States["ma"] = 9] = "ma"; | ||
States[States["mg"] = 10] = "mg"; | ||
States[States["ms"] = 11] = "ms"; | ||
States[States["mt"] = 12] = "mt"; | ||
States[States["pa"] = 13] = "pa"; | ||
States[States["pb"] = 14] = "pb"; | ||
States[States["pe"] = 15] = "pe"; | ||
States[States["pi"] = 16] = "pi"; | ||
States[States["pr"] = 17] = "pr"; | ||
States[States["rj"] = 18] = "rj"; | ||
States[States["rn"] = 19] = "rn"; | ||
States[States["ro"] = 20] = "ro"; | ||
States[States["rr"] = 21] = "rr"; | ||
States[States["rs"] = 22] = "rs"; | ||
States[States["sc"] = 23] = "sc"; | ||
States[States["se"] = 24] = "se"; | ||
States[States["sp"] = 25] = "sp"; | ||
States[States["to"] = 26] = "to"; | ||
})(States = exports.States || (exports.States = {})); | ||
function stringToState(state, model) { | ||
if (model === void 0) { model = States; } | ||
switch (state) { | ||
case 'ac': | ||
return model.ac; | ||
case 'am': | ||
return model.am; | ||
case 'al': | ||
return model.al; | ||
case 'ap': | ||
return model.ap; | ||
case 'ba': | ||
return model.ba; | ||
case 'ce': | ||
return model.ce; | ||
case 'df': | ||
return model.df; | ||
case 'es': | ||
return model.es; | ||
case 'go': | ||
return model.go; | ||
case 'ma': | ||
return model.ma; | ||
case 'mg': | ||
return model.mg; | ||
case 'ms': | ||
return model.ms; | ||
case 'mt': | ||
return model.mt; | ||
case 'pa': | ||
return model.pa; | ||
case 'pb': | ||
return model.pb; | ||
case 'pe': | ||
return model.pe; | ||
case 'pi': | ||
return model.pi; | ||
case 'pr': | ||
return model.pr; | ||
case 'rj': | ||
return model.rj; | ||
case 'rn': | ||
return model.rn; | ||
case 'ro': | ||
return model.ro; | ||
case 'rr': | ||
return model.rr; | ||
case 'rs': | ||
return model.rs; | ||
case 'sc': | ||
return model.sc; | ||
case 'se': | ||
return model.se; | ||
case 'sp': | ||
return model.sp; | ||
case 'to': | ||
return model.to; | ||
} | ||
} | ||
exports.stringToState = stringToState; | ||
//# sourceMappingURL=interfaces.js.map |
@@ -8,2 +8,3 @@ import * as utils from './src/utils'; | ||
import { ESTADOS } from './src/estados'; | ||
import { BigObject } from 'interfaces'; | ||
@@ -17,3 +18,3 @@ export const utilsBr = { | ||
export const maskBr = mask.maskBr; | ||
export const fakerBr = faker; | ||
export const maskBr: BigObject<Function> = mask.maskBr; | ||
export const fakerBr: BigObject<Function> = faker; |
{ | ||
"name": "js-brasil", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "Javascript Utils para Brasil (cpf, cnpj...)", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import { allNumbersAreSame } from './utils'; | ||
import { BigObject } from 'interfaces'; | ||
import { BigObject } from './interfaces'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -12,93 +12,2 @@ | ||
} | ||
export enum States { | ||
ac, am, al, ap, ba, ce, df, es, go, ma, mg, ms, mt, pa, pb, pe, pi, pr, rj, rn, ro, rr, | ||
rs, sc, se, sp, to | ||
} | ||
export function stringToState (state: string, model = States){ | ||
switch (state) { | ||
case 'ac': | ||
return model.ac; | ||
case 'am': | ||
return model.am; | ||
case 'al': | ||
return model.al; | ||
case 'ap': | ||
return model.ap; | ||
case 'ba': | ||
return model.ba; | ||
case 'ce': | ||
return model.ce; | ||
case 'df': | ||
return model.df; | ||
case 'es': | ||
return model.es; | ||
case 'go': | ||
return model.go; | ||
case 'ma': | ||
return model.ma; | ||
case 'mg': | ||
return model.mg; | ||
case 'ms': | ||
return model.ms; | ||
case 'mt': | ||
return model.mt; | ||
case 'pa': | ||
return model.pa; | ||
case 'pb': | ||
return model.pb; | ||
case 'pe': | ||
return model.pe; | ||
case 'pi': | ||
return model.pi; | ||
case 'pr': | ||
return model.pr; | ||
case 'rj': | ||
return model.rj; | ||
case 'rn': | ||
return model.rn; | ||
case 'ro': | ||
return model.ro; | ||
case 'rr': | ||
return model.rr; | ||
case 'rs': | ||
return model.rs; | ||
case 'sc': | ||
return model.sc; | ||
case 'se': | ||
return model.se; | ||
case 'sp': | ||
return model.sp; | ||
case 'to': | ||
return model.to; | ||
} | ||
} | ||
export interface Masks { | ||
@@ -105,0 +14,0 @@ aih: MaskType, |
@@ -557,3 +557,3 @@ import { getAllDigits, fillString, getAllWords } from "./utils"; | ||
export const validateBr = { | ||
export const validateBr: BigObject<Function> = { | ||
aih: validate_aih, | ||
@@ -560,0 +560,0 @@ cartaocredito: validate_cartaocredito, |
@@ -29,2 +29,2 @@ import { utilsBr } from '../index'; | ||
}) | ||
}); | ||
}); |
@@ -8,3 +8,3 @@ { | ||
"declaration": false, | ||
"strict": false, | ||
"strict": true, | ||
"moduleResolution": "node", | ||
@@ -28,5 +28,4 @@ "emitDecoratorMetadata": true, | ||
"exclude": [ | ||
".ng_build", | ||
"test" | ||
".ng_build" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2154787
37461