Skip to content

Commit

Permalink
Merge branch 'develop' into working-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
chronosis committed Jul 1, 2024
2 parents 30b23a5 + 8670e97 commit dcb726f
Show file tree
Hide file tree
Showing 19 changed files with 4,055 additions and 6,547 deletions.
Empty file modified .eslintrc.json
100644 → 100755
Empty file.
Empty file modified .github/auto-merge.yml
100644 → 100755
Empty file.
Empty file modified .github/dependabot.yml
100644 → 100755
Empty file.
Empty file modified .github/stale.yml
100644 → 100755
Empty file.
19 changes: 11 additions & 8 deletions .github/workflows/auto-merge.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [20.x]
npm-registry: ['https://registry.npmjs.org']
steps:
- uses: actions/checkout@v2

Expand All @@ -23,20 +24,22 @@ jobs:
- name: 'NPM Test'
shell: bash
run: |
npm version patch
npx -c 'echo "$npm_package_version"'
npm install -g gulp-cli gulp@5
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set registry http://registry.npmjs.org
npm config set always-auth true
npm config set registry ${{ matrix.npm-registry }}
sudo mkdir ~/.npm || true
sudo chown -R $USER:$GROUP ~/.npm || true
sudo chown -R $USER:$GROUP ~/.config || true
npm ci
gulp
npm run coverage
npm run build
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

- name: 'Report Coverage to Codacy'
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage/lcov.info

- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/build-develop.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [20.x]
slack-channel: ['build-monitoring']
npm-registry: ['https://registry.npmjs.org']
steps:
- name: 'Notify build start'
uses: voxmedia/github-action-slack-notify-build@v1
Expand All @@ -36,19 +37,22 @@ jobs:
- name: 'NPM Test'
shell: bash
run: |
npm install -g gulp-cli gulp@4
npm install -g gulp-cli gulp@5
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set registry http://registry.npmjs.org
npm config set always-auth true
npm config set registry ${{ matrix.npm-registry }}
sudo mkdir ~/.npm || true
sudo chown -R $USER:$GROUP ~/.npm || true
sudo chown -R $USER:$GROUP ~/.config || true
npm ci
gulp
npm run coverage
npm run build
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

- name: 'Report Coverage to Codacy'
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage/lcov.info

- name: Notify slack success
if: success()
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/build-master.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [20.x]
slack-channel: ['build-monitoring']
npm-registry: ['https://registry.npmjs.org']
steps:
- name: 'Notify build start'
uses: voxmedia/github-action-slack-notify-build@v1
Expand All @@ -36,23 +37,25 @@ jobs:
- name: 'NPM Test'
shell: bash
run: |
npm install -g gulp-cli gulp@4
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set registry http://registry.npmjs.org
npm config set always-auth true
npm config set registry ${{ matrix.npm-registry }}
sudo mkdir ~/.npm || true
sudo chown -R $USER:$GROUP ~/.npm || true
sudo chown -R $USER:$GROUP ~/.config || true
npm ci
gulp
npm run build
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

- name: 'Report Coverage to Codacy'
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage/lcov.info

- name: 'NPM Publish'
shell: bash
run: |
npm run coverage || true
npm publish || true
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .prettierrc.json
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion LICENSE
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2018-2019 Jay Reardon
Copyright (c) 2019-2021 Out of Sync Studios LLC
Copyright (c) 2019-2024 Out of Sync Studios LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

Object Key Cache converts JavaScript Objects (Maps) into the key value used to look up data from cache. This is done by serializing the object into JSON (e.g. `JSON.stringify`) and then performing a SHA256 has on the resulting JSON string. This process helps preserve the uniqueness of the key for performing lookups. Once the key has been generated, the key-value pair is passed into the associated Oxxx functions (e.g. oget, oset, etc.)

*Note:* SHA256 has a very low likelihood of key space collisions, but it is not impossible. With one billion messages there is approximately a 1 in 4.3 x 10<sup>60</sup> chance that two distinct strings will generate an identical SHA256 hash. This probability is negligible for most use cases; however, if a very large numbers of keys are expected to be stored then consideration should be given to segregating data by a namespace based upon how it will be used within the cache to decrease any potential for collisions.
*Note:* SHA512 has a very low likelihood of key space collisions, but it is not impossible. With one billion messages there is approximately a 1 in 1.4 x 10<sup>77</sup> chance that two distinct strings will generate an identical SHA512 hash. This probability is negligible for most use cases; however, if a very large numbers of keys are expected to be stored then consideration should be given to segregating data by a namespace based upon how it will be used within the cache to decrease any potential for collisions.

This module has been updated to support NodeJS 18 or higher.

# [Installation](#installation)
<a name="installation"></a>
Expand Down
249 changes: 249 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends("eslint:recommended"), {
ignores: ["eslint.config.js", ".prettier.js"],
languageOptions: {
globals: {
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, "off"])),
...globals.node,
...globals.mocha,
},

ecmaVersion: 2020,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

rules: {
"no-console": "warn",
"no-control-regex": "warn",
"block-scoped-var": "warn",
complexity: ["warn", 15],
"consistent-return": "warn",
curly: ["error", "all"],
"default-case": "error",
"dot-location": ["error", "property"],
"dot-notation": "error",
eqeqeq: "error",
"guard-for-in": "warn",
"no-alert": "warn",
"no-caller": "error",
"no-div-regex": "warn",
"no-else-return": "warn",

"no-empty": ["error", {
allowEmptyCatch: true,
}],

"no-empty-function": ["error", {
allow: ["constructors", "arrowFunctions"],
}],

"no-eval": "warn",
"no-extra-label": "error",
"no-floating-decimal": "error",
"no-implied-eval": "warn",
"no-invalid-this": "error",
"no-iterator": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-loop-func": "warn",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-new-func": "warn",
"no-octal-escape": "error",
"no-proto": "error",
"no-return-assign": "warn",
"no-script-url": "warn",
"no-self-compare": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "warn",
"no-unused-expressions": "warn",
"no-useless-call": "error",
"no-void": "error",

"no-warning-comments": ["warn", {
terms: ["todo", "fixme", "note"],
location: "start",
}],

"require-await": "warn",
yoda: "error",
"no-delete-var": "warn",
"no-shadow": "warn",
"no-shadow-restricted-names": "error",
"no-undef-init": "error",
"no-use-before-define": "error",
"no-buffer-constructor": "error",
"no-new-require": "error",
"no-path-concat": "error",

"array-bracket-newline": ["error", {
multiline: true,
}],

"array-bracket-spacing": ["warn", "never"],
"block-spacing": ["error", "always"],

"brace-style": ["error", "1tbs", {
allowSingleLine: true,
}],

camelcase: ["error", {
properties: "always",
}],

"comma-spacing": ["error", {
before: false,
after: true,
}],

"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"consistent-this": ["error", "self"],
"eol-last": ["error", "always"],
"func-call-spacing": ["error", "never"],
"function-paren-newline": ["error", "multiline"],

"id-length": ["error", {
min: 2,
}],

indent: ["error", 2, {
SwitchCase: 1,
}],

"jsx-quotes": ["error", "prefer-double"],

"key-spacing": ["error", {
afterColon: true,
beforeColon: false,
mode: "minimum",
}],

"keyword-spacing": ["error", {
before: true,
after: true,
}],

"linebreak-style": ["error", "unix"],

"lines-around-comment": ["error", {
beforeBlockComment: true,
}],

"lines-between-class-members": ["error", "always"],

"max-len": ["warn", {
code: 120,
}],

"new-cap": "error",
"new-parens": "error",
"newline-per-chained-call": "error",
"no-array-constructor": "error",
"no-lonely-if": "error",
"no-multi-assign": "error",

"no-multiple-empty-lines": ["error", {
max: 2,
maxEOF: 1,
maxBOF: 1,
}],

"no-new-object": "error",
"no-tabs": "error",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "error",

"object-curly-newline": ["error", {
multiline: true,
}],

"object-curly-spacing": ["error", "always"],
"operator-assignment": "warn",

"operator-linebreak": ["error", "after", {
overrides: {
"?": "none",
":": "none",
},
}],

"quote-props": ["error", "as-needed"],
quotes: ["error", "single"],
semi: "error",

"semi-spacing": ["error", {
before: false,
after: true,
}],

"semi-style": ["error", "last"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-in-parens": "error",
"space-infix-ops": "error",

"space-unary-ops": ["error", {
words: true,
nonwords: false,
}],

"spaced-comment": ["warn", "always"],

"switch-colon-spacing": ["error", {
after: true,
before: false,
}],

"template-tag-spacing": "error",
"arrow-body-style": ["error", "always"],
"arrow-parens": "error",

"arrow-spacing": ["error", {
before: true,
after: true,
}],

"generator-star-spacing": ["error", {
before: true,
after: false,
}],

"no-confusing-arrow": "error",
"no-var": "warn",
"object-shorthand": ["error", "consistent"],
"prefer-arrow-callback": "error",
"prefer-const": "warn",
"prefer-numeric-literals": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"prefer-template": "warn",
"rest-spread-spacing": "error",
"symbol-description": "error",
"template-curly-spacing": "error",

"yield-star-spacing": ["error", {
before: true,
after: false,
}],
},
}];
Loading

0 comments on commit dcb726f

Please sign in to comment.