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

@molassesapp/common

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@molassesapp/common - npm Package Compare versions

Comparing version 0.4.0 to 0.4.2

12

__tests__/common.test.ts

@@ -23,15 +23,17 @@ import { getUserPercentage } from "../src/common"

})
it("% is 30", () => {
expect(getUserPercentage("1231", 30)).toBeFalsy()
it("% is 50", () => {
expect(getUserPercentage("123", 30)).toBeTruthy()
expect(getUserPercentage("124", 30)).toBeTruthy()
expect(getUserPercentage("125", 30)).toBeTruthy()
expect(getUserPercentage("1232", 30)).toBeFalsy()
expect(getUserPercentage("1233", 30)).toBeFalsy()
expect(getUserPercentage("1234", 30)).toBeFalsy()
expect(getUserPercentage("1235", 30)).toBeTruthy()
expect(getUserPercentage("1235", 30)).toBeFalsy()
expect(getUserPercentage("1236", 30)).toBeFalsy()
expect(getUserPercentage("1237", 30)).toBeFalsy()
expect(getUserPercentage("1238", 30)).toBeFalsy()
expect(getUserPercentage("1239", 30)).toBeTruthy()
expect(getUserPercentage("1240", 30)).toBeFalsy()
expect(getUserPercentage("1239", 30)).toBeFalsy()
expect(getUserPercentage("1240", 30)).toBeTruthy()
})
})
})

@@ -6,2 +6,13 @@ # Change Log

## [0.4.2](https://github.com/molassesapp/molasses-node/compare/v0.4.1...v0.4.2) (2020-09-27)
### Bug Fixes
* should use better crc32 hash package ([2b830ad](https://github.com/molassesapp/molasses-node/commit/2b830ad5461811eeb86074ff3ea746e706ddd7af))
# [0.4.0](https://github.com/molassesapp/molasses-node/compare/v0.3.2...v0.4.0) (2020-09-05)

@@ -8,0 +19,0 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isActive = exports.getUserPercentage = exports.Operator = exports.SegmentType = void 0;
var crc_32_1 = require("crc-32");
var crc32 = require("crc").crc32;
var SegmentType;

@@ -33,3 +33,3 @@ (function (SegmentType) {

}
var c = crc_32_1.str(id);
var c = crc32(id);
var v = Math.abs(c % 100.0);

@@ -36,0 +36,0 @@ return v < percentage;

{
"name": "@molassesapp/common",
"version": "0.4.0",
"version": "0.4.2",
"description": "This is the common package for the @molasses node work - do not install instead use molasses-js or molasses-server",

@@ -31,6 +31,6 @@ "keywords": [],

},
"gitHead": "2e961ee17d3f60a956fb5bf638adbc85a6945a23",
"gitHead": "8cbee03d9b42cdabf928610b2c23abb7289f7cf5",
"dependencies": {
"crc-32": "^1.2.0"
"crc": "^3.8.0"
}
}

@@ -1,2 +0,2 @@

import { str } from "crc-32"
const { crc32 } = require("crc")
export interface Feature {

@@ -60,3 +60,3 @@ id?: string

}
const c = str(id)
const c = crc32(id)
const v = Math.abs(c % 100.0)

@@ -63,0 +63,0 @@ return v < percentage

Sorry, the diff of this file is not supported yet

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