Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: isaacs/node-lru-cache
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.0
Choose a base ref
...
head repository: isaacs/node-lru-cache
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.0.0
Choose a head ref
  • 19 commits
  • 26 files changed
  • 1 contributor

Commits on Jan 19, 2022

  1. starting over for v7

    isaacs committed Jan 19, 2022
    Copy the full SHA
    dcd2384 View commit details
  2. Copy the full SHA
    ec23360 View commit details
  3. ci: makework tasks

    isaacs committed Jan 19, 2022
    Copy the full SHA
    28416e7 View commit details
  4. length calculations

    Fix: #187
    isaacs committed Jan 19, 2022
    Copy the full SHA
    a9ea27a View commit details

Commits on Jan 20, 2022

  1. disposal

    fix: #188
    isaacs committed Jan 20, 2022
    Copy the full SHA
    16e8687 View commit details
  2. implement ttl (aka maxAge)

    isaacs committed Jan 20, 2022
    Copy the full SHA
    95a2423 View commit details
  3. Copy the full SHA
    9d1fdea View commit details
  4. docs for v7

    isaacs committed Jan 20, 2022
    Copy the full SHA
    a08ce68 View commit details
  5. coverage map

    isaacs committed Jan 20, 2022
    Copy the full SHA
    3ce58d5 View commit details
  6. finish all the features for v7

    isaacs committed Jan 20, 2022
    Copy the full SHA
    253912c View commit details

Commits on Jan 21, 2022

  1. add missing snapshots

    isaacs committed Jan 21, 2022
    Copy the full SHA
    de3ce63 View commit details
  2. Copy the full SHA
    5c74c2b View commit details

Commits on Jan 26, 2022

  1. different approach entirely

    isaacs committed Jan 26, 2022
    Copy the full SHA
    e6c6e2b View commit details

Commits on Jan 30, 2022

  1. iterating on this further, now doing features without perf impact

    Experimented with a few ways to only take the perf hit when
    dispose/ttl/size are actually used, and still go fast when they're not.
    This seems to work well.
    
    Instead of separate classes for stack and pointer list, it's all just in
    the one main LRUCache class.  Then no-op functions are swapped out for
    their slower counterparts if features are opted into.
    isaacs committed Jan 30, 2022
    Copy the full SHA
    0fabf76 View commit details

Commits on Jan 31, 2022

  1. remove old unused benchmark

    isaacs committed Jan 31, 2022
    Copy the full SHA
    ed4f14d View commit details
  2. test: snapshot

    isaacs committed Jan 31, 2022
    Copy the full SHA
    abcab87 View commit details

Commits on Feb 7, 2022

  1. add move-to-tail test

    isaacs committed Feb 7, 2022
    Copy the full SHA
    6536230 View commit details

Commits on Feb 8, 2022

  1. tests and docs

    isaacs committed Feb 8, 2022
    Copy the full SHA
    c33db1c View commit details
  2. 7.0.0

    isaacs committed Feb 8, 2022
    Copy the full SHA
    a9b5725 View commit details
13 changes: 13 additions & 0 deletions .github/workflows/commit-if-modified.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
git config --global user.email "$1"
shift
git config --global user.name "$1"
shift
message="$1"
shift
if [ $(git status --porcelain "$@" | egrep '^ M' | wc -l) -gt 0 ]; then
git add "$@"
git commit -m "$message"
git push || git pull --rebase
git push
fi
15 changes: 15 additions & 0 deletions .github/workflows/copyright-year.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
dir=${1:-$PWD}
dates=($(git log --date=format:%Y --pretty=format:'%ad' --reverse | sort | uniq))
if [ "${#dates[@]}" -eq 1 ]; then
datestr="${dates}"
else
datestr="${dates}-${dates[${#dates[@]}-1]}"
fi

stripDate='s/^((.*)Copyright\b(.*?))((?:,\s*)?(([0-9]{4}\s*-\s*[0-9]{4})|(([0-9]{4},\s*)*[0-9]{4})))(?:,)?\s*(.*)\n$/$1$9\n/g'
addDate='s/^.*Copyright(?:\s*\(c\))? /Copyright \(c\) '$datestr' /g'
for l in $dir/LICENSE*; do
perl -pi -e "$stripDate" $l
perl -pi -e "$addDate" $l
done
37 changes: 37 additions & 0 deletions .github/workflows/isaacs-makework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "various tidying up tasks to silence nagging"

on:
push:
branches:
- main
workflow_dispatch:

jobs:
makework:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2.1.4
with:
node-version: 16.x
- name: put repo in package.json
run: node .github/workflows/package-json-repo.js
- name: check in package.json if modified
run: |
bash -x .github/workflows/commit-if-modified.sh \
"package-json-repo-bot@example.com" \
"package.json Repo Bot" \
"chore: add repo to package.json" \
package.json package-lock.json
- name: put all dates in license copyright line
run: bash .github/workflows/copyright-year.sh
- name: check in licenses if modified
run: |
bash .github/workflows/commit-if-modified.sh \
"license-year-bot@example.com" \
"License Year Bot" \
"chore: add copyright year to license" \
LICENSE*
16 changes: 16 additions & 0 deletions .github/workflows/package-json-repo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node

const pf = require.resolve(`${process.cwd()}/package.json`)
const pj = require(pf)

if (!pj.repository && process.env.GITHUB_REPOSITORY) {
const fs = require('fs')
const server = process.env.GITHUB_SERVER_URL || 'https://github.com'
const repo = `${server}/${process.env.GITHUB_REPOSITORY}`
pj.repository = repo
const json = fs.readFileSync(pf, 'utf8')
const match = json.match(/^\s*\{[\r\n]+([ \t]*)"/)
const indent = match[1]
const output = JSON.stringify(pj, null, indent || 2) + '\n'
fs.writeFileSync(pf, output)
}
Loading