@google-cloud/common
Advanced tools
Comparing version 3.4.1 to 3.5.0
@@ -66,3 +66,5 @@ /// <reference types="node" /> | ||
} | ||
export declare type DeleteOptions = object; | ||
export declare type DeleteOptions = { | ||
ignoreNotFound?: boolean; | ||
} & object; | ||
export interface DeleteCallback { | ||
@@ -69,0 +71,0 @@ (err: Error | null, apiResponse?: r.Response): void; |
@@ -118,2 +118,4 @@ "use strict"; | ||
const [options, callback] = util_1.util.maybeOptionsOrCallback(optionsOrCallback, cb); | ||
const ignoreNotFound = options.ignoreNotFound; | ||
delete options.ignoreNotFound; | ||
const methodConfig = (typeof this.methods.delete === 'object' && this.methods.delete) || {}; | ||
@@ -128,3 +130,10 @@ const reqOpts = extend(true, { | ||
// behavior. Ensure we call the original `request` method. | ||
ServiceObject.prototype.request.call(this, reqOpts, callback); | ||
ServiceObject.prototype.request.call(this, reqOpts, (err, ...args) => { | ||
if (err) { | ||
if (err.code === 404 && ignoreNotFound) { | ||
err = null; | ||
} | ||
} | ||
callback(err, ...args); | ||
}); | ||
} | ||
@@ -131,0 +140,0 @@ exists(optionsOrCallback, cb) { |
@@ -7,2 +7,9 @@ # Changelog | ||
## [3.5.0](https://www.github.com/googleapis/nodejs-common/compare/v3.4.1...v3.5.0) (2020-11-11) | ||
### Features | ||
* add ignoreNotFound to service-object#delete ([#634](https://www.github.com/googleapis/nodejs-common/issues/634)) ([3248e27](https://www.github.com/googleapis/nodejs-common/commit/3248e27c3776d705720f69c2dcf48d51f2cc4e5c)) | ||
### [3.4.1](https://www.github.com/googleapis/nodejs-common/compare/v3.4.0...v3.4.1) (2020-10-06) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "@google-cloud/common", | ||
"description": "Common components for Cloud APIs Node.js Client Libraries", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "author": "Google Inc.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119783
1851