utils-skywolf
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

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']

Package Sidebar

Install

npm i utils-skywolf

Weekly Downloads

1

Version

0.2.4

License

ISC

Unpacked Size

7.4 kB

Total Files

12

Last publish

Collaborators

  • lskywolfl