average-rating
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -1,2 +0,2 @@ | ||
// average-rating@2.0.2, by @ndaidong - built with esbuild at 2022-06-03T09:32:41.807Z - published under MIT license | ||
// average-rating@2.0.3, by @ndaidong - built with esbuild at 2022-08-10T15:12:36.260Z - published under MIT license | ||
// src/main.js | ||
@@ -3,0 +3,0 @@ var score = (p, n) => { |
@@ -1,2 +0,2 @@ | ||
// average-rating@2.0.2, by @ndaidong - built with esbuild at 2022-06-03T09:32:41.807Z - published under MIT license | ||
// average-rating@2.0.3, by @ndaidong - built with esbuild at 2022-08-10T15:12:36.260Z - published under MIT license | ||
var AverageRating=(()=>{var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},i=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!F.call(t,r)&&r!==o&&l(t,r,{get:()=>e[r],enumerable:!(s=d(e,r))||s.enumerable});return t};var m=t=>i(l({},"__esModule",{value:!0}),t);var N={};h(N,{average:()=>b,rate:()=>a,score:()=>x});var x=(t,e)=>{if(t===0&&e===0)return 0;let o=((t+1.9208)/(t+e)-1.96*Math.sqrt(t*e/(t+e)+.9604)/(t+e))/(1+3.8416/(t+e));return Number(o.toFixed(2))},a=t=>{let e=t.length,o=t[0],s=t[e-1],r=(1/(e-1)).toFixed(2),u=e-1;for(let c=1;c<u;c++){let n=(r*c).toFixed(2);s+=t[c]*n,o+=t[u-c]*n}return x(s,o)},b=t=>{let e=t.reduce((u,c)=>u+c,0);if(e===0)return 0;let o=0,s=1;t.forEach(u=>{o+=u*s,s++});let r=o/e;return Number(r.toFixed(1))};return m(N);})(); |
@@ -1,2 +0,2 @@ | ||
// average-rating@2.0.2, by @ndaidong - built with esbuild at 2022-06-03T09:32:41.807Z - published under MIT license | ||
// average-rating@2.0.3, by @ndaidong - built with esbuild at 2022-08-10T15:12:36.260Z - published under MIT license | ||
var __defProp = Object.defineProperty; | ||
@@ -3,0 +3,0 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
{ | ||
"name": "average-rating-cjs", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"main": "./average-rating.js" | ||
} |
{ | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"name": "average-rating", | ||
@@ -11,5 +11,3 @@ "description": "Calculate average score and rating based on Wilson Score Equation", | ||
"author": "@ndaidong", | ||
"main": "./dist/cjs/average-rating.js", | ||
"module": "./src/main.js", | ||
"browser": "./dist/average-rating.min.js", | ||
"main": "./src/main.js", | ||
"type": "module", | ||
@@ -22,3 +20,3 @@ "engines": { | ||
"pretest": "npm run lint", | ||
"test": "NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --verbose --coverage=true --unhandled-rejections=strict --detectOpenHandles", | ||
"test": "NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --verbose --coverage=true", | ||
"build": "node build src/main.js", | ||
@@ -29,4 +27,4 @@ "eval": "node eval", | ||
"devDependencies": { | ||
"esbuild": "^0.14.42", | ||
"jest": "^28.1.0" | ||
"esbuild": "^0.15.0", | ||
"jest": "^28.1.3" | ||
}, | ||
@@ -33,0 +31,0 @@ "standard": { |
@@ -51,9 +51,2 @@ # average-rating | ||
##### Note: | ||
> Since Node.js v14, ECMAScript modules [have became the official standard format](https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_modules_ecmascript_modules). | ||
> Just ensure that you are [using module system](https://nodejs.org/api/packages.html#determining-module-system) and enjoy with ES6 import/export syntax. | ||
### Browsers: | ||
@@ -60,0 +53,0 @@ |
/** | ||
* Calculate average score and rating based on Wilson Score Equation | ||
* @ndaidong | ||
* Refer: https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval | ||
@@ -5,0 +4,0 @@ **/ |
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
20962
527
135