superlock 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
File without changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "superlock",
3
3
  "description": "The most simple mutex/semaphore implementation",
4
4
  "homepage": "https://nicedoc.io/Kikobeats/lock",
5
- "version": "0.0.0",
5
+ "version": "0.0.1",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "josefrancisco.verdu@gmail.com",
@@ -31,6 +31,7 @@
31
31
  "@commitlint/config-conventional": "latest",
32
32
  "ava": "latest",
33
33
  "c8": "latest",
34
+ "ci-publish": "latest",
34
35
  "conventional-github-releaser": "latest",
35
36
  "finepack": "latest",
36
37
  "git-authors-cli": "latest",
@@ -48,11 +49,26 @@
48
49
  "files": [
49
50
  "src"
50
51
  ],
52
+ "scripts": {
53
+ "clean": "rm -rf node_modules",
54
+ "contributors": "(git-authors-cli && finepack --sort-ignore-object-at ava && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
55
+ "coverage": "c8 report --reporter=text-lcov > coverage/lcov.info",
56
+ "lint": "standard-markdown README.md && standard",
57
+ "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
58
+ "prerelease": "npm run update:check && npm run contributors",
59
+ "pretest": "npm run lint",
60
+ "release": "standard-version -a",
61
+ "release:github": "conventional-github-releaser -p angular",
62
+ "release:tags": "git push --follow-tags origin HEAD:master",
63
+ "test": "c8 ava",
64
+ "update": "ncu -u",
65
+ "update:check": "ncu -- --error-level 2"
66
+ },
51
67
  "license": "MIT",
52
68
  "ava": {
53
69
  "files": [
54
- "!test/helpers.js",
55
- "test/**/*.js"
70
+ "test/**/*.js",
71
+ "!test/helpers.js"
56
72
  ]
57
73
  },
58
74
  "commitlint": {
@@ -72,26 +88,11 @@
72
88
  "standard-markdown"
73
89
  ],
74
90
  "package.json": [
75
- "finepack"
91
+ "finepack --sort-ignore-object-at ava"
76
92
  ]
77
93
  },
78
94
  "simple-git-hooks": {
79
95
  "commit-msg": "npx commitlint --edit",
80
96
  "pre-commit": "npx nano-staged"
81
- },
82
- "scripts": {
83
- "clean": "rm -rf node_modules",
84
- "contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
85
- "coverage": "c8 report --reporter=text-lcov > coverage/lcov.info",
86
- "lint": "standard-markdown README.md && standard",
87
- "postrelease": "npm run release:tags && npm run release:github && npm publish",
88
- "prerelease": "npm run update:check && npm run contributors",
89
- "pretest": "npm run lint",
90
- "release": "standard-version -a",
91
- "release:github": "conventional-github-releaser -p angular",
92
- "release:tags": "git push --follow-tags origin HEAD:master",
93
- "test": "c8 ava",
94
- "update": "ncu -u",
95
- "update:check": "ncu -- --error-level 2"
96
97
  }
97
- }
98
+ }
package/src/create.js CHANGED
@@ -19,15 +19,6 @@ module.exports = (slots = 1) => {
19
19
  lock.isLocked() ? queue.push(fn) : fn()
20
20
  })
21
21
 
22
- lock.withLock = async fn => {
23
- const release = await lock()
24
- try {
25
- return await fn()
26
- } finally {
27
- release()
28
- }
29
- }
30
-
31
22
  lock.isLocked = () => slots === 0
32
23
 
33
24
  return lock