Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vbb-util

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vbb-util - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

2

package.json
{
"name": "vbb-util",
"description": "JavaScript utilites for the VBB API client.",
"version": "0.2.0",
"version": "0.3.0",
"main": "./src/index",

@@ -6,0 +6,0 @@ "keywords": [

@@ -7,4 +7,5 @@ module.exports = {

searchableName: function (name) {
return name
tokenize: function (name) {
var result = name
.toLowerCase()

@@ -17,19 +18,24 @@ // German umlauts

// remove abbreviations
.replace(/^[SU](\+[SU])?\W/, ' ')
// expand abbreviations
.toLowerCase()
.replace(/\(pl\)/g, ' polen ')
.replace(/\(berlin\)/g, ' berlin ')
.replace(/\(bln\)/g, ' berlin ')
.replace(/str\.?$/, 'strasse')
.replace(/str\.?\W/g, 'strasse ')
.replace(/bhf\.?$/, 'bahnhof')
.replace(/bhf\.?\W/g, 'bahnhof ')
.replace(/\(pl\)/g, 'polen')
.replace(/\(berlin\)/g, 'berlin')
.replace(/\(bln\)/g, 'bln')
.replace(/^[SU](\+[SU])?\W/, ' ') // remove `S+U` abbreviations
.split(/[\s\/\(\)]+/);
var i;
for (i = 0; i < result.length; i++) {
result[i] = result[i]
// expand abbreviations
.replace(/str\.?/, 'strasse')
.replace(/bhf\.?/, 'bahnhof')
.replace(/hbf\.?/, 'hauptbahnhof');
}
return result
.join(' ')
// special chars
.replace(/[^\w\s]/g, ' ')
.replace(/_/g, ' ')
.replace(/[^\w]|_/g, ' ')
.replace(/\s{2,}/g, ' ')

@@ -36,0 +42,0 @@ .trim();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc