Skip to content

Commit

Permalink
Merge pull request #18 from ndaidong/v2.0.2
Browse files Browse the repository at this point in the history
v2.0.2
  • Loading branch information
ndaidong authored Jun 3, 2022
2 parents 707f3ae + 28f0a32 commit a153b87
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node_version: [14.x, 15.x, 16.x, 17.x]
node_version: [14.x, 15.x, 16.x, 17.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '33 18 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Calculate average and scoring based on Wilson Score Equation
[![NPM](https://badge.fury.io/js/average-rating.svg)](https://badge.fury.io/js/average-rating)
![CI test](https://github.com/ndaidong/average-rating/workflows/ci-test/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/ndaidong/average-rating/badge.svg)](https://coveralls.io/github/ndaidong/average-rating)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ndaidong_average-rating&metric=alert_status)](https://sonarcloud.io/dashboard?id=ndaidong_average-rating)
![CodeQL](https://github.com/ndaidong/average-rating/workflows/CodeQL/badge.svg)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

![Google app on Google Play](https://i.imgur.com/XKEEpdb.png)
Expand Down
2 changes: 1 addition & 1 deletion dist/average-rating.esm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// [email protected].1, by @ndaidong - built with esbuild at 2022-01-04T03:58:54.537Z - published under MIT license
// [email protected].2, by @ndaidong - built with esbuild at 2022-06-03T09:32:41.807Z - published under MIT license
// src/main.js
var score = (p, n) => {
if (p === 0 && n === 0) {
Expand Down
4 changes: 2 additions & 2 deletions dist/average-rating.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 9 additions & 14 deletions dist/cjs/average-rating.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
// [email protected].1, by @ndaidong - built with esbuild at 2022-01-04T03:58:54.537Z - published under MIT license
// [email protected].2, by @ndaidong - built with esbuild at 2022-06-03T09:32:41.807Z - published under MIT license
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __reExport = (target, module2, copyDefault, desc) => {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return target;
return to;
};
var __toCommonJS = /* @__PURE__ */ ((cache) => {
return (module2, temp) => {
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
};
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/main.js
var main_exports = {};
Expand All @@ -29,6 +24,7 @@ __export(main_exports, {
rate: () => rate,
score: () => score
});
module.exports = __toCommonJS(main_exports);
var score = (p, n) => {
if (p === 0 && n === 0) {
return 0;
Expand Down Expand Up @@ -65,7 +61,6 @@ var average = (rating) => {
const r = sum / total;
return Number(r.toFixed(1));
};
module.exports = __toCommonJS(main_exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
average,
Expand Down
2 changes: 1 addition & 1 deletion dist/cjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "average-rating-cjs",
"version": "2.0.1",
"version": "2.0.2",
"main": "./average-rating.js"
}
18 changes: 4 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.1",
"version": "2.0.2",
"name": "average-rating",
"description": "Calculate average score and rating based on Wilson Score Equation",
"homepage": "https://www.npmjs.com/package/average-rating",
Expand All @@ -18,24 +18,14 @@
"scripts": {
"lint": "standard .",
"pretest": "npm run lint",
"test": "NODE_ENV=test jest --verbose --coverage=true --unhandled-rejections=strict --detectOpenHandles",
"test": "NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --verbose --coverage=true --unhandled-rejections=strict --detectOpenHandles",
"build": "node build src/main.js",
"eval": "node eval",
"reset": "node reset"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.16.7",
"esbuild": "^0.14.10",
"jest": "^27.3.1"
},
"babel": {
"env": {
"test": {
"plugins": [
"@babel/plugin-transform-modules-commonjs"
]
}
}
"esbuild": "^0.14.42",
"jest": "^28.1.0"
},
"standard": {
"ignore": [
Expand Down

0 comments on commit a153b87

Please sign in to comment.