@intelligo.ai/object-to-schema
Advanced tools
Comparing version 2.2.6 to 2.2.7
@@ -10,2 +10,224 @@ "use strict"; | ||
Object.defineProperty(exports, "extractExampleFromSchema", { enumerable: true, get: function () { return exampleRecordExtractor_1.extractExampleFromSchema; } }); | ||
var aa = { | ||
"companyName": "MISHRA GROUP VENTURE CAPITAL ADVISORS, corp., THE", | ||
"evictionId": 1836030810467466240.0, | ||
"bridge": null, | ||
"defendantNames": [ | ||
{ | ||
"isBusiness": false, | ||
"tahoeId": "G-575692654799887454", | ||
"ssn": "099-66-2500", | ||
"prefix": "", | ||
"firstName": "MATTHEW", | ||
"middleName": "", | ||
"lastName": "ROSENBLUM", | ||
"suffix": "", | ||
"gender": "M", | ||
"nameHash": 5682392457680976900.0, | ||
"addressHashOpt9": 3396533295236144100.0, | ||
"fullName": "MATTHEW ROSENBLUM", | ||
"address": { | ||
"addressType": "Defendant Address", | ||
"addressHashOpt9": 3396533295236144100.0, | ||
"houseNumber": "36", | ||
"streetDirection": "E", | ||
"streetName": "64th", | ||
"streetType": "ST", | ||
"streetPostDirection": "", | ||
"unitType": "", | ||
"unitNumber": "", | ||
"city": "New York", | ||
"county": "", | ||
"state": "NY", | ||
"zipCode": "10065", | ||
"zip4": "7371", | ||
"longitude": "", | ||
"latitude": "", | ||
"fipsCode": "", | ||
"verificationCodes": [ | ||
"AC01", | ||
"AE09", | ||
"AS02" | ||
], | ||
"fullAddress": "36 E 64th ST; New York, NY 10065-7371" | ||
}, | ||
"partyType": "Defendant" | ||
}, | ||
{ | ||
"isBusiness": false, | ||
"tahoeId": "G-575692654799887454", | ||
"ssn": "099-66-2500", | ||
"prefix": "", | ||
"firstName": "MATTHEW", | ||
"middleName": "", | ||
"lastName": "ROSENBLUM", | ||
"suffix": "", | ||
"gender": "M3", | ||
"nameHash": 5682392457680976900.0, | ||
"addressHashOpt9": 3396533295236144100.0, | ||
"fullName": "MATTHEW ROSENBLUM3", | ||
"address": { | ||
"addressType": "Defendant Address", | ||
"addressHashOpt9": 3396533295236144100.0, | ||
"houseNumber": "36", | ||
"streetDirection": "E", | ||
"streetName": "64th", | ||
"streetType": "ST", | ||
"streetPostDirection": "", | ||
"unitType": "", | ||
"unitNumber": "", | ||
"city": "New York", | ||
"county": "", | ||
"state": "NY", | ||
"zipCode": "10065", | ||
"zip4": "7371", | ||
"longitude": "", | ||
"latitude": "", | ||
"fipsCode": "", | ||
"verificationCodes": [ | ||
"AC01", | ||
"AE09", | ||
"AS02" | ||
], | ||
"fullAddress": "36 E 64th ST; New York, NY 10065-7371" | ||
}, | ||
"partyType": "Defendant" | ||
} | ||
], | ||
"plaintiffNames": [ | ||
{ | ||
"isOwner": true, | ||
"tahoeId": null, | ||
"ssn": null, | ||
"prefix": "", | ||
"firstName": "", | ||
"middleName": "", | ||
"lastName": "OKADA DENKI SAN LTD", | ||
"suffix": "", | ||
"gender": "N", | ||
"nameHash": 1020963256723863680.0, | ||
"fullName": "OKADA DENKI SAN LTD", | ||
"partyType": "Defendant" | ||
} | ||
], | ||
"addresses": [ | ||
{ | ||
"addressType": "Court Address", | ||
"addressHashOpt9": -5893356457424657400.0, | ||
"houseNumber": "111", | ||
"streetDirection": "", | ||
"streetName": "Centre", | ||
"streetType": "ST", | ||
"streetPostDirection": "", | ||
"unitType": "Rm", | ||
"unitNumber": "118", | ||
"city": "New York", | ||
"county": "New York", | ||
"state": "NY", | ||
"zipCode": "10013", | ||
"zip4": "4390", | ||
"longitude": "", | ||
"latitude": "", | ||
"fipsCode": "", | ||
"verificationCodes": [ | ||
"AC03", | ||
"AE08", | ||
"AS02" | ||
], | ||
"fullAddress": "111 Centre ST, Rm 118; New York, NY 10013-4390" | ||
}, | ||
{ | ||
"addressType": "Defendant Address", | ||
"addressHashOpt9": 3396533295236144100.0, | ||
"houseNumber": "36", | ||
"streetDirection": "E", | ||
"streetName": "64th", | ||
"streetType": "ST", | ||
"streetPostDirection": "", | ||
"unitType": "", | ||
"unitNumber": "", | ||
"city": "New York", | ||
"county": "", | ||
"state": "NY", | ||
"zipCode": "10065", | ||
"zip4": "7371", | ||
"longitude": "", | ||
"latitude": "", | ||
"fipsCode": "", | ||
"verificationCodes": [ | ||
"AC01", | ||
"AE09", | ||
"AS02" | ||
], | ||
"fullAddress": "36 E 64th ST; New York, NY 10065-7371" | ||
} | ||
], | ||
"courts": [ | ||
{ | ||
"type": "court", | ||
"addressHashOpt9": -5893356457424657400.0, | ||
"courtId": "NYNEWL1", | ||
"courtName": "Civil Court of the City of New York", | ||
"courtPhoneOne": "6463865700", | ||
"courtPhoneOneExtension": null, | ||
"courtPhoneTwo": "6463865730", | ||
"fax": "2123748053", | ||
"courtUrl": "http://www.courts.state.ny.us/courts/1jd/index.shtml", | ||
"address": { | ||
"addressType": "Court Address", | ||
"addressHashOpt9": -5893356457424657400.0, | ||
"houseNumber": "111", | ||
"streetDirection": "", | ||
"streetName": "Centre", | ||
"streetType": "ST", | ||
"streetPostDirection": "", | ||
"unitType": "Rm", | ||
"unitNumber": "118", | ||
"city": "New York", | ||
"county": "New York", | ||
"state": "NY", | ||
"zipCode": "10013", | ||
"zip4": "4390", | ||
"longitude": "", | ||
"latitude": "", | ||
"fipsCode": "", | ||
"verificationCodes": [ | ||
"AC03", | ||
"AE08", | ||
"AS02" | ||
], | ||
"fullAddress": "111 Centre ST, Rm 118; New York, NY 10013-4390" | ||
} | ||
} | ||
], | ||
"evictionDetails": [ | ||
{ | ||
"courtId": "NYNEWL1", | ||
"caseNumber": "20050071276", | ||
"fileDate": "20050516", | ||
"liabilityAmount": "000045000", | ||
"reportDate": "20060824", | ||
"fileType": "BN", | ||
"state": "NY", | ||
"unlawfulDetainer": "Y", | ||
"assetsInDollar": "000000000", | ||
"updateDate": "" | ||
} | ||
] | ||
}; | ||
var a = (0, mapper_1.mapObject)(aa, [ | ||
{ | ||
"source": "companyName", | ||
"target": { | ||
"path": "avadaKedavra", | ||
"defaultValue": "CIVIL", | ||
"predefinedTransformations": [ | ||
{ | ||
transformation: 'companyNameFormat', | ||
} | ||
] | ||
}, | ||
} | ||
]); | ||
console.log(JSON.stringify(a, null, 2)); | ||
//# sourceMappingURL=index.js.map |
@@ -186,13 +186,13 @@ "use strict"; | ||
var businessStructureAbbreviations = [ | ||
'Col', 'Corp', 'Inc', 'LC', 'LLC', 'LLLP', 'LLP', 'LP', 'Ltd', 'PC', 'PLLC', 'GP', 'Co' | ||
"Col", "Corp", "Corp.", "Inc", "LC", "LLC", "LLLP", "LLP", "LP", "Ltd", "PC", "PLLC", "GP", "Co.", "col", "corp", "corp.", "inc", "lc", "llc", "lllp", "llp", "lp", "ltd", "pc", "pllc", "gp", "co" | ||
]; | ||
var businessStructureAbbreviationsSet = new Set(businessStructureAbbreviations.map(function (abbr) { return abbr.toLowerCase(); })); | ||
var words = str.split(/\s/); | ||
var lastWord = words[words.length - 1]; | ||
var isBusinessStructureAbbreviation = businessStructureAbbreviationsSet.has(lastWord.toLowerCase().replace('.', '')); | ||
if (isBusinessStructureAbbreviation) { | ||
var formattedName = titleCaseTransformer(words.slice(0, -1).join(' ')); | ||
return "".concat(formattedName, " ").concat(lastWord); | ||
} | ||
return titleCaseTransformer(words.join(' ')); | ||
var transformedWords = words.map(function (word) { | ||
var lowercaseWord = word.toLowerCase(); | ||
if (businessStructureAbbreviations.some(function (abbr) { return lowercaseWord.includes(abbr.toLowerCase()); })) { | ||
return word; | ||
} | ||
return titleCaseTransformer(word); | ||
}); | ||
return transformedWords.join(' '); | ||
} | ||
@@ -199,0 +199,0 @@ exports.strategies = { |
{ | ||
"name": "@intelligo.ai/object-to-schema", | ||
"version": "2.2.6", | ||
"version": "2.2.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
97671
1397
0