• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mike-marcacci / node-redlock / 98
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: dependabot/npm_and_yarn/glob-parent-5.1.2
DEFAULT BRANCH: master
Ran 01 Nov 2019 03:02PM UTC
Jobs 4
Files 6
Run time 12s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
98

Pull #63

travis-ci

web-flow
Replace `table.getn` with length operator

`table.getn` was removed in Lua 5.2, in favor of the `#` operator - see e.g. see e.g. https://stackoverflow.com/questions/11890125/lua-table-library-removed.

While Redis itself still seems to support the old syntax, this change allows compatibility with mock libraries which may rely on newer Lua versions. In my case I ran into issues with https://github.com/stipsan/ioredis-mock.

For anyone looking for a solution in the meantime to use `redlock` with `ioredis-mock` or similar, I'm using:

```javascript
const replaceGetn = (lua: string) => {
  // table.getn(KEYS) --> #KEYS
  return lua.replace(/table\.getn\(([A-Za-z0-9]+)\)/g, '#$1');
}
const redlock = new Redlock(clients, {
  lockScript: replaceGetn,
  extendScript: replaceGetn,
});
```
Pull Request #63: Replace `table.getn` with length operator

303 of 384 branches covered (78.91%)

2034 of 2034 relevant lines covered (100.0%)

77.34 hits per line

Jobs
ID Job ID Ran Files Coverage
1 98.1 01 Nov 2019 03:02PM UTC 0
100.0
Travis Job 98.1
2 98.2 01 Nov 2019 03:02PM UTC 0
100.0
Travis Job 98.2
3 98.3 01 Nov 2019 03:02PM UTC 0
100.0
Travis Job 98.3
4 98.4 01 Nov 2019 03:02PM UTC 0
100.0
Travis Job 98.4
Source Files on build 98
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Travis Build #98
  • Pull Request #63
  • PR Base - master (#96)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc