Hello!, i'm doing creating functionalities for use a day a day on work
We have a many functionalities for use like that:
import { getCountriesCodeAvailable } from 'utils-skywolf';
const contriesAvailable = getCountriesCodeAvailable();
// example response: ['CL', 'AR', etc]
import { isValidCountryCode } from 'utils-skywolf';
// 'countryCode' is valid in UpperCase and LowerCase
const countryCode = 'cl';
const isValidCountry = isValidCountryCode(countryCode);
console.log(isValidCountry); // response: true
import { isValidIdentificatorByAllTax } from 'utils-skywolf';
// 'identificator' also can be '21749812-0' or '217498120' in this case
const identificator = '21749812-0';
const countryCode = 'cl';
const isValidIdentificator = isValidIdentificatorByAllTax(countryCode, identificator);
console.log(isValidIdentificator); // response: true
import { isValidIdentificatorByTax } from 'utils-skywolf';
const params = {
countryCode: 'cl',
identificator: '21749812-0',
taxIdentificator: 'rut'
};
const isValidIdentificator = isValidIdentificatorByTax(params);
console.log(isValidIdentificator); // response: true
import { getTaxesByCountryCode } from 'utils-skywolf';
const countryCode = 'cl';
const taxes = getTaxesByCountryCode(countryCode);
console.log(taxes); // response: ['run', 'rut']