diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 49641514752..b3d7baa8d82 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -49,13 +49,11 @@ "arrify": "^2.0.0", "extend": "^3.0.2", "google-gax": "^1.11.1", - "is": "^3.2.1", "is-html": "^2.0.0", "protobufjs": "^6.8.8" }, "devDependencies": { "@types/extend": "^3.0.0", - "@types/is": "0.0.21", "@types/mocha": "^7.0.0", "@types/node": "^10.5.7", "@types/proxyquire": "^1.3.28", diff --git a/packages/google-cloud-translate/src/index.ts b/packages/google-cloud-translate/src/index.ts index 6bff158bc83..807b96497d1 100644 --- a/packages/google-cloud-translate/src/index.ts +++ b/packages/google-cloud-translate/src/index.ts @@ -1,18 +1,16 @@ -/*! - * Copyright 2015 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. import * as v2 from './v2'; diff --git a/packages/google-cloud-translate/src/v2/index.ts b/packages/google-cloud-translate/src/v2/index.ts index 35ecf7dc8d9..4b6a2e92d2e 100644 --- a/packages/google-cloud-translate/src/v2/index.ts +++ b/packages/google-cloud-translate/src/v2/index.ts @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2017 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -17,7 +17,6 @@ import {promisifyAll} from '@google-cloud/promisify'; import arrify = require('arrify'); import * as extend from 'extend'; import {GoogleAuthOptions} from 'google-auth-library'; -import * as is from 'is'; const isHtml = require('is-html'); import { @@ -331,7 +330,7 @@ export class Translate extends Service { callback?: GetLanguagesCallback ): void | Promise<[LanguageResult[], Metadata]> { let target: string; - if (is.fn(targetOrCallback)) { + if (typeof targetOrCallback === 'function') { callback = targetOrCallback as GetLanguagesCallback; target = 'en'; } else { @@ -344,7 +343,7 @@ export class Translate extends Service { qs: {}, } as DecorateRequestOptions; - if (target && is.string(target)) { + if (target && typeof target === 'string') { reqOpts.qs.target = target; } @@ -516,7 +515,7 @@ export class Translate extends Service { format: options.format || (isHtml(input[0]) ? 'html' : 'text'), }; - if (is.string(options)) { + if (typeof options === 'string') { body.target = options; } else { if (options.from) { diff --git a/packages/google-cloud-translate/system-test/translate.ts b/packages/google-cloud-translate/system-test/translate.ts index d68223cf9a0..fbff71198f3 100644 --- a/packages/google-cloud-translate/system-test/translate.ts +++ b/packages/google-cloud-translate/system-test/translate.ts @@ -1,18 +1,16 @@ -/*! - * Copyright 2015 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. import * as assert from 'assert'; import {describe, it} from 'mocha'; diff --git a/packages/google-cloud-translate/test/index.ts b/packages/google-cloud-translate/test/index.ts index 7344065222c..964ba950770 100644 --- a/packages/google-cloud-translate/test/index.ts +++ b/packages/google-cloud-translate/test/index.ts @@ -1,18 +1,16 @@ -/*! - * Copyright 2015 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. import {DecorateRequestOptions, util} from '@google-cloud/common'; import {