Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
run(options?, callback?) {
if (is.fn(options)) {
callback = options;
options = {};
}
options = options || {};
callback = callback || (() => {});
// tslint:disable-next-line no-any
const reqOpts: any = {
transactionOptions: {},
};
if (options.readOnly || this.readOnly) {
reqOpts.transactionOptions.readOnly = {};
}
heartbeat: function (error, one, two, beat) {
is.fn(beat).should.be.ok;
one.should.eql('one');
two.should.eql('two');
done();
}
}, function (cb) { cb(null, 'one', 'two'); });
selected () {
if (is.fn(this.$root.onSelected)) {
this.$root.onSelected(this.model)
}
this.$root.activePath = this.model.path
}
},
shouldRetry_(err) {
return (
this.isRetryableErrorCode_(err.code) && is.fn(this.runFn_) &&
Date.now() - this.beginTime_! < this.timeout_);
}
/**
delete(keys, gaxOptions, callback?) {
if (is.fn(gaxOptions)) {
callback = gaxOptions;
gaxOptions = {};
}
callback = callback || (() => {});
const reqOpts = {
mutations: arrify(keys).map(key => {
return {
delete: entity.keyToKeyProto(key),
};
}),
};
if (this.id) {
this.requests_.push(reqOpts);
setMetadata(metadata, options, callback) {
if (is.fn(options)) {
callback = options;
options = {};
}
callback = callback || common.util.noop;
this.request(
{
method: 'PATCH',
uri: '',
json: metadata,
qs: options,
},
(err, resp) => {
if (err) {
callback(err, resp);
onNavigate = ({ e, href }) => {
e.stopPropagation();
const { onNavigateCallBack, closeMobileMenu, updateHeaderState } = this.props;
if (is.fn(closeMobileMenu)) {
closeMobileMenu();
}
if (is.fn(onNavigateCallBack)) {
onNavigateCallBack(href);
} else if (typeof window !== 'undefined') {
window.location.assign(href);
}
updateHeaderState({
navSelected: -1
});
};
deleteFiles(query, callback) {
if (is.fn(query)) {
callback = query;
query = {};
}
query = query || {};
const MAX_PARALLEL_LIMIT = 10;
const errors = [];
this.getFiles(query, (err, files) => {
if (err) {
callback(err);
return;
}
const deleteFile = (file, callback) => {
get(keys, options, callback?) {
if (is.fn(options)) {
callback = options;
options = {};
}
options = options || {};
this.createReadStream(keys, options)
.on('error', callback)
.pipe(concat(results => {
const isSingleLookup = !is.array(keys);
callback(null, isSingleLookup ? results[0] : results);
}));
}
getInstanceConfigs(query, callback?) {
if (is.fn(query)) {
callback = query;
query = {};
}
const reqOpts = extend({}, query, {
parent: 'projects/' + this.projectId,
});
return this.request(
{
client: 'InstanceAdminClient',
method: 'listInstanceConfigs',
reqOpts,
gaxOpts: query,
},
callback);
}