0.2.4 • Published 2 years ago

utils-skywolf v0.2.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Common Utils

Hello!, i'm doing creating functionalities for use a day a day on work

Section Country

We have a many functionalities for use like that:

Get Countries Available for Use

import { getCountriesCodeAvailable } from 'utils-skywolf';

const contriesAvailable = getCountriesCodeAvailable();

// example response: ['CL', 'AR', etc]

Validate Country Code

import { isValidCountryCode } from 'utils-skywolf';

// 'countryCode' is valid in UpperCase and LowerCase 
const countryCode = 'cl';
const isValidCountry = isValidCountryCode(countryCode);
console.log(isValidCountry); // response: true

Validate Identificator By All Tax

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

Validate Identificator By Tax

import { isValidIdentificatorByTax } from 'utils-skywolf';

const params = {
    countryCode: 'cl',
    identificator: '21749812-0',
    taxIdentificator: 'rut'
};

const isValidIdentificator = isValidIdentificatorByTax(params);
console.log(isValidIdentificator); // response: true

Get Taxes By Country

import { getTaxesByCountryCode } from 'utils-skywolf';

const countryCode = 'cl';
const taxes = getTaxesByCountryCode(countryCode);
console.log(taxes); // response: ['run', 'rut']
0.2.4

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.3

2 years ago

0.1.1

2 years ago

0.0.1

2 years ago