Comparing version 0.0.2 to 0.0.3
@@ -632,21 +632,24 @@ module.exports = | ||
var _require = __webpack_require__(9), | ||
always = _require.always, | ||
anyPass = _require.anyPass, | ||
applySpec = _require.applySpec, | ||
prop = _require.prop, | ||
path = _require.path, | ||
always = _require.always, | ||
isNil = _require.isNil, | ||
both = _require.both, | ||
complement = _require.complement, | ||
isEmpty = _require.isEmpty, | ||
filter = _require.filter, | ||
pipe = _require.pipe, | ||
has = _require.has, | ||
ifElse = _require.ifElse, | ||
isEmpty = _require.isEmpty, | ||
isNil = _require.isNil, | ||
of = _require.of, | ||
path = _require.path, | ||
pathEq = _require.pathEq, | ||
__ = _require.__, | ||
of = _require.of, | ||
pipe = _require.pipe, | ||
prop = _require.prop, | ||
uniq = _require.uniq, | ||
anyPass = _require.anyPass; | ||
__ = _require.__; | ||
var hasRegisterInformation = has('register_information'); | ||
var isDefined = both(complement(isNil), complement(isEmpty)); | ||
var isDefinedRegisterInformation = pipe(prop('register_information'), isDefined); | ||
var isIndividual = pathEq(['register_information', 'type'], 'individual'); | ||
@@ -658,11 +661,11 @@ | ||
var legalName = ifElse(hasRegisterInformation, legalNameCompany, path(['BankAccount', 'legal_name'])); | ||
var legalName = ifElse(isDefinedRegisterInformation, legalNameCompany, path(['BankAccount', 'legal_name'])); | ||
var tradeName = ifElse(hasRegisterInformation, tradeNameCompany, path(['BankAccount', 'legal_name'])); | ||
var tradeName = ifElse(isDefinedRegisterInformation, tradeNameCompany, path(['BankAccount', 'legal_name'])); | ||
var documentTypeCode = ifElse(__, always(2), always(1)); | ||
var personCode = ifElse(hasRegisterInformation, documentTypeCode(isIndividual), documentTypeCode(pathEq(['BankAccount', 'document_type'], 'cpf'))); | ||
var personCode = ifElse(isDefinedRegisterInformation, documentTypeCode(isIndividual), documentTypeCode(pathEq(['BankAccount', 'document_type'], 'cpf'))); | ||
var taxId = ifElse(hasRegisterInformation, path(['register_information', 'document_number']), path(['BankAccount', 'document_number'])); | ||
var taxId = ifElse(isDefinedRegisterInformation, path(['register_information', 'document_number']), path(['BankAccount', 'document_number'])); | ||
@@ -669,0 +672,0 @@ var formatedBirthDate = function formatedBirthDate(register) { |
{ | ||
"name": "cadu", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A JavaScript library to interface with CADU", | ||
@@ -5,0 +5,0 @@ "main": "src/client.js", |
@@ -5,22 +5,31 @@ const moment = require('moment') | ||
const { | ||
always, | ||
anyPass, | ||
applySpec, | ||
prop, | ||
path, | ||
always, | ||
isNil, | ||
both, | ||
complement, | ||
isEmpty, | ||
filter, | ||
pipe, | ||
has, | ||
ifElse, | ||
isEmpty, | ||
isNil, | ||
of, | ||
path, | ||
pathEq, | ||
pipe, | ||
prop, | ||
uniq, | ||
__, | ||
of, | ||
uniq, | ||
anyPass, | ||
} = require('ramda') | ||
const hasRegisterInformation = has('register_information') | ||
const isDefined = both( | ||
complement(isNil), | ||
complement(isEmpty) | ||
) | ||
const isDefinedRegisterInformation = pipe( | ||
prop('register_information'), | ||
isDefined | ||
) | ||
const isIndividual = pathEq(['register_information', 'type'], 'individual') | ||
@@ -41,3 +50,3 @@ | ||
const legalName = ifElse( | ||
hasRegisterInformation, | ||
isDefinedRegisterInformation, | ||
legalNameCompany, | ||
@@ -48,3 +57,3 @@ path(['BankAccount', 'legal_name']) | ||
const tradeName = ifElse( | ||
hasRegisterInformation, | ||
isDefinedRegisterInformation, | ||
tradeNameCompany, | ||
@@ -57,3 +66,3 @@ path(['BankAccount', 'legal_name']) | ||
const personCode = ifElse( | ||
hasRegisterInformation, | ||
isDefinedRegisterInformation, | ||
documentTypeCode(isIndividual), | ||
@@ -64,3 +73,3 @@ documentTypeCode(pathEq(['BankAccount', 'document_type'], 'cpf')) | ||
const taxId = ifElse( | ||
hasRegisterInformation, | ||
isDefinedRegisterInformation, | ||
path(['register_information', 'document_number']), | ||
@@ -67,0 +76,0 @@ path(['BankAccount', 'document_number']) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
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
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
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
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
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
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3852654
44860
0