Skip to content

Commit beb21a8

Browse files
authoredFeb 12, 2022
Merge pull request #306 from DavidVujic/fix_get_fn_docs
fix: get functions returns an array of [stat, string|Buffer]
2 parents 995ee1c + f2b81e4 commit beb21a8

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
 

‎lib/typedeclarations.d.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -519,17 +519,17 @@ declare module "zookeeper" {
519519
/**
520520
* @param {string} path
521521
* @param {boolean} watch
522-
* @fulfill {string|Buffer}
523-
* @returns {Promise.<string|Buffer>}
522+
* @fulfill {Array} [stat, data] - stat: object, data: string|Buffer
523+
* @returns {Promise.<Array>} [stat, data] - stat: object, data: string|Buffer
524524
*/
525-
get(path: string, watch: boolean): Promise<string | Buffer>;
525+
get(path: string, watch: boolean): Promise<any[]>;
526526
/**
527527
* @param {string} path
528528
* @param {function} watchCb
529-
* @fulfill {string|Buffer}
530-
* @returns {Promise.<string|Buffer>}
529+
* @fulfill {Array} [stat, data] - stat: object, data: string|Buffer
530+
* @returns {Promise.<Array>} [stat, data] - stat: object, data: string|Buffer
531531
*/
532-
w_get(path: string, watchCb: Function): Promise<string | Buffer>;
532+
w_get(path: string, watchCb: Function): Promise<any[]>;
533533
/**
534534
* @param {string} path
535535
* @param {boolean} watch

‎lib/zk_promise.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ class ZooKeeperPromise extends ZooKeeper {
100100
/**
101101
* @param {string} path
102102
* @param {boolean} watch
103-
* @fulfill {string|Buffer}
104-
* @returns {Promise.<string|Buffer>}
103+
* @fulfill {Array} [stat, data] - stat: object, data: string|Buffer
104+
* @returns {Promise.<Array>} [stat, data] - stat: object, data: string|Buffer
105105
*/
106106
get(path, watch) {
107107
return this.promisify(super.a_get, [path, watch]);
@@ -110,8 +110,8 @@ class ZooKeeperPromise extends ZooKeeper {
110110
/**
111111
* @param {string} path
112112
* @param {function} watchCb
113-
* @fulfill {string|Buffer}
114-
* @returns {Promise.<string|Buffer>}
113+
* @fulfill {Array} [stat, data] - stat: object, data: string|Buffer
114+
* @returns {Promise.<Array>} [stat, data] - stat: object, data: string|Buffer
115115
*/
116116
w_get(path, watchCb) {
117117
return this.promisify(super.aw_get, [path, watchCb]);

0 commit comments

Comments
 (0)
Please sign in to comment.