New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

happn-commons

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

happn-commons - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2-test

lib/concurrency/async-queue.js

3

index.js

@@ -33,8 +33,11 @@ const path = require('path'),

BaseDataProvider: require('./lib/base-data-provider'),
BaseBuilder: require('./lib/base-builder'),
lruCache: require('lru-cache'),
fastClone: require('fast-clone'),
HashRingSemaphore: require('./lib/concurrency/hashring-semaphore'),
AsyncQueue: require('./lib/concurrency/async-queue'),
lock: require('async-lock'),
delay: require('await-delay'),
};
// must be declared after we have attached other deps
module.exports.clone = require('./lib/clone');

10

lib/base-builder.js

@@ -27,3 +27,3 @@ const _ = require('lodash');

}
build() {
build(obj) {
const fieldNames = Object.keys(this.__data);

@@ -33,3 +33,3 @@ if (this.__required) this.checkRequired();

return _.set(json, key, this.buildValue(this.__data[key]));
}, {});
}, obj || {});
}

@@ -46,3 +46,7 @@ push(fieldName, value, type, max) {

if (type != null) this.checkType(value, type, fieldName);
this.__data[fieldName] = value;
if (fieldName === '.') {
this.__data = value;
} else {
this.__data[fieldName] = value;
}
return this;

@@ -49,0 +53,0 @@ }

@@ -14,2 +14,8 @@ /* eslint-disable prettier/prettier */

},
SERVICE_STATE: {
UNINITIALIZED: 0,
STARTED: 1,
STOPPING: 2,
STOPPED: 3,
},
CLIENT_STATE: {

@@ -16,0 +22,0 @@ UNINITIALIZED: 0,

@@ -17,5 +17,8 @@ module.exports = {

wildcardPreliminaryMatch: function (pattern, matchTo) {
// do an explicit check
if (pattern.indexOf('*') === -1) return pattern === matchTo;
const preparedPattern = pattern.replace(/(.)\1+/g, '*'); //strip out *** ****** and replace with *
if (preparedPattern === '*') return true;
// do a starts with check
if (!matchTo.startsWith(preparedPattern.split('*')[0])) return false;
return preparedPattern;

@@ -34,7 +37,7 @@ },

if (typeof preparedOrMatched === 'boolean') return preparedOrMatched; //we have a match result, return it
//try a starts with reject
const initialSegment = preparedOrMatched.split('*').pop();
if (initialSegment.length > 0 && matchTo.indexOf(initialSegment) === -1) return false;
return this.makeRe(preparedOrMatched).test(matchTo);
},
addLeadingSlashIfNone: function (path) {
return path.startsWith('/') ? path : '/' + path;
},
stripLeadingSlashes: function (path) {

@@ -41,0 +44,0 @@ return path.replace(/^\//, '');

{
"name": "happn-commons",
"version": "1.5.1",
"version": "1.5.2-test",
"description": "",

@@ -14,2 +14,3 @@ "main": "index.js",

"async-lock": "^1.4.0",
"await-delay": "^1.0.0",
"custom-env": "^2.0.1",

@@ -16,0 +17,0 @@ "fast-clone": "^1.5.13",

@@ -30,1 +30,5 @@ 1.0.2 2022-03-29

- refactor: lint
1.5.2-prerelease 2023-09-13
-----------------
- Includes BaseBuilder in index
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