@intelligo.ai/object-to-schema
Advanced tools
Comparing version 2.2.9 to 2.2.10
@@ -11,3 +11,3 @@ "use strict"; | ||
var aa = { | ||
"companyName": "PORTFOLIO ADVISORS SECONDARY AGGREGATOR - VENTURE CAPITAL, L.P.", | ||
"companyName": "PORTFOLIO ADVISORS SECONDARY AGGREGATOR - VENTURE CAPITAL, USa", | ||
"evictionId": 1836030810467466240.0, | ||
@@ -14,0 +14,0 @@ "bridge": null, |
@@ -22,2 +22,5 @@ "use strict"; | ||
function titleCaseTransformer(str) { | ||
if (str === undefined || str === null) { | ||
throw new Error("The value is not a string it is ".concat(str)); | ||
} | ||
return str.trim() | ||
@@ -186,9 +189,17 @@ .split(/\s/) | ||
function companyNameTransformer(str) { | ||
if (str === undefined || str === null) { | ||
throw new Error("The value is not a string it is ".concat(str)); | ||
} | ||
var businessStructureAbbreviations = [ | ||
"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" | ||
"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", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "UK", "US", "USA", | ||
'AK', 'AL', 'AR', 'AS', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'GU', 'HI', 'IA', | ||
'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MP', 'MS', 'MT', | ||
'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', | ||
'TN', 'TX', 'UT', 'VA', 'VI', 'VT', 'WA', 'WI', 'WV', 'WY' | ||
]; | ||
var words = str.trim().split(/\s/); | ||
var transformedWords = words.map(function (word) { | ||
var lowercaseWord = word.toLowerCase().replace(/,/g, ''); | ||
if (businessStructureAbbreviations.some(function (abbr) { return lowercaseWord === abbr.toLowerCase(); })) { | ||
if (businessStructureAbbreviations.some(function (abbr) { return word.replace(/,/g, '') === abbr; })) { | ||
return word; | ||
@@ -195,0 +206,0 @@ } |
{ | ||
"name": "@intelligo.ai/object-to-schema", | ||
"version": "2.2.9", | ||
"version": "2.2.10", | ||
"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
99275
1408