@google-cloud/promisify 2.0.2 → 2.0.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/nodejs-promisify?activeTab=versions
6
6
 
7
+ ### [2.0.3](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.2...v2.0.3) (2020-09-04)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * allow excluding accessor methods ([#228](https://www.github.com/googleapis/nodejs-promisify/issues/228)) ([114d8bc](https://www.github.com/googleapis/nodejs-promisify/commit/114d8bcef7093bdfda195a15e0c2f376195fd3fc))
13
+
7
14
  ### [2.0.2](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.1...v2.0.2) (2020-07-06)
8
15
 
9
16
 
package/README.md CHANGED
@@ -14,6 +14,9 @@
14
14
  A simple utility for promisifying functions and classes.
15
15
 
16
16
 
17
+ A comprehensive list of changes in each version may be found in
18
+ [the CHANGELOG](https://github.com/googleapis/nodejs-promisify/blob/master/CHANGELOG.md).
19
+
17
20
  * [Google Cloud Common Promisify Node.js Client API Reference][client-docs]
18
21
 
19
22
  * [github.com/googleapis/nodejs-promisify](https://github.com/googleapis/nodejs-promisify)
@@ -74,9 +74,10 @@ function promisifyAll(Class, options) {
74
74
  const ownPropertyNames = Object.getOwnPropertyNames(Class.prototype);
75
75
  const methods = ownPropertyNames.filter(methodName => {
76
76
  // clang-format off
77
- return (typeof Class.prototype[methodName] === 'function' && // is it a function?
78
- !/(^_|(Stream|_)|promise$)|^constructor$/.test(methodName) && // is it promisable?
79
- exclude.indexOf(methodName) === -1); // is it blacklisted?
77
+ return (!exclude.includes(methodName) &&
78
+ typeof Class.prototype[methodName] === 'function' && // is it a function?
79
+ !/(^_|(Stream|_)|promise$)|^constructor$/.test(methodName) // is it promisable?
80
+ );
80
81
  // clang-format on
81
82
  });
82
83
  methods.forEach(methodName => {
@@ -130,9 +131,10 @@ Class, options) {
130
131
  const ownPropertyNames = Object.getOwnPropertyNames(Class.prototype);
131
132
  const methods = ownPropertyNames.filter(methodName => {
132
133
  // clang-format off
133
- return (typeof Class.prototype[methodName] === 'function' && // is it a function?
134
- !/^_|(Stream|_)|^constructor$/.test(methodName) && // is it callbackifyable?
135
- exclude.indexOf(methodName) === -1); // is it blacklisted?
134
+ return (!exclude.includes(methodName) &&
135
+ typeof Class.prototype[methodName] === 'function' && // is it a function?
136
+ !/^_|(Stream|_)|^constructor$/.test(methodName) // is it callbackifyable?
137
+ );
136
138
  // clang-format on
137
139
  });
138
140
  methods.forEach(methodName => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google-cloud/promisify",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "A simple utility for promisifying functions and classes.",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -20,7 +20,9 @@
20
20
  "predocs-test": "npm run docs",
21
21
  "prelint": "cd samples; npm link ../; npm install",
22
22
  "clean": "gts clean",
23
- "precompile": "gts clean"
23
+ "precompile": "gts clean",
24
+ "api-extractor": "api-extractor run --local",
25
+ "api-documenter": "api-documenter yaml --input-folder=temp"
24
26
  },
25
27
  "keywords": [],
26
28
  "files": [
@@ -42,7 +44,9 @@
42
44
  "linkinator": "^2.0.0",
43
45
  "mocha": "^8.0.0",
44
46
  "sinon": "^9.0.0",
45
- "typescript": "^3.8.3"
47
+ "typescript": "^3.8.3",
48
+ "@microsoft/api-documenter": "^7.8.10",
49
+ "@microsoft/api-extractor": "^7.8.10"
46
50
  },
47
51
  "engines": {
48
52
  "node": ">=10"