@google-cloud/promisify 2.0.2 → 3.0.0
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 +25 -0
- package/README.md +26 -24
- package/build/src/index.js +8 -6
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/nodejs-promisify?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [3.0.0](https://github.com/googleapis/nodejs-promisify/compare/v2.0.4...v3.0.0) (2022-05-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* drop node 10 from engines list, update typescript to 4.6.3 (#300)
|
|
13
|
+
|
|
14
|
+
### Build System
|
|
15
|
+
|
|
16
|
+
* drop node 10 from engines list, update typescript to 4.6.3 ([#300](https://github.com/googleapis/nodejs-promisify/issues/300)) ([fed2f14](https://github.com/googleapis/nodejs-promisify/commit/fed2f145a5256c939eb66b85a5c7c48332b8841d))
|
|
17
|
+
|
|
18
|
+
### [2.0.4](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.3...v2.0.4) (2021-09-09)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **build:** switch primary branch to main ([#270](https://www.github.com/googleapis/nodejs-promisify/issues/270)) ([11242f7](https://www.github.com/googleapis/nodejs-promisify/commit/11242f7f76e170dae7a429f8d4064bf33be9bb3f))
|
|
24
|
+
|
|
25
|
+
### [2.0.3](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.2...v2.0.3) (2020-09-04)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* allow excluding accessor methods ([#228](https://www.github.com/googleapis/nodejs-promisify/issues/228)) ([114d8bc](https://www.github.com/googleapis/nodejs-promisify/commit/114d8bcef7093bdfda195a15e0c2f376195fd3fc))
|
|
31
|
+
|
|
7
32
|
### [2.0.2](https://www.github.com/googleapis/nodejs-promisify/compare/v2.0.1...v2.0.2) (2020-07-06)
|
|
8
33
|
|
|
9
34
|
|
package/README.md
CHANGED
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
# [Google Cloud Common Promisify: Node.js Client](https://github.com/googleapis/nodejs-promisify)
|
|
6
6
|
|
|
7
|
-
[](https://cloud.google.com/terms/launch-stages)
|
|
8
8
|
[](https://www.npmjs.org/package/@google-cloud/promisify)
|
|
9
|
-
[](https://codecov.io/gh/googleapis/nodejs-promisify)
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
@@ -14,6 +13,9 @@
|
|
|
14
13
|
A simple utility for promisifying functions and classes.
|
|
15
14
|
|
|
16
15
|
|
|
16
|
+
A comprehensive list of changes in each version may be found in
|
|
17
|
+
[the CHANGELOG](https://github.com/googleapis/nodejs-promisify/blob/main/CHANGELOG.md).
|
|
18
|
+
|
|
17
19
|
* [Google Cloud Common Promisify Node.js Client API Reference][client-docs]
|
|
18
20
|
|
|
19
21
|
* [github.com/googleapis/nodejs-promisify](https://github.com/googleapis/nodejs-promisify)
|
|
@@ -77,12 +79,11 @@ installed as a dependency when you install other `@google-cloud` packages.
|
|
|
77
79
|
|
|
78
80
|
## Samples
|
|
79
81
|
|
|
80
|
-
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-promisify/tree/
|
|
81
|
-
has instructions for running the samples.
|
|
82
|
+
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-promisify/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
|
|
82
83
|
|
|
83
84
|
| Sample | Source Code | Try it |
|
|
84
85
|
| --------------------------- | --------------------------------- | ------ |
|
|
85
|
-
| Quickstart | [source code](https://github.com/googleapis/nodejs-promisify/blob/
|
|
86
|
+
| Quickstart | [source code](https://github.com/googleapis/nodejs-promisify/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-promisify&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
|
|
86
87
|
|
|
87
88
|
|
|
88
89
|
|
|
@@ -94,56 +95,57 @@ also contains samples.
|
|
|
94
95
|
Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/).
|
|
95
96
|
Libraries are compatible with all current _active_ and _maintenance_ versions of
|
|
96
97
|
Node.js.
|
|
98
|
+
If you are using an end-of-life version of Node.js, we recommend that you update
|
|
99
|
+
as soon as possible to an actively supported LTS version.
|
|
97
100
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
The dist-tags follow the naming convention `legacy-(version)`.
|
|
101
|
-
|
|
102
|
-
_Legacy Node.js versions are supported as a best effort:_
|
|
103
|
-
|
|
104
|
-
* Legacy versions will not be tested in continuous integration.
|
|
105
|
-
* Some security patches may not be able to be backported.
|
|
106
|
-
* Dependencies will not be kept up-to-date, and features will not be backported.
|
|
101
|
+
Google's client libraries support legacy versions of Node.js runtimes on a
|
|
102
|
+
best-efforts basis with the following warnings:
|
|
107
103
|
|
|
108
|
-
|
|
104
|
+
* Legacy versions are not tested in continuous integration.
|
|
105
|
+
* Some security patches and features cannot be backported.
|
|
106
|
+
* Dependencies cannot be kept up-to-date.
|
|
109
107
|
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
Client libraries targeting some end-of-life versions of Node.js are available, and
|
|
109
|
+
can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
|
|
110
|
+
The dist-tags follow the naming convention `legacy-(version)`.
|
|
111
|
+
For example, `npm install @google-cloud/promisify@legacy-8` installs client libraries
|
|
112
|
+
for versions compatible with Node.js 8.
|
|
112
113
|
|
|
113
114
|
## Versioning
|
|
114
115
|
|
|
115
116
|
This library follows [Semantic Versioning](http://semver.org/).
|
|
116
117
|
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
is stable
|
|
119
|
+
|
|
120
|
+
This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways
|
|
120
121
|
unless absolutely necessary (e.g. because of critical security issues) or with
|
|
121
|
-
an extensive deprecation period. Issues and requests against **
|
|
122
|
+
an extensive deprecation period. Issues and requests against **stable** libraries
|
|
122
123
|
are addressed with the highest priority.
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
|
|
126
127
|
|
|
127
128
|
|
|
129
|
+
|
|
128
130
|
More Information: [Google Cloud Platform Launch Stages][launch_stages]
|
|
129
131
|
|
|
130
132
|
[launch_stages]: https://cloud.google.com/terms/launch-stages
|
|
131
133
|
|
|
132
134
|
## Contributing
|
|
133
135
|
|
|
134
|
-
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-promisify/blob/
|
|
136
|
+
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-promisify/blob/main/CONTRIBUTING.md).
|
|
135
137
|
|
|
136
138
|
Please note that this `README.md`, the `samples/README.md`,
|
|
137
139
|
and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
|
|
138
140
|
are generated from a central template. To edit one of these files, make an edit
|
|
139
|
-
to its
|
|
140
|
-
[directory](https://github.com/googleapis/synthtool
|
|
141
|
+
to its templates in
|
|
142
|
+
[directory](https://github.com/googleapis/synthtool).
|
|
141
143
|
|
|
142
144
|
## License
|
|
143
145
|
|
|
144
146
|
Apache Version 2.0
|
|
145
147
|
|
|
146
|
-
See [LICENSE](https://github.com/googleapis/nodejs-promisify/blob/
|
|
148
|
+
See [LICENSE](https://github.com/googleapis/nodejs-promisify/blob/main/LICENSE)
|
|
147
149
|
|
|
148
150
|
[client-docs]: https://googleapis.dev/nodejs/promisify/latest
|
|
149
151
|
|
package/build/src/index.js
CHANGED
|
@@ -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 (
|
|
78
|
-
|
|
79
|
-
|
|
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 (
|
|
134
|
-
|
|
135
|
-
|
|
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": "
|
|
3
|
+
"version": "3.0.0",
|
|
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",
|
|
@@ -31,20 +31,20 @@
|
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@compodoc/compodoc": "^1.1.9",
|
|
34
|
-
"@types/mocha": "^
|
|
35
|
-
"@types/node": "^
|
|
36
|
-
"@types/sinon": "^
|
|
34
|
+
"@types/mocha": "^9.0.0",
|
|
35
|
+
"@types/node": "^17.0.25",
|
|
36
|
+
"@types/sinon": "^10.0.0",
|
|
37
37
|
"c8": "^7.0.0",
|
|
38
38
|
"chai": "^4.2.0",
|
|
39
39
|
"codecov": "^3.0.4",
|
|
40
|
-
"gts": "^
|
|
40
|
+
"gts": "^3.1.0",
|
|
41
41
|
"hard-rejection": "^2.1.0",
|
|
42
42
|
"linkinator": "^2.0.0",
|
|
43
43
|
"mocha": "^8.0.0",
|
|
44
|
-
"sinon": "^
|
|
45
|
-
"typescript": "^
|
|
44
|
+
"sinon": "^13.0.0",
|
|
45
|
+
"typescript": "^4.6.3"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
48
|
+
"node": ">=12"
|
|
49
49
|
}
|
|
50
50
|
}
|