Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('exports all types', function() {
// Ordering as per firestore.d.ts
assert.ok(is.defined(Firestore.Firestore));
assert.equal(Firestore.Firestore.name, 'Firestore');
assert.ok(is.defined(Firestore.Timestamp));
assert.equal(Firestore.Timestamp.name, 'Timestamp');
assert.ok(is.defined(Firestore.GeoPoint));
assert.equal(Firestore.GeoPoint.name, 'GeoPoint');
assert.ok(is.defined(Firestore.Transaction));
assert.equal(Firestore.Transaction.name, 'Transaction');
assert.ok(is.defined(Firestore.WriteBatch));
assert.equal(Firestore.WriteBatch.name, 'WriteBatch');
assert.ok(is.defined(Firestore.DocumentReference));
assert.equal(Firestore.DocumentReference.name, 'DocumentReference');
assert.ok(is.defined(Firestore.WriteResult));
assert.equal(Firestore.WriteResult.name, 'WriteResult');
assert.ok(is.defined(Firestore.DocumentSnapshot));
assert.equal(Firestore.DocumentSnapshot.name, 'DocumentSnapshot');
assert.ok(is.defined(Firestore.QueryDocumentSnapshot));
assert.equal(Firestore.QueryDocumentSnapshot.name, 'QueryDocumentSnapshot');
assert.ok(is.defined(Firestore.Query));
assert.equal(Firestore.Query.name, 'Query');
assert.ok(is.defined(Firestore.QuerySnapshot));
assert.equal(Firestore.QuerySnapshot.name, 'QuerySnapshot');
assert.ok(is.defined(Firestore.CollectionReference));
assert.equal(Firestore.CollectionReference.name, 'CollectionReference');
assert.ok(is.defined(Firestore.FieldValue));
it('exports all types', function() {
// Ordering as per firestore.d.ts
assert.ok(is.defined(Firestore.Firestore));
assert.equal(Firestore.Firestore.name, 'Firestore');
assert.ok(is.defined(Firestore.Timestamp));
assert.equal(Firestore.Timestamp.name, 'Timestamp');
assert.ok(is.defined(Firestore.GeoPoint));
assert.equal(Firestore.GeoPoint.name, 'GeoPoint');
assert.ok(is.defined(Firestore.Transaction));
assert.equal(Firestore.Transaction.name, 'Transaction');
assert.ok(is.defined(Firestore.WriteBatch));
assert.equal(Firestore.WriteBatch.name, 'WriteBatch');
assert.ok(is.defined(Firestore.DocumentReference));
assert.equal(Firestore.DocumentReference.name, 'DocumentReference');
assert.ok(is.defined(Firestore.WriteResult));
assert.equal(Firestore.WriteResult.name, 'WriteResult');
assert.ok(is.defined(Firestore.DocumentSnapshot));
assert.equal(Firestore.DocumentSnapshot.name, 'DocumentSnapshot');
assert.ok(is.defined(Firestore.QueryDocumentSnapshot));
it('exports all types', function() {
// Ordering as per firestore.d.ts
assert.ok(is.defined(Firestore.Firestore));
assert.equal(Firestore.Firestore.name, 'Firestore');
assert.ok(is.defined(Firestore.Timestamp));
assert.equal(Firestore.Timestamp.name, 'Timestamp');
assert.ok(is.defined(Firestore.GeoPoint));
assert.equal(Firestore.GeoPoint.name, 'GeoPoint');
assert.ok(is.defined(Firestore.Transaction));
assert.equal(Firestore.Transaction.name, 'Transaction');
assert.ok(is.defined(Firestore.WriteBatch));
assert.equal(Firestore.WriteBatch.name, 'WriteBatch');
assert.ok(is.defined(Firestore.DocumentReference));
assert.equal(Firestore.DocumentReference.name, 'DocumentReference');
assert.ok(is.defined(Firestore.WriteResult));
assert.equal(Firestore.WriteResult.name, 'WriteResult');
assert.ok(is.defined(Firestore.DocumentSnapshot));
assert.equal(Firestore.DocumentSnapshot.name, 'DocumentSnapshot');
assert.ok(is.defined(Firestore.QueryDocumentSnapshot));
assert.equal(Firestore.QueryDocumentSnapshot.name, 'QueryDocumentSnapshot');
assert.ok(is.defined(Firestore.Query));
assert.equal(Firestore.Query.name, 'Query');
assert.ok(is.defined(Firestore.QuerySnapshot));
assert.equal(Firestore.QuerySnapshot.name, 'QuerySnapshot');
assert.ok(is.defined(Firestore.CollectionReference));
assert.equal(Firestore.CollectionReference.name, 'CollectionReference');
assert.ok(is.defined(Firestore.FieldValue));
assert.equal(Firestore.FieldValue.name, 'FieldValue');
assert.ok(is.defined(Firestore.FieldPath));
assert.equal(Firestore.Firestore.name, 'Firestore');
assert.ok(!Firestore.FieldValue.serverTimestamp().isEqual(
// Ordering as per firestore.d.ts
assert.ok(is.defined(Firestore.Firestore));
assert.equal(Firestore.Firestore.name, 'Firestore');
assert.ok(is.defined(Firestore.Timestamp));
assert.equal(Firestore.Timestamp.name, 'Timestamp');
assert.ok(is.defined(Firestore.GeoPoint));
assert.equal(Firestore.GeoPoint.name, 'GeoPoint');
assert.ok(is.defined(Firestore.Transaction));
assert.equal(Firestore.Transaction.name, 'Transaction');
assert.ok(is.defined(Firestore.WriteBatch));
assert.equal(Firestore.WriteBatch.name, 'WriteBatch');
assert.ok(is.defined(Firestore.DocumentReference));
assert.equal(Firestore.DocumentReference.name, 'DocumentReference');
assert.ok(is.defined(Firestore.WriteResult));
assert.equal(Firestore.WriteResult.name, 'WriteResult');
assert.ok(is.defined(Firestore.DocumentSnapshot));
assert.equal(Firestore.DocumentSnapshot.name, 'DocumentSnapshot');
assert.ok(is.defined(Firestore.QueryDocumentSnapshot));
assert.equal(Firestore.QueryDocumentSnapshot.name, 'QueryDocumentSnapshot');
assert.ok(is.defined(Firestore.Query));
assert.equal(Firestore.Query.name, 'Query');
assert.ok(is.defined(Firestore.QuerySnapshot));
assert.equal(Firestore.QuerySnapshot.name, 'QuerySnapshot');
assert.ok(is.defined(Firestore.CollectionReference));
assert.equal(Firestore.CollectionReference.name, 'CollectionReference');
assert.ok(is.defined(Firestore.FieldValue));
assert.equal(Firestore.FieldValue.name, 'FieldValue');
assert.ok(is.defined(Firestore.FieldPath));
assert.equal(Firestore.Firestore.name, 'Firestore');
assert.ok(!Firestore.FieldValue.serverTimestamp().isEqual(
Firestore.FieldValue.delete()));
});
vision.detectText(IMAGES.text, options, function(err, text) {
assert.ifError(err);
assert(is.defined(text[0].bounds));
done();
});
});
this.name,
'/instanceGroupManagers/',
json.target,
].join('');
}
if (is.defined(json.coolDown)) {
json.autoscalingPolicy.coolDownPeriodSec = json.coolDown;
delete json.coolDown;
}
if (is.defined(json.cpu)) {
json.autoscalingPolicy.cpuUtilization = {
utilizationTarget: json.cpu / 100,
};
delete json.cpu;
}
if (is.defined(json.loadBalance)) {
json.autoscalingPolicy.loadBalancingUtilization = {
utilizationTarget: json.loadBalance / 100,
};
delete json.loadBalance;
}
if (is.defined(json.maxReplicas)) {
json.autoscalingPolicy.maxNumReplicas = json.maxReplicas;
delete json.maxReplicas;
}
if (is.defined(json.minReplicas)) {
json.autoscalingPolicy.minNumReplicas = json.minReplicas;
delete json.minReplicas;
}
this.request(
{
method: 'POST',
destination.constructor.name === 'Bucket') {
destBucket = destination;
destName = this.name;
} else if (destination instanceof File) {
destBucket = destination.bucket;
destName = destination.name;
newFile = destination;
} else {
throw noDestinationError;
}
var query = {};
if (is.defined(this.generation)) {
query.sourceGeneration = this.generation;
}
if (is.defined(options.token)) {
query.rewriteToken = options.token;
}
if (is.defined(options.userProject)) {
query.userProject = options.userProject;
delete options.userProject;
}
newFile = newFile || destBucket.file(destName);
this.request({
method: 'POST',
uri: format('/rewriteTo/b/{bucketName}/o/{fileName}', {
bucketName: destBucket.name,
fileName: encodeURIComponent(destName)
}),
qs: query,
} else if (
destination.constructor &&
destination.constructor.name === 'Bucket'
) {
destBucket = destination;
destName = this.name;
} else if (destination instanceof File) {
destBucket = destination.bucket;
destName = destination.name;
newFile = destination;
} else {
throw noDestinationError;
}
const query = {};
if (is.defined(this.generation)) {
query.sourceGeneration = this.generation;
}
if (is.defined(options.token)) {
query.rewriteToken = options.token;
}
if (is.defined(options.userProject)) {
query.userProject = options.userProject;
delete options.userProject;
}
newFile = newFile || destBucket.file(destName);
const headers = {};
if (is.defined(this.encryptionKey)) {
headers['x-goog-copy-source-encryption-algorithm'] = 'AES256';
const headers = {};
if (is.defined(this.encryptionKey)) {
headers['x-goog-copy-source-encryption-algorithm'] = 'AES256';
headers['x-goog-copy-source-encryption-key'] = this.encryptionKeyBase64;
headers[
'x-goog-copy-source-encryption-key-sha256'
] = this.encryptionKeyHash;
}
if (is.defined(newFile.encryptionKey)) {
this.setEncryptionKey(newFile.encryptionKey);
} else if (is.defined(options.destinationKmsKeyName)) {
query.destinationKmsKeyName = options.destinationKmsKeyName;
delete options.destinationKmsKeyName;
} else if (is.defined(newFile.kmsKeyName)) {
query.destinationKmsKeyName = newFile.kmsKeyName;
}
if (query.destinationKmsKeyName) {
this.kmsKeyName = query.destinationKmsKeyName;
const keyIndex = this.interceptors.indexOf(this.encryptionKeyInterceptor);
if (keyIndex > -1) {
this.interceptors.splice(keyIndex, 1);
}
}
this.request(
{
method: 'POST',
uri: `/rewriteTo/b/${destBucket.name}/o/${encodeURIComponent(
json.target = [
'https://content.googleapis.com/compute/v1/projects/',
this.compute.projectId,
'/zones/',
this.name,
'/instanceGroupManagers/',
json.target
].join('');
}
if (is.defined(json.coolDown)) {
json.autoscalingPolicy.coolDownPeriodSec = json.coolDown;
delete json.coolDown;
}
if (is.defined(json.cpu)) {
json.autoscalingPolicy.cpuUtilization = {
utilizationTarget: json.cpu / 100
};
delete json.cpu;
}
if (is.defined(json.loadBalance)) {
json.autoscalingPolicy.loadBalancingUtilization = {
utilizationTarget: json.loadBalance / 100
};
delete json.loadBalance;
}
if (is.defined(json.maxReplicas)) {
json.autoscalingPolicy.maxNumReplicas = json.maxReplicas;
delete json.maxReplicas;