@molassesapp/common
Advanced tools
Comparing version 0.4.0 to 0.4.2
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21073
404
+ Addedcrc@^3.8.0
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedcrc@3.8.0(transitive)
+ Addedieee754@1.2.1(transitive)
- Removedcrc-32@^1.2.0
- Removedcrc-32@1.2.2(transitive)