From 0f8586939fb12eca4242249d4b213323fe4d6bff Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Tue, 4 Oct 2022 15:12:53 -0700 Subject: [PATCH 1/9] Replace goog.asserts and goog.testing.asserts Closure assertions are being pruned due to the aggressiveness of the compiler's advanced optimizations. The test side is easily covered by using Jasmine's expectation system. For runtime asserts, we don't have a good replacement so we'll just copy the goog.asserts we need into a new namespace to prevent the Closure compiler from finding them. --- BUILD.bazel | 1 + LICENSE-asserts.md | 176 + asserts.js | 238 ++ binary/arith_test.js | 178 +- binary/decoder.js | 89 +- binary/decoder_test.js | 280 +- binary/encoder.js | 151 +- binary/message_test.js | 14 +- binary/proto_test.js | 594 ++- binary/reader.js | 116 +- binary/reader_test.js | 493 +-- binary/utils.js | 58 +- binary/utils_test.js | 150 +- binary/writer.js | 140 +- binary/writer_test.js | 147 +- commonjs/export.js | 6 +- commonjs/export_asserts.js | 39 - commonjs/rewrite_tests_for_commonjs.js | 3 - debug.js | 11 +- debug_test.js | 58 +- gulpfile.js | 38 +- map.js | 10 +- maps_test.js | 320 +- message.js | 183 +- message_test.js | 1128 +++--- package-lock.json | 34 +- package.json | 2 +- proto3_test.js | 433 ++- yarn.lock | 4766 ++++++++++++------------ 29 files changed, 5050 insertions(+), 4806 deletions(-) create mode 100644 LICENSE-asserts.md create mode 100644 asserts.js delete mode 100644 commonjs/export_asserts.js diff --git a/BUILD.bazel b/BUILD.bazel index 2b4b0e3..5483303 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -27,6 +27,7 @@ pkg_files( "package.json", "README.md", "LICENSE.md", + "LICENSE-asserts.md", ], strip_prefix = strip_prefix.from_root(""), ) diff --git a/LICENSE-asserts.md b/LICENSE-asserts.md new file mode 100644 index 0000000..d9a10c0 --- /dev/null +++ b/LICENSE-asserts.md @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/asserts.js b/asserts.js new file mode 100644 index 0000000..5a5e7fb --- /dev/null +++ b/asserts.js @@ -0,0 +1,238 @@ +/** + * @license + * Copyright The Closure Library Authors. + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Utilities to check the preconditions, postconditions and + * invariants runtime. + */ + +goog.provide('jspb.asserts'); + +/** + * Error object for failed assertions. + * + * @extends {Error} + * @final + */ + +class JspbAssertionError extends Error { + /** + * @param {string} messagePattern The pattern that was used to form message. + * @param {!Array<*>} messageArgs The items to substitute into the pattern. + */ + constructor(messagePattern, messageArgs) { + super(subs(messagePattern, messageArgs)); + + /** + * The message pattern used to format the error message. Error handlers can + * use this to uniquely identify the assertion. + * @type {string} + */ + this.messagePattern = messagePattern; + } +} + +jspb.asserts.JspbAssertionError = JspbAssertionError; + +/** + * The default error handler. + * @param {!JspbAssertionError} e The exception to be handled. + * @return {void} + */ +jspb.asserts.JSPB_DEFAULT_ERROR_HANDLER = function(e) { + throw e; +} + + + +/** + * The handler responsible for throwing or logging assertion errors. + * @type {function(!JspbAssertionError)} + */ +let errorHandler_ = jspb.asserts.JSPB_DEFAULT_ERROR_HANDLER; + + +/** + * Does simple python-style string substitution. + * subs("foo%s hot%s", "bar", "dog") becomes "foobar hotdog". + * @param {string} pattern The string containing the pattern. + * @param {!Array<*>} subs The items to substitute into the pattern. + * @return {string} A copy of `str` in which each occurrence of + * `%s` has been replaced an argument from `var_args`. + */ +function subs(pattern, subs) { + const splitParts = pattern.split('%s'); + let returnString = ''; + + // Replace up to the last split part. We are inserting in the + // positions between split parts. + const subLast = splitParts.length - 1; + for (let i = 0; i < subLast; i++) { + // keep unsupplied as '%s' + const sub = (i < subs.length) ? subs[i] : '%s'; + returnString += splitParts[i] + sub; + } + return returnString + splitParts[subLast]; +} + +/** + * Throws an exception with the given message and "Assertion failed" prefixed + * onto it. + * @param {string} defaultMessage The message to use if givenMessage is empty. + * @param {?Array<*>} defaultArgs The substitution arguments for defaultMessage. + * @param {string|undefined} givenMessage Message supplied by the caller. + * @param {!Array<*>} givenArgs The substitution arguments for givenMessage. + * @throws {JspbAssertionError} When the value is not a number. + */ +function doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) { + let message = 'Assertion failed'; + let args; + if (givenMessage) { + message += ': ' + givenMessage; + args = givenArgs; + } else if (defaultMessage) { + message += ': ' + defaultMessage; + args = defaultArgs; + } + // The '' + works around an Opera 10 bug in the unit tests. Without it, + // a stack trace is added to var message above. With this, a stack trace is + // not added until this line (it causes the extra garbage to be added after + // the assertion message instead of in the middle of it). + const e = new JspbAssertionError('' + message, args || []); + errorHandler_(e); +} + +/** + * Sets a custom error handler that can be used to customize the behavior of + * assertion failures, for example by turning all assertion failures into log + * messages. + * @param {function(!JspbAssertionError)} errorHandler + * @return {void} + */ +jspb.asserts.setJspbErrorHandler = function(errorHandler) { + errorHandler_ = errorHandler; +}; + + +/** + * Checks if the condition evaluates to true. + * @template T + * @param {T} condition The condition to check. + * @param {string=} opt_message Error message in case of failure. + * @param {...*} var_args The items to substitute into the failure message. + * @return {T} The value of the condition. + * @throws {JspbAssertionError} When the condition evaluates to false. + */ + +jspb.asserts.jspbAssert = function(condition, opt_message, var_args) { + if (!condition) { + doAssertFailure( + '', null, opt_message, Array.prototype.slice.call(arguments, 2)); + } + return condition; +}; + + +/** + * Checks if the value is a string. + * @param {*} value The value to check. + * @param {string=} opt_message Error message in case of failure. + * @param {...*} var_args The items to substitute into the failure message. + * @return {string} The value, guaranteed to be a string when asserts enabled. + * @throws {JspbAssertionError} When the value is not a string. + */ +jspb.asserts.jspbAssertString = function(value, opt_message, var_args) { + if (typeof value !== 'string') { + doAssertFailure( + 'Expected string but got %s: %s.', [goog.typeOf(value), value], + opt_message, Array.prototype.slice.call(arguments, 2)); + } + return /** @type {string} */ (value); +}; + + +/** + * Checks if the value is an Array. + * @param {*} value The value to check. + * @param {string=} opt_message Error message in case of failure. + * @param {...*} var_args The items to substitute into the failure message. + * @return {!Array} The value, guaranteed to be a non-null array. + * @throws {JspbAssertionError} When the value is not an array. + */ +jspb.asserts.jspbAssertArray = function(value, opt_message, var_args) { + if (!Array.isArray(value)) { + doAssertFailure( + 'Expected array but got %s: %s.', [goog.typeOf(value), value], + opt_message, Array.prototype.slice.call(arguments, 2)); + } + return /** @type {!Array} */ (value); +}; + +/** + * Triggers a failure. This function is useful in case when we want to add a + * check in the unreachable area like switch-case statement: + * + *
+ *  switch(type) {
+ *    case FOO: doSomething(); break;
+ *    case BAR: doSomethingElse(); break;
+ *    default: jspb.asserts.JspbFail('Unrecognized type: ' + type);
+ *      // We have only 2 types - "default:" section is unreachable code.
+ *  }
+ * 
+ * + * @param {string=} opt_message Error message in case of failure. + * @param {...*} var_args The items to substitute into the failure message. + * @return {void} + * @throws {JspbAssertionError} Failure. + */ +jspb.asserts.jspbFail = function(opt_message, var_args) { + errorHandler_(new JspbAssertionError( + 'Failure' + (opt_message ? ': ' + opt_message : ''), + Array.prototype.slice.call(arguments, 1))); +}; + +/** + * Checks if the value is an instance of the user-defined type. + * + * Do not use this to ensure a value is an HTMLElement or a subclass! Cross- + * document DOM inherits from separate - though identical - browser classes, and + * such a check will unexpectedly fail. + * + * @param {?} value The value to check. + * @param {function(new: T, ...)} type A user-defined constructor. + * @param {string=} opt_message Error message in case of failure. + * @param {...*} var_args The items to substitute into the failure message. + * @throws {JspbAssertionError} When the value is not an instance of + * type. + * @return {T} + * @template T + */ +jspb.asserts.jspbAssertInstanceof = function(value, type, opt_message, var_args) { + if (!(value instanceof type)) { + doAssertFailure( + 'Expected instanceof %s but got %s.', [getType(type), getType(value)], + opt_message, Array.prototype.slice.call(arguments, 3)); + } + return value; +}; + +/** + * Returns the type of a value. If a constructor is passed, and a suitable + * string cannot be found, 'unknown type name' will be returned. + * @param {*} value A constructor, object, or primitive. + * @return {string} The best display name for the value, or 'unknown type name'. + */ +function getType(value) { + if (value instanceof Function) { + return value.displayName || value.name || 'unknown type name'; + } else if (value instanceof Object) { + return /** @type {string} */ (value.constructor.displayName) || + value.constructor.name || Object.prototype.toString.call(value); + } else { + return value === null ? 'null' : typeof value; + } +} diff --git a/binary/arith_test.js b/binary/arith_test.js index dd5791a..37d42ff 100644 --- a/binary/arith_test.js +++ b/binary/arith_test.js @@ -45,8 +45,8 @@ describe('binaryArithTest', function() { * Tests comparison operations. */ it('testCompare', function() { - var a = new jspb.arith.UInt64(1234, 5678); - var b = new jspb.arith.UInt64(1234, 5678); + const a = new jspb.arith.UInt64(1234, 5678); + const b = new jspb.arith.UInt64(1234, 5678); expect(a.cmp(b)).toEqual(0); expect(b.cmp(a)).toEqual(0); b.lo -= 1; @@ -78,10 +78,10 @@ describe('binaryArithTest', function() { * Tests shifts. */ it('testShifts', function() { - var a = new jspb.arith.UInt64(1, 0); + let a = new jspb.arith.UInt64(1, 0); expect(a.lo).toEqual(1); expect(a.hi).toEqual(0); - var orig = a; + const orig = a; a = a.leftShift(); expect(orig.lo).toEqual(1); // original unmodified. expect(orig.hi).toEqual(0); @@ -90,7 +90,7 @@ describe('binaryArithTest', function() { a = a.leftShift(); expect(a.lo).toEqual(4); expect(a.hi).toEqual(0); - for (var i = 0; i < 29; i++) { + for (let i = 0; i < 29; i++) { a = a.leftShift(); } expect(a.lo).toEqual(0x80000000); @@ -115,12 +115,14 @@ describe('binaryArithTest', function() { * Tests additions. */ it('testAdd', function() { - var a = new jspb.arith.UInt64(/* lo = */ 0x89abcdef, - /* hi = */ 0x01234567); - var b = new jspb.arith.UInt64(/* lo = */ 0xff52ab91, - /* hi = */ 0x92fa2123); + const a = new jspb.arith.UInt64( + /* lo = */ 0x89abcdef, + /* hi = */ 0x01234567); + const b = new jspb.arith.UInt64( + /* lo = */ 0xff52ab91, + /* hi = */ 0x92fa2123); // Addition with carry. - var c = a.add(b); + let c = a.add(b); expect(a.lo).toEqual(0x89abcdef); // originals unmodified. expect(a.hi).toEqual(0x01234567); expect(b.lo).toEqual(0xff52ab91); @@ -143,32 +145,20 @@ describe('binaryArithTest', function() { * Test subtractions. */ it('testSub', function() { - var kLength = 10; - var hiValues = [0x1682ef32, - 0x583902f7, - 0xb62f5955, - 0x6ea99bbf, - 0x25a39c20, - 0x0700a08b, - 0x00f7304d, - 0x91a5b5af, - 0x89077fd2, - 0xe09e347c]; - var loValues = [0xe1538b18, - 0xbeacd556, - 0x74100758, - 0x96e3cb26, - 0x56c37c3f, - 0xe00b3f7d, - 0x859f25d7, - 0xc2ee614a, - 0xe1d21cd7, - 0x30aae6a4]; - for (var i = 0; i < kLength; i++) { - for (var j = 0; j < kLength; j++) { - var a = new jspb.arith.UInt64(loValues[i], hiValues[j]); - var b = new jspb.arith.UInt64(loValues[j], hiValues[i]); - var c = a.add(b).sub(b); + const kLength = 10; + const hiValues = [ + 0x1682ef32, 0x583902f7, 0xb62f5955, 0x6ea99bbf, 0x25a39c20, 0x0700a08b, + 0x00f7304d, 0x91a5b5af, 0x89077fd2, 0xe09e347c + ]; + const loValues = [ + 0xe1538b18, 0xbeacd556, 0x74100758, 0x96e3cb26, 0x56c37c3f, 0xe00b3f7d, + 0x859f25d7, 0xc2ee614a, 0xe1d21cd7, 0x30aae6a4 + ]; + for (let i = 0; i < kLength; i++) { + for (let j = 0; j < kLength; j++) { + const a = new jspb.arith.UInt64(loValues[i], hiValues[j]); + const b = new jspb.arith.UInt64(loValues[j], hiValues[i]); + const c = a.add(b).sub(b); expect(c.hi).toEqual(a.hi); expect(c.lo).toEqual(a.lo); } @@ -180,7 +170,7 @@ describe('binaryArithTest', function() { * Tests 32-by-32 multiplication. */ it('testMul32x32', function() { - var testData = [ + const testData = [ // a b low(a*b) high(a*b) [0xc0abe2f8, 0x1607898a, 0x5de711b0, 0x109471b8], [0x915eb3cb, 0x4fb66d0e, 0xbd0d441a, 0x2d43d0bc], @@ -194,12 +184,12 @@ describe('binaryArithTest', function() { [0x0dd0bfa9, 0x916e27b1, 0x6e2542d9, 0x07d92e65] ]; - for (var i = 0; i < testData.length; i++) { - var a = testData[i][0] >>> 0; - var b = testData[i][1] >>> 0; - var cLow = testData[i][2] >>> 0; - var cHigh = testData[i][3] >>> 0; - var c = jspb.arith.UInt64.mul32x32(a, b); + for (let i = 0; i < testData.length; i++) { + const a = testData[i][0] >>> 0; + const b = testData[i][1] >>> 0; + const cLow = testData[i][2] >>> 0; + const cHigh = testData[i][3] >>> 0; + const c = jspb.arith.UInt64.mul32x32(a, b); expect(c.lo).toEqual(cLow); expect(c.hi).toEqual(cHigh); } @@ -213,7 +203,7 @@ describe('binaryArithTest', function() { // 64x32 bits produces 96 bits of product. The multiplication function under // test truncates the top 32 bits, so we compare against a 64-bit expected // product. - var testData = [ + const testData = [ // low(a) high(a) low(a*b) high(a*b) [0xec10955b, 0x360eb168, 0x4b7f3f5b, 0xbfcb7c59, 0x9517da5f], [0x42b000fc, 0x9d101642, 0x6fa1ab72, 0x2584c438, 0x6a9e6d2b], @@ -227,9 +217,9 @@ describe('binaryArithTest', function() { [0xe4f2ce21, 0x2e74b7bd, 0xd801b38b, 0xbc17feeb, 0xc6c44e0f] ]; - for (var i = 0; i < testData.length; i++) { - var a = new jspb.arith.UInt64(testData[i][0], testData[i][1]); - var prod = a.mul(testData[i][2]); + for (let i = 0; i < testData.length; i++) { + const a = new jspb.arith.UInt64(testData[i][0], testData[i][1]); + const prod = a.mul(testData[i][2]); expect(prod.lo).toEqual(testData[i][3]); expect(prod.hi).toEqual(testData[i][4]); } @@ -241,7 +231,7 @@ describe('binaryArithTest', function() { */ it('testDiv', function() { // Compute a/b, yielding quot = a/b and rem = a%b. - var testData = [ + const testData = [ // --- divisors in (0, 2^32-1) to test full divisor range // low(a) high(a) b low(quot) high(quot) rem [0x712443f1, 0xe85cefcc, 0xc1a7050b, 0x332c79ad, 0x00000001, 0x92ffa882], @@ -268,11 +258,11 @@ describe('binaryArithTest', function() { [0x7179a74c, 0x46083fff, 0x0000253c, 0x4d39ba6e, 0x0001e17f, 0x00000f84] ]; - for (var i = 0; i < testData.length; i++) { - var a = new jspb.arith.UInt64(testData[i][0], testData[i][1]); - var result = a.div(testData[i][2]); - var quotient = result[0]; - var remainder = result[1]; + for (let i = 0; i < testData.length; i++) { + const a = new jspb.arith.UInt64(testData[i][0], testData[i][1]); + const result = a.div(testData[i][2]); + const quotient = result[0]; + const remainder = result[1]; expect(quotient.lo).toEqual(testData[i][3]); expect(quotient.hi).toEqual(testData[i][4]); expect(remainder.lo).toEqual(testData[i][5]); @@ -284,32 +274,32 @@ describe('binaryArithTest', function() { * Tests .toString() and .fromString(). */ it('testStrings', function() { - var testData = [ - [0x5e84c935, 0xcae33d0e, '14619595947299359029'], - [0x62b3b8b8, 0x93480544, '10612738313170434232'], - [0x319bfb13, 0xc01c4172, '13843011313344445203'], - [0x5b8a65fb, 0xa5885b31, '11927883880638080507'], - [0x6bdb80f1, 0xb0d1b16b, '12741159895737008369'], - [0x4b82b442, 0x2e0d8c97, '3318463081876730946'], - [0x780d5208, 0x7d76752c, '9040542135845999112'], - [0x2e46800f, 0x0993778d, '690026616168284175'], - [0xf00a7e32, 0xcd8e3931, '14811839111111540274'], - [0x1baeccd6, 0x923048c4, '10533999535534820566'], - [0x03669d29, 0xbff3ab72, '13831587386756603177'], - [0x2526073e, 0x01affc81, '121593346566522686'], - [0xc24244e0, 0xd7f40d0e, '15561076969511732448'], - [0xc56a341e, 0xa68b66a7, '12000798502816461854'], - [0x8738d64d, 0xbfe78604, '13828168534871037517'], - [0x5baff03b, 0xd7572aea, '15516918227177304123'], - [0x4a843d8a, 0x864e132b, '9677693725920476554'], - [0x25b4e94d, 0x22b54dc6, '2500990681505655117'], - [0x6bbe664b, 0x55a5cc0e, '6171563226690381387'], - [0xee916c81, 0xb00aabb3, '12685140089732426881'] + const testData = [ + [0x5e84c935, 0xcae33d0e, '14619595947299359029'], + [0x62b3b8b8, 0x93480544, '10612738313170434232'], + [0x319bfb13, 0xc01c4172, '13843011313344445203'], + [0x5b8a65fb, 0xa5885b31, '11927883880638080507'], + [0x6bdb80f1, 0xb0d1b16b, '12741159895737008369'], + [0x4b82b442, 0x2e0d8c97, '3318463081876730946'], + [0x780d5208, 0x7d76752c, '9040542135845999112'], + [0x2e46800f, 0x0993778d, '690026616168284175'], + [0xf00a7e32, 0xcd8e3931, '14811839111111540274'], + [0x1baeccd6, 0x923048c4, '10533999535534820566'], + [0x03669d29, 0xbff3ab72, '13831587386756603177'], + [0x2526073e, 0x01affc81, '121593346566522686'], + [0xc24244e0, 0xd7f40d0e, '15561076969511732448'], + [0xc56a341e, 0xa68b66a7, '12000798502816461854'], + [0x8738d64d, 0xbfe78604, '13828168534871037517'], + [0x5baff03b, 0xd7572aea, '15516918227177304123'], + [0x4a843d8a, 0x864e132b, '9677693725920476554'], + [0x25b4e94d, 0x22b54dc6, '2500990681505655117'], + [0x6bbe664b, 0x55a5cc0e, '6171563226690381387'], + [0xee916c81, 0xb00aabb3, '12685140089732426881'] ]; - for (var i = 0; i < testData.length; i++) { - var a = new jspb.arith.UInt64(testData[i][0], testData[i][1]); - var roundtrip = jspb.arith.UInt64.fromString(a.toString()); + for (let i = 0; i < testData.length; i++) { + const a = new jspb.arith.UInt64(testData[i][0], testData[i][1]); + const roundtrip = jspb.arith.UInt64.fromString(a.toString()); expect(roundtrip.lo).toEqual(a.lo); expect(roundtrip.hi).toEqual(a.hi); expect(a.toString()).toEqual(testData[i][2]); @@ -322,32 +312,18 @@ describe('binaryArithTest', function() { * the explicit overrides: .toString() and .fromString(). */ it('testSignedInt64', function() { - var testStrings = [ - '-7847499644178593666', - '3771946501229139523', - '2872856549054995060', - '-5780049594274350904', - '3383785956695105201', - '2973055184857072610', - '-3879428459215627206', - '4589812431064156631', - '8484075557333689940', - '1075325817098092407', - '-4346697501012292314', - '2488620459718316637', - '6112655187423520672', - '-3655278273928612104', - '3439154019435803196', - '1004112478843763757', - '-6587790776614368413', - '664320065099714586', - '4760412909973292912', - '-7911903989602274672' + const testStrings = [ + '-7847499644178593666', '3771946501229139523', '2872856549054995060', + '-5780049594274350904', '3383785956695105201', '2973055184857072610', + '-3879428459215627206', '4589812431064156631', '8484075557333689940', + '1075325817098092407', '-4346697501012292314', '2488620459718316637', + '6112655187423520672', '-3655278273928612104', '3439154019435803196', + '1004112478843763757', '-6587790776614368413', '664320065099714586', + '4760412909973292912', '-7911903989602274672' ]; - for (var i = 0; i < testStrings.length; i++) { - var roundtrip = - jspb.arith.Int64.fromString(testStrings[i]).toString(); + for (let i = 0; i < testStrings.length; i++) { + const roundtrip = jspb.arith.Int64.fromString(testStrings[i]).toString(); expect(roundtrip).toEqual(testStrings[i]); } }); diff --git a/binary/decoder.js b/binary/decoder.js index 8f4cb3a..5c802d2 100644 --- a/binary/decoder.js +++ b/binary/decoder.js @@ -46,7 +46,7 @@ goog.provide('jspb.BinaryDecoder'); -goog.require('goog.asserts'); +goog.require('jspb.asserts'); goog.require('goog.crypt'); goog.require('jspb.utils'); @@ -145,8 +145,8 @@ jspb.BinaryDecoder.prototype.free = function() { * @return {!jspb.BinaryDecoder} */ jspb.BinaryDecoder.prototype.clone = function() { - return jspb.BinaryDecoder.alloc(this.bytes_, - this.start_, this.end_ - this.start_); + return jspb.BinaryDecoder.alloc( + this.bytes_, this.start_, this.end_ - this.start_); }; @@ -178,8 +178,7 @@ jspb.BinaryDecoder.prototype.getBuffer = function() { * @param {number=} opt_length The optional length of the block to read - * we'll throw an assertion if we go off the end of the block. */ -jspb.BinaryDecoder.prototype.setBlock = - function(data, opt_start, opt_length) { +jspb.BinaryDecoder.prototype.setBlock = function(data, opt_start, opt_length) { this.bytes_ = jspb.utils.byteSourceToUint8Array(data); this.start_ = (opt_start !== undefined) ? opt_start : 0; this.end_ = (opt_length !== undefined) ? this.start_ + opt_length : @@ -236,7 +235,7 @@ jspb.BinaryDecoder.prototype.setCursor = function(cursor) { */ jspb.BinaryDecoder.prototype.advance = function(count) { this.cursor_ += count; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); }; @@ -263,9 +262,7 @@ jspb.BinaryDecoder.prototype.pastEnd = function() { * @return {boolean} */ jspb.BinaryDecoder.prototype.getError = function() { - return this.error_ || - (this.cursor_ < 0) || - (this.cursor_ > this.end_); + return this.error_ || (this.cursor_ < 0) || (this.cursor_ > this.end_); }; @@ -319,7 +316,7 @@ jspb.BinaryDecoder.prototype.readSplitVarint64 = function(convert) { } // If we did not see the terminator, the encoding was invalid. - goog.asserts.fail('Failed to read varint, encoding is invalid.'); + jspb.asserts.jspbFail('Failed to read varint, encoding is invalid.'); this.error_ = true; }; @@ -425,7 +422,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { var x = (temp & 0x7F); if (temp < 128) { this.cursor_ += 1; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return x; } @@ -433,7 +430,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { x |= (temp & 0x7F) << 7; if (temp < 128) { this.cursor_ += 2; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return x; } @@ -441,7 +438,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { x |= (temp & 0x7F) << 14; if (temp < 128) { this.cursor_ += 3; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return x; } @@ -449,7 +446,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { x |= (temp & 0x7F) << 21; if (temp < 128) { this.cursor_ += 4; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return x; } @@ -459,23 +456,21 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { // We're reading the high bits of an unsigned varint. The byte we just read // also contains bits 33 through 35, which we're going to discard. this.cursor_ += 5; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return x >>> 0; } // If we get here, we need to truncate coming bytes. However we need to make // sure cursor place is correct. this.cursor_ += 5; - if (bytes[this.cursor_++] >= 128 && - bytes[this.cursor_++] >= 128 && - bytes[this.cursor_++] >= 128 && - bytes[this.cursor_++] >= 128 && + if (bytes[this.cursor_++] >= 128 && bytes[this.cursor_++] >= 128 && + bytes[this.cursor_++] >= 128 && bytes[this.cursor_++] >= 128 && bytes[this.cursor_++] >= 128) { // If we get here, the varint is too long. - goog.asserts.assert(false); + jspb.asserts.jspbAssert(false); } - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return x; }; @@ -485,19 +480,21 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { * * @return {number} The decoded signed 32-bit varint. */ -jspb.BinaryDecoder.prototype.readSignedVarint32 = function() { - // The `~` operator coerces to int32, and `~~` is the shortest expression of a cast. - // This has some edge cases (e.g. NaN becomes 0) but should be okay here. +jspb.BinaryDecoder.prototype.readSignedVarint32 = + function() { + // The `~` operator coerces to int32, and `~~` is the shortest expression of a + // cast. This has some edge cases (e.g. NaN becomes 0) but should be okay + // here. return ~~(this.readUnsignedVarint32()); } -/** - * Reads a 32-bit unsigned variant and returns its value as a string. - * - * @return {string} The decoded unsigned 32-bit varint as a string. - */ -jspb.BinaryDecoder.prototype.readUnsignedVarint32String = function() { + /** + * Reads a 32-bit unsigned variant and returns its value as a string. + * + * @return {string} The decoded unsigned 32-bit varint as a string. + */ + jspb.BinaryDecoder.prototype.readUnsignedVarint32String = function() { // 32-bit integers fit in JavaScript numbers without loss of precision, so // string variants of 32-bit varint readers can simply delegate then convert // to string. @@ -531,7 +528,7 @@ jspb.BinaryDecoder.prototype.readSignedVarint32String = function() { */ jspb.BinaryDecoder.prototype.readZigzagVarint32 = function() { var result = this.readUnsignedVarint32(); - return (result >>> 1) ^ - (result & 1); + return (result >>> 1) ^ -(result & 1); }; @@ -641,7 +638,7 @@ jspb.BinaryDecoder.prototype.readZigzagVarint64String = function() { jspb.BinaryDecoder.prototype.readUint8 = function() { var a = this.bytes_[this.cursor_ + 0]; this.cursor_ += 1; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return a; }; @@ -655,7 +652,7 @@ jspb.BinaryDecoder.prototype.readUint16 = function() { var a = this.bytes_[this.cursor_ + 0]; var b = this.bytes_[this.cursor_ + 1]; this.cursor_ += 2; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return (a << 0) | (b << 8); }; @@ -671,7 +668,7 @@ jspb.BinaryDecoder.prototype.readUint32 = function() { var c = this.bytes_[this.cursor_ + 2]; var d = this.bytes_[this.cursor_ + 3]; this.cursor_ += 4; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return ((a << 0) | (b << 8) | (c << 16) | (d << 24)) >>> 0; }; @@ -713,7 +710,7 @@ jspb.BinaryDecoder.prototype.readUint64String = function() { jspb.BinaryDecoder.prototype.readInt8 = function() { var a = this.bytes_[this.cursor_ + 0]; this.cursor_ += 1; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return (a << 24) >> 24; }; @@ -727,7 +724,7 @@ jspb.BinaryDecoder.prototype.readInt16 = function() { var a = this.bytes_[this.cursor_ + 0]; var b = this.bytes_[this.cursor_ + 1]; this.cursor_ += 2; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return (((a << 0) | (b << 8)) << 16) >> 16; }; @@ -743,7 +740,7 @@ jspb.BinaryDecoder.prototype.readInt32 = function() { var c = this.bytes_[this.cursor_ + 2]; var d = this.bytes_[this.cursor_ + 3]; this.cursor_ += 4; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return (a << 0) | (b << 8) | (c << 16) | (d << 24); }; @@ -839,27 +836,28 @@ jspb.BinaryDecoder.prototype.readString = function(length) { var result = ''; while (cursor < end) { var c = bytes[cursor++]; - if (c < 128) { // Regular 7-bit ASCII. + if (c < 128) { // Regular 7-bit ASCII. codeUnits.push(c); } else if (c < 192) { // UTF-8 continuation mark. We are out of sync. This // might happen if we attempted to read a character // with more than four bytes. continue; - } else if (c < 224) { // UTF-8 with two bytes. + } else if (c < 224) { // UTF-8 with two bytes. var c2 = bytes[cursor++]; codeUnits.push(((c & 31) << 6) | (c2 & 63)); - } else if (c < 240) { // UTF-8 with three bytes. + } else if (c < 240) { // UTF-8 with three bytes. var c2 = bytes[cursor++]; var c3 = bytes[cursor++]; codeUnits.push(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - } else if (c < 248) { // UTF-8 with 4 bytes. + } else if (c < 248) { // UTF-8 with 4 bytes. var c2 = bytes[cursor++]; var c3 = bytes[cursor++]; var c4 = bytes[cursor++]; // Characters written on 4 bytes have 21 bits for a codepoint. // We can't fit that on 16bit characters, so we use surrogates. - var codepoint = ((c & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63); + var codepoint = + ((c & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63); // Surrogates formula from wikipedia. // 1. Subtract 0x10000 from codepoint codepoint -= 0x10000; @@ -902,17 +900,16 @@ jspb.BinaryDecoder.prototype.readStringWithLength = function() { * length was invalid. */ jspb.BinaryDecoder.prototype.readBytes = function(length) { - if (length < 0 || - this.cursor_ + length > this.bytes_.length) { + if (length < 0 || this.cursor_ + length > this.bytes_.length) { this.error_ = true; - goog.asserts.fail('Invalid byte length!'); + jspb.asserts.jspbFail('Invalid byte length!'); return new Uint8Array(0); } var result = this.bytes_.subarray(this.cursor_, this.cursor_ + length); this.cursor_ += length; - goog.asserts.assert(this.cursor_ <= this.end_); + jspb.asserts.jspbAssert(this.cursor_ <= this.end_); return result; }; diff --git a/binary/decoder_test.js b/binary/decoder_test.js index f97518e..e00ffe1 100644 --- a/binary/decoder_test.js +++ b/binary/decoder_test.js @@ -41,10 +41,10 @@ * @author aappleby@google.com (Austin Appleby) */ -goog.require('goog.testing.asserts'); goog.require('jspb.BinaryConstants'); goog.require('jspb.BinaryDecoder'); goog.require('jspb.BinaryEncoder'); + goog.require('jspb.utils'); @@ -57,9 +57,9 @@ goog.require('jspb.utils'); * @param {Function} filter * @suppress {missingProperties|visibility} */ -function doTestUnsignedValue(readValue, - writeValue, epsilon, upperLimit, filter) { - var encoder = new jspb.BinaryEncoder(); +function doTestUnsignedValue( + readValue, writeValue, epsilon, upperLimit, filter) { + const encoder = new jspb.BinaryEncoder(); // Encode zero and limits. writeValue.call(encoder, filter(0)); @@ -67,25 +67,29 @@ function doTestUnsignedValue(readValue, writeValue.call(encoder, filter(upperLimit)); // Encode positive values. - for (var cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { + for (let cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { writeValue.call(encoder, filter(cursor)); } - var decoder = jspb.BinaryDecoder.alloc(encoder.end()); + const decoder = jspb.BinaryDecoder.alloc(encoder.end()); // Check zero and limits. - assertEquals(filter(0), readValue.call(decoder)); - assertEquals(filter(epsilon), readValue.call(decoder)); - assertEquals(filter(upperLimit), readValue.call(decoder)); + expect(readValue.call(decoder)).toEqual(filter(0)); + expect(readValue.call(decoder)).toEqual(filter(epsilon)); + expect(readValue.call(decoder)).toEqual(filter(upperLimit)); // Check positive values. - for (var cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { + for (let cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { if (filter(cursor) != readValue.call(decoder)) throw 'fail!'; } // Encoding values outside the valid range should assert. - assertThrows(function() {writeValue.call(encoder, -1);}); - assertThrows(function() {writeValue.call(encoder, upperLimit * 1.1);}); + expect(function() { + writeValue.call(encoder, -1); + }).toThrow(); + expect(function() { + writeValue.call(encoder, upperLimit * 1.1); + }).toThrow(); } @@ -99,9 +103,9 @@ function doTestUnsignedValue(readValue, * @param {Function} filter * @suppress {missingProperties} */ -function doTestSignedValue(readValue, - writeValue, epsilon, lowerLimit, upperLimit, filter) { - var encoder = new jspb.BinaryEncoder(); +function doTestSignedValue( + readValue, writeValue, epsilon, lowerLimit, upperLimit, filter) { + const encoder = new jspb.BinaryEncoder(); // Encode zero and limits. writeValue.call(encoder, filter(lowerLimit)); @@ -110,39 +114,39 @@ function doTestSignedValue(readValue, writeValue.call(encoder, filter(epsilon)); writeValue.call(encoder, filter(upperLimit)); - var inputValues = []; + const inputValues = []; // Encode negative values. - for (var cursor = lowerLimit; cursor < -epsilon; cursor /= 1.1) { - var val = filter(cursor); + for (let cursor = lowerLimit; cursor < -epsilon; cursor /= 1.1) { + let val = filter(cursor); writeValue.call(encoder, val); inputValues.push(val); } // Encode positive values. - for (var cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { - var val = filter(cursor); + for (let cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { + const val = filter(cursor); writeValue.call(encoder, val); inputValues.push(val); } - var decoder = jspb.BinaryDecoder.alloc(encoder.end()); + const decoder = jspb.BinaryDecoder.alloc(encoder.end()); // Check zero and limits. - assertEquals(filter(lowerLimit), readValue.call(decoder)); - assertEquals(filter(-epsilon), readValue.call(decoder)); - assertEquals(filter(0), readValue.call(decoder)); - assertEquals(filter(epsilon), readValue.call(decoder)); - assertEquals(filter(upperLimit), readValue.call(decoder)); + expect(readValue.call(decoder)).toEqual(filter(lowerLimit)); + expect(readValue.call(decoder)).toEqual(filter(-epsilon)); + expect(readValue.call(decoder)).toEqual(filter(0)); + expect(readValue.call(decoder)).toEqual(filter(epsilon)); + expect(readValue.call(decoder)).toEqual(filter(upperLimit)); // Verify decoded values. - for (var i = 0; i < inputValues.length; i++) { - assertEquals(inputValues[i], readValue.call(decoder)); + for (let i = 0; i < inputValues.length; i++) { + expect(readValue.call(decoder)).toEqual(inputValues[i]); } // Encoding values outside the valid range should assert. - var pastLowerLimit = lowerLimit * 1.1; - var pastUpperLimit = upperLimit * 1.1; + const pastLowerLimit = lowerLimit * 1.1; + const pastUpperLimit = upperLimit * 1.1; if (pastLowerLimit !== -Infinity) { expect(() => void writeValue.call(encoder, pastLowerLimit)).toThrow(); } @@ -163,34 +167,34 @@ describe('binaryDecoderTest', function() { // cache. jspb.BinaryDecoder.alloc().free(); - assertEquals(1, jspb.BinaryDecoder.instanceCache_.length); + expect(jspb.BinaryDecoder.instanceCache_.length).toEqual(1); // Allocating and then freeing three decoders should leave us with three in // the cache. - var decoder1 = jspb.BinaryDecoder.alloc(); - var decoder2 = jspb.BinaryDecoder.alloc(); - var decoder3 = jspb.BinaryDecoder.alloc(); + const decoder1 = jspb.BinaryDecoder.alloc(); + const decoder2 = jspb.BinaryDecoder.alloc(); + const decoder3 = jspb.BinaryDecoder.alloc(); decoder1.free(); decoder2.free(); decoder3.free(); - assertEquals(3, jspb.BinaryDecoder.instanceCache_.length); + expect(jspb.BinaryDecoder.instanceCache_.length).toEqual(3); }); describe('varint64', function() { - var /** !jspb.BinaryEncoder */ encoder; - var /** !jspb.BinaryDecoder */ decoder; - - var hashA = String.fromCharCode(0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00); - var hashB = String.fromCharCode(0x12, 0x34, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00); - var hashC = String.fromCharCode(0x12, 0x34, 0x56, 0x78, - 0x87, 0x65, 0x43, 0x21); - var hashD = String.fromCharCode(0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF); + let /** !jspb.BinaryEncoder */ encoder; + let /** !jspb.BinaryDecoder */ decoder; + + const hashA = + String.fromCharCode(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + const hashB = + String.fromCharCode(0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + const hashC = + String.fromCharCode(0x12, 0x34, 0x56, 0x78, 0x87, 0x65, 0x43, 0x21); + const hashD = + String.fromCharCode(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); beforeEach(function() { encoder = new jspb.BinaryEncoder(); @@ -208,15 +212,15 @@ describe('binaryDecoderTest', function() { }); it('reads 64-bit integers as hash strings', function() { - assertEquals(hashA, decoder.readVarintHash64()); - assertEquals(hashB, decoder.readVarintHash64()); - assertEquals(hashC, decoder.readVarintHash64()); - assertEquals(hashD, decoder.readVarintHash64()); - - assertEquals(hashA, decoder.readFixedHash64()); - assertEquals(hashB, decoder.readFixedHash64()); - assertEquals(hashC, decoder.readFixedHash64()); - assertEquals(hashD, decoder.readFixedHash64()); + expect(hashA).toEqual(decoder.readVarintHash64()); + expect(hashB).toEqual(decoder.readVarintHash64()); + expect(hashC).toEqual(decoder.readVarintHash64()); + expect(hashD).toEqual(decoder.readVarintHash64()); + + expect(hashA).toEqual(decoder.readFixedHash64()); + expect(hashB).toEqual(decoder.readFixedHash64()); + expect(hashC).toEqual(decoder.readFixedHash64()); + expect(hashD).toEqual(decoder.readFixedHash64()); }); it('reads split 64 bit integers', function() { @@ -242,18 +246,18 @@ describe('binaryDecoderTest', function() { }); describe('sint64', function() { - var /** !jspb.BinaryDecoder */ decoder; + let /** !jspb.BinaryDecoder */ decoder; - var hashA = + const hashA = String.fromCharCode(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - var hashB = + const hashB = String.fromCharCode(0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - var hashC = + const hashC = String.fromCharCode(0x12, 0x34, 0x56, 0x78, 0x87, 0x65, 0x43, 0x21); - var hashD = + const hashD = String.fromCharCode(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); beforeEach(function() { - var encoder = new jspb.BinaryEncoder(); + const encoder = new jspb.BinaryEncoder(); encoder.writeZigzagVarintHash64(hashA); encoder.writeZigzagVarintHash64(hashB); @@ -305,7 +309,7 @@ describe('binaryDecoderTest', function() { it('does zigzag encoding properly', function() { // Test cases directly from the protobuf dev guide. // https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types - var testCases = [ + const testCases = [ {original: '0', zigzag: '0'}, {original: '-1', zigzag: '1'}, {original: '1', zigzag: '2'}, @@ -319,13 +323,13 @@ describe('binaryDecoderTest', function() { // 0x1FFFFF. The following used to be broken. {original: '72000000000', zigzag: '144000000000'}, ]; - var encoder = new jspb.BinaryEncoder(); + const encoder = new jspb.BinaryEncoder(); testCases.forEach(function(c) { encoder.writeZigzagVarint64String(c.original); }); - var buffer = encoder.end(); - var zigzagDecoder = jspb.BinaryDecoder.alloc(buffer); - var varintDecoder = jspb.BinaryDecoder.alloc(buffer); + const buffer = encoder.end(); + const zigzagDecoder = jspb.BinaryDecoder.alloc(buffer); + const varintDecoder = jspb.BinaryDecoder.alloc(buffer); testCases.forEach(function(c) { expect(zigzagDecoder.readZigzagVarint64String()).toEqual(c.original); expect(varintDecoder.readUnsignedVarint64String()).toEqual(c.zigzag); @@ -337,53 +341,58 @@ describe('binaryDecoderTest', function() { * Tests reading and writing large strings */ it('testLargeStrings', function() { - var encoder = new jspb.BinaryEncoder(); + const encoder = new jspb.BinaryEncoder(); - var len = 150000; - var long_string = ''; - for (var i = 0; i < len; i++) { + const len = 150000; + let long_string = ''; + for (let i = 0; i < len; i++) { long_string += 'a'; } encoder.writeString(long_string); - var decoder = jspb.BinaryDecoder.alloc(encoder.end()); + const decoder = jspb.BinaryDecoder.alloc(encoder.end()); - assertEquals(long_string, decoder.readString(len)); + expect(decoder.readString(len)).toEqual(long_string); }); /** * Test encoding and decoding utf-8. */ - it('testUtf8', function() { - var encoder = new jspb.BinaryEncoder(); + it('testUtf8', function() { + const encoder = new jspb.BinaryEncoder(); - var ascii = "ASCII should work in 3, 2, 1..."; - var utf8_two_bytes = "©"; - var utf8_three_bytes = "❄"; - var utf8_four_bytes = "😁"; + const ascii = 'ASCII should work in 3, 2, 1...'; + const utf8_two_bytes = '©'; + const utf8_three_bytes = '❄'; + const utf8_four_bytes = '😁'; encoder.writeString(ascii); encoder.writeString(utf8_two_bytes); encoder.writeString(utf8_three_bytes); encoder.writeString(utf8_four_bytes); - var decoder = jspb.BinaryDecoder.alloc(encoder.end()); + const decoder = jspb.BinaryDecoder.alloc(encoder.end()); - assertEquals(ascii, decoder.readString(ascii.length)); - assertEquals(utf8_two_bytes, decoder.readString(utf8_two_bytes.length)); - assertEquals(utf8_three_bytes, decoder.readString(utf8_three_bytes.length)); - assertEquals(utf8_four_bytes, decoder.readString(utf8_four_bytes.length)); - }); + expect(decoder.readString(ascii.length)).toEqual(ascii); + expect(utf8_two_bytes).toEqual(decoder.readString(utf8_two_bytes.length)); + expect(utf8_three_bytes) + .toEqual(decoder.readString(utf8_three_bytes.length)); + expect(utf8_four_bytes).toEqual(decoder.readString(utf8_four_bytes.length)); + }); /** * Verifies that passing a non-string to writeString raises an error. */ it('testBadString', function() { - var encoder = new jspb.BinaryEncoder(); - - assertThrows(function() {encoder.writeString(42)}); - assertThrows(function() {encoder.writeString(null)}); + const encoder = new jspb.BinaryEncoder(); + + expect(function() { + encoder.writeString(42) + }).toThrow(); + expect(function() { + encoder.writeString(null) + }).toThrow(); }); /** @@ -391,19 +400,29 @@ describe('binaryDecoderTest', function() { */ it('testDecodeErrors', function() { // Reading a value past the end of the stream should trigger an assertion. - var decoder = jspb.BinaryDecoder.alloc([0, 1, 2]); - assertThrows(function() {decoder.readUint64()}); + const decoder = jspb.BinaryDecoder.alloc([0, 1, 2]); + expect(function() { + decoder.readUint64() + }).toThrow(); // Overlong varints should trigger assertions. - decoder.setBlock([255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 0]); - assertThrows(function() {decoder.readUnsignedVarint64()}); + decoder.setBlock( + [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0]); + expect(function() { + decoder.readUnsignedVarint64() + }).toThrow(); decoder.reset(); - assertThrows(function() {decoder.readSignedVarint64()}); + expect(function() { + decoder.readSignedVarint64() + }).toThrow(); decoder.reset(); - assertThrows(function() {decoder.readZigzagVarint64()}); + expect(function() { + decoder.readZigzagVarint64() + }).toThrow(); decoder.reset(); - assertThrows(function() {decoder.readUnsignedVarint32()}); + expect(function() { + decoder.readUnsignedVarint32() + }).toThrow(); }); @@ -413,33 +432,30 @@ describe('binaryDecoderTest', function() { it('testUnsignedIntegers', function() { doTestUnsignedValue( jspb.BinaryDecoder.prototype.readUint8, - jspb.BinaryEncoder.prototype.writeUint8, - 1, 0xFF, Math.round); + jspb.BinaryEncoder.prototype.writeUint8, 1, 0xFF, Math.round); doTestUnsignedValue( jspb.BinaryDecoder.prototype.readUint16, - jspb.BinaryEncoder.prototype.writeUint16, - 1, 0xFFFF, Math.round); + jspb.BinaryEncoder.prototype.writeUint16, 1, 0xFFFF, Math.round); doTestUnsignedValue( jspb.BinaryDecoder.prototype.readUint32, - jspb.BinaryEncoder.prototype.writeUint32, - 1, 0xFFFFFFFF, Math.round); + jspb.BinaryEncoder.prototype.writeUint32, 1, 0xFFFFFFFF, Math.round); doTestUnsignedValue( - jspb.BinaryDecoder.prototype.readUnsignedVarint32, - jspb.BinaryEncoder.prototype.writeUnsignedVarint32, - 1, 0xFFFFFFFF, Math.round); - + jspb.BinaryDecoder.prototype.readUnsignedVarint32, + jspb.BinaryEncoder.prototype.writeUnsignedVarint32, 1, 0xFFFFFFFF, + Math.round); + doTestUnsignedValue( jspb.BinaryDecoder.prototype.readUint64, - jspb.BinaryEncoder.prototype.writeUint64, - 1, Math.pow(2, 64) - 1025, Math.round); + jspb.BinaryEncoder.prototype.writeUint64, 1, Math.pow(2, 64) - 1025, + Math.round); doTestUnsignedValue( - jspb.BinaryDecoder.prototype.readUnsignedVarint64, - jspb.BinaryEncoder.prototype.writeUnsignedVarint64, - 1, Math.pow(2, 64) - 1025, Math.round); + jspb.BinaryDecoder.prototype.readUnsignedVarint64, + jspb.BinaryEncoder.prototype.writeUnsignedVarint64, 1, + Math.pow(2, 64) - 1025, Math.round); }); @@ -449,33 +465,32 @@ describe('binaryDecoderTest', function() { it('testSignedIntegers', function() { doTestSignedValue( jspb.BinaryDecoder.prototype.readInt8, - jspb.BinaryEncoder.prototype.writeInt8, - 1, -0x80, 0x7F, Math.round); + jspb.BinaryEncoder.prototype.writeInt8, 1, -0x80, 0x7F, Math.round); doTestSignedValue( jspb.BinaryDecoder.prototype.readInt16, - jspb.BinaryEncoder.prototype.writeInt16, - 1, -0x8000, 0x7FFF, Math.round); + jspb.BinaryEncoder.prototype.writeInt16, 1, -0x8000, 0x7FFF, + Math.round); doTestSignedValue( jspb.BinaryDecoder.prototype.readInt32, - jspb.BinaryEncoder.prototype.writeInt32, - 1, -0x80000000, 0x7FFFFFFF, Math.round); + jspb.BinaryEncoder.prototype.writeInt32, 1, -0x80000000, 0x7FFFFFFF, + Math.round); doTestSignedValue( - jspb.BinaryDecoder.prototype.readSignedVarint32, - jspb.BinaryEncoder.prototype.writeSignedVarint32, - 1, -0x80000000, 0x7FFFFFFF, Math.round); + jspb.BinaryDecoder.prototype.readSignedVarint32, + jspb.BinaryEncoder.prototype.writeSignedVarint32, 1, -0x80000000, + 0x7FFFFFFF, Math.round); doTestSignedValue( jspb.BinaryDecoder.prototype.readInt64, - jspb.BinaryEncoder.prototype.writeInt64, - 1, -Math.pow(2, 63), Math.pow(2, 63) - 513, Math.round); + jspb.BinaryEncoder.prototype.writeInt64, 1, -Math.pow(2, 63), + Math.pow(2, 63) - 513, Math.round); doTestSignedValue( - jspb.BinaryDecoder.prototype.readSignedVarint64, - jspb.BinaryEncoder.prototype.writeSignedVarint64, - 1, -Math.pow(2, 63), Math.pow(2, 63) - 513, Math.round); + jspb.BinaryDecoder.prototype.readSignedVarint64, + jspb.BinaryEncoder.prototype.writeSignedVarint64, 1, -Math.pow(2, 63), + Math.pow(2, 63) - 513, Math.round); }); @@ -488,24 +503,23 @@ describe('binaryDecoderTest', function() { * @return {number} */ function truncate(x) { - var temp = new Float32Array(1); + const temp = new Float32Array(1); temp[0] = x; return temp[0]; } doTestSignedValue( jspb.BinaryDecoder.prototype.readFloat, jspb.BinaryEncoder.prototype.writeFloat, - jspb.BinaryConstants.FLOAT32_EPS, - -jspb.BinaryConstants.FLOAT32_MAX, - jspb.BinaryConstants.FLOAT32_MAX, - truncate); + jspb.BinaryConstants.FLOAT32_EPS, -jspb.BinaryConstants.FLOAT32_MAX, + jspb.BinaryConstants.FLOAT32_MAX, truncate); doTestSignedValue( jspb.BinaryDecoder.prototype.readDouble, jspb.BinaryEncoder.prototype.writeDouble, jspb.BinaryConstants.FLOAT64_EPS * 10, - -jspb.BinaryConstants.FLOAT64_MAX, - jspb.BinaryConstants.FLOAT64_MAX, - function(x) { return x; }); + -jspb.BinaryConstants.FLOAT64_MAX, jspb.BinaryConstants.FLOAT64_MAX, + function(x) { + return x; + }); }); }); diff --git a/binary/encoder.js b/binary/encoder.js index de08748..7822db2 100644 --- a/binary/encoder.js +++ b/binary/encoder.js @@ -37,7 +37,7 @@ goog.provide('jspb.BinaryEncoder'); -goog.require('goog.asserts'); +goog.require('jspb.asserts'); goog.require('jspb.BinaryConstants'); goog.require('jspb.utils'); @@ -81,12 +81,12 @@ jspb.BinaryEncoder.prototype.end = function() { * @param {number} highBits The high 32 bits of the int. */ jspb.BinaryEncoder.prototype.writeSplitVarint64 = function(lowBits, highBits) { - goog.asserts.assert(lowBits == Math.floor(lowBits)); - goog.asserts.assert(highBits == Math.floor(highBits)); - goog.asserts.assert((lowBits >= 0) && - (lowBits < jspb.BinaryConstants.TWO_TO_32)); - goog.asserts.assert((highBits >= 0) && - (highBits < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert(lowBits == Math.floor(lowBits)); + jspb.asserts.jspbAssert(highBits == Math.floor(highBits)); + jspb.asserts.jspbAssert( + (lowBits >= 0) && (lowBits < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert( + (highBits >= 0) && (highBits < jspb.BinaryConstants.TWO_TO_32)); // Break the binary representation into chunks of 7 bits, set the 8th bit // in each chunk if it's not the final chunk, and append to the result. @@ -106,12 +106,12 @@ jspb.BinaryEncoder.prototype.writeSplitVarint64 = function(lowBits, highBits) { * @param {number} highBits The high 32 bits of the int. */ jspb.BinaryEncoder.prototype.writeSplitFixed64 = function(lowBits, highBits) { - goog.asserts.assert(lowBits == Math.floor(lowBits)); - goog.asserts.assert(highBits == Math.floor(highBits)); - goog.asserts.assert((lowBits >= 0) && - (lowBits < jspb.BinaryConstants.TWO_TO_32)); - goog.asserts.assert((highBits >= 0) && - (highBits < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert(lowBits == Math.floor(lowBits)); + jspb.asserts.jspbAssert(highBits == Math.floor(highBits)); + jspb.asserts.jspbAssert( + (lowBits >= 0) && (lowBits < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert( + (highBits >= 0) && (highBits < jspb.BinaryConstants.TWO_TO_32)); this.writeUint32(lowBits); this.writeUint32(highBits); }; @@ -123,9 +123,9 @@ jspb.BinaryEncoder.prototype.writeSplitFixed64 = function(lowBits, highBits) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeUnsignedVarint32 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= 0) && - (value < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_32)); while (value > 127) { this.buffer_.push((value & 0x7f) | 0x80); @@ -142,9 +142,10 @@ jspb.BinaryEncoder.prototype.writeUnsignedVarint32 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeSignedVarint32 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_31) && - (value < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_31) && + (value < jspb.BinaryConstants.TWO_TO_31)); // Use the unsigned version if the value is not negative. if (value >= 0) { @@ -171,12 +172,11 @@ jspb.BinaryEncoder.prototype.writeSignedVarint32 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeUnsignedVarint64 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= 0) && - (value < jspb.BinaryConstants.TWO_TO_64)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_64)); jspb.utils.splitInt64(value); - this.writeSplitVarint64(jspb.utils.split64Low, - jspb.utils.split64High); + this.writeSplitVarint64(jspb.utils.split64Low, jspb.utils.split64High); }; @@ -187,12 +187,12 @@ jspb.BinaryEncoder.prototype.writeUnsignedVarint64 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeSignedVarint64 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_63) && - (value < jspb.BinaryConstants.TWO_TO_63)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_63) && + (value < jspb.BinaryConstants.TWO_TO_63)); jspb.utils.splitInt64(value); - this.writeSplitVarint64(jspb.utils.split64Low, - jspb.utils.split64High); + this.writeSplitVarint64(jspb.utils.split64Low, jspb.utils.split64High); }; @@ -202,9 +202,10 @@ jspb.BinaryEncoder.prototype.writeSignedVarint64 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeZigzagVarint32 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_31) && - (value < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_31) && + (value < jspb.BinaryConstants.TWO_TO_31)); this.writeUnsignedVarint32(((value << 1) ^ (value >> 31)) >>> 0); }; @@ -216,12 +217,12 @@ jspb.BinaryEncoder.prototype.writeZigzagVarint32 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeZigzagVarint64 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_63) && - (value < jspb.BinaryConstants.TWO_TO_63)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_63) && + (value < jspb.BinaryConstants.TWO_TO_63)); jspb.utils.splitZigzag64(value); - this.writeSplitVarint64(jspb.utils.split64Low, - jspb.utils.split64High); + this.writeSplitVarint64(jspb.utils.split64Low, jspb.utils.split64High); }; @@ -257,8 +258,8 @@ jspb.BinaryEncoder.prototype.writeZigzagVarintHash64 = function(hash) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeUint8 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= 0) && (value < 256)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert((value >= 0) && (value < 256)); this.buffer_.push((value >>> 0) & 0xFF); }; @@ -269,8 +270,8 @@ jspb.BinaryEncoder.prototype.writeUint8 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeUint16 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= 0) && (value < 65536)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert((value >= 0) && (value < 65536)); this.buffer_.push((value >>> 0) & 0xFF); this.buffer_.push((value >>> 8) & 0xFF); }; @@ -282,9 +283,9 @@ jspb.BinaryEncoder.prototype.writeUint16 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeUint32 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= 0) && - (value < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_32)); this.buffer_.push((value >>> 0) & 0xFF); this.buffer_.push((value >>> 8) & 0xFF); this.buffer_.push((value >>> 16) & 0xFF); @@ -298,9 +299,9 @@ jspb.BinaryEncoder.prototype.writeUint32 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeUint64 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= 0) && - (value < jspb.BinaryConstants.TWO_TO_64)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_64)); jspb.utils.splitUint64(value); this.writeUint32(jspb.utils.split64Low); this.writeUint32(jspb.utils.split64High); @@ -313,8 +314,8 @@ jspb.BinaryEncoder.prototype.writeUint64 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt8 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -128) && (value < 128)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert((value >= -128) && (value < 128)); this.buffer_.push((value >>> 0) & 0xFF); }; @@ -325,8 +326,8 @@ jspb.BinaryEncoder.prototype.writeInt8 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt16 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -32768) && (value < 32768)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert((value >= -32768) && (value < 32768)); this.buffer_.push((value >>> 0) & 0xFF); this.buffer_.push((value >>> 8) & 0xFF); }; @@ -338,9 +339,10 @@ jspb.BinaryEncoder.prototype.writeInt16 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt32 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_31) && - (value < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_31) && + (value < jspb.BinaryConstants.TWO_TO_31)); this.buffer_.push((value >>> 0) & 0xFF); this.buffer_.push((value >>> 8) & 0xFF); this.buffer_.push((value >>> 16) & 0xFF); @@ -354,9 +356,10 @@ jspb.BinaryEncoder.prototype.writeInt32 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt64 = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_63) && - (value < jspb.BinaryConstants.TWO_TO_63)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_63) && + (value < jspb.BinaryConstants.TWO_TO_63)); jspb.utils.splitInt64(value); this.writeSplitFixed64(jspb.utils.split64Low, jspb.utils.split64High); }; @@ -368,9 +371,10 @@ jspb.BinaryEncoder.prototype.writeInt64 = function(value) { * @param {string} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt64String = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((+value >= -jspb.BinaryConstants.TWO_TO_63) && - (+value < jspb.BinaryConstants.TWO_TO_63)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (+value >= -jspb.BinaryConstants.TWO_TO_63) && + (+value < jspb.BinaryConstants.TWO_TO_63)); jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(value)); this.writeSplitFixed64(jspb.utils.split64Low, jspb.utils.split64High); }; @@ -382,7 +386,7 @@ jspb.BinaryEncoder.prototype.writeInt64String = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeFloat = function(value) { - goog.asserts.assert( + jspb.asserts.jspbAssert( value === Infinity || value === -Infinity || isNaN(value) || ((value >= -jspb.BinaryConstants.FLOAT32_MAX) && (value <= jspb.BinaryConstants.FLOAT32_MAX))); @@ -397,7 +401,7 @@ jspb.BinaryEncoder.prototype.writeFloat = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeDouble = function(value) { - goog.asserts.assert( + jspb.asserts.jspbAssert( value === Infinity || value === -Infinity || isNaN(value) || ((value >= -jspb.BinaryConstants.FLOAT64_MAX) && (value <= jspb.BinaryConstants.FLOAT64_MAX))); @@ -414,7 +418,8 @@ jspb.BinaryEncoder.prototype.writeDouble = function(value) { * @param {boolean|number} value The value to write. */ jspb.BinaryEncoder.prototype.writeBool = function(value) { - goog.asserts.assert(typeof value === 'boolean' || typeof value === 'number'); + jspb.asserts.jspbAssert( + typeof value === 'boolean' || typeof value === 'number'); this.buffer_.push(value ? 1 : 0); }; @@ -424,9 +429,10 @@ jspb.BinaryEncoder.prototype.writeBool = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeEnum = function(value) { - goog.asserts.assert(value == Math.floor(value)); - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_31) && - (value < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert(value == Math.floor(value)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_31) && + (value < jspb.BinaryConstants.TWO_TO_31)); this.writeSignedVarint32(value); }; @@ -447,8 +453,7 @@ jspb.BinaryEncoder.prototype.writeBytes = function(bytes) { */ jspb.BinaryEncoder.prototype.writeVarintHash64 = function(hash) { jspb.utils.splitHash64(hash); - this.writeSplitVarint64(jspb.utils.split64Low, - jspb.utils.split64High); + this.writeSplitVarint64(jspb.utils.split64Low, jspb.utils.split64High); }; @@ -474,10 +479,9 @@ jspb.BinaryEncoder.prototype.writeString = function(value) { var oldLength = this.buffer_.length; // Protect against non-string values being silently ignored. - goog.asserts.assertString(value); + jspb.asserts.jspbAssertString(value); for (var i = 0; i < value.length; i++) { - var c = value.charCodeAt(i); if (c < 128) { @@ -489,18 +493,17 @@ jspb.BinaryEncoder.prototype.writeString = function(value) { // Look for surrogates if (c >= 0xD800 && c <= 0xDBFF && i + 1 < value.length) { var second = value.charCodeAt(i + 1); - if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate + if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae c = (c - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; this.buffer_.push((c >> 18) | 240); - this.buffer_.push(((c >> 12) & 63 ) | 128); + this.buffer_.push(((c >> 12) & 63) | 128); this.buffer_.push(((c >> 6) & 63) | 128); this.buffer_.push((c & 63) | 128); i++; } - } - else { + } else { this.buffer_.push((c >> 12) | 224); this.buffer_.push(((c >> 6) & 63) | 128); this.buffer_.push((c & 63) | 128); diff --git a/binary/message_test.js b/binary/message_test.js index 4edc666..5489dd7 100644 --- a/binary/message_test.js +++ b/binary/message_test.js @@ -32,8 +32,6 @@ goog.setTestOnly(); -goog.require('goog.testing.asserts'); - // CommonJS-LoadFromFile: test_pb proto.jspb.test goog.require('proto.jspb.test.Deeply.Nested.Message'); @@ -44,17 +42,17 @@ describe('Message test suite', function() { // Verify that we can successfully use a field referring to a nested message // from a different .proto file. it('testForeignNestedMessage', function() { - var msg = new proto.jspb.test.ForeignNestedFieldMessage(); - var nested = new proto.jspb.test.Deeply.Nested.Message(); + const msg = new proto.jspb.test.ForeignNestedFieldMessage(); + const nested = new proto.jspb.test.Deeply.Nested.Message(); nested.setCount(5); msg.setDeeplyNestedMessage(nested); - assertEquals(5, msg.getDeeplyNestedMessage().getCount()); + expect(msg.getDeeplyNestedMessage().getCount()).toEqual(5); // After a serialization-deserialization round trip we should get back the // same data we started with. - var serialized = msg.serializeBinary(); - var deserialized = + const serialized = msg.serializeBinary(); + const deserialized = proto.jspb.test.ForeignNestedFieldMessage.deserializeBinary(serialized); - assertEquals(5, deserialized.getDeeplyNestedMessage().getCount()); + expect(deserialized.getDeeplyNestedMessage().getCount()).toEqual(5); }); }); diff --git a/binary/proto_test.js b/binary/proto_test.js index 1ece6b3..80d4345 100644 --- a/binary/proto_test.js +++ b/binary/proto_test.js @@ -31,7 +31,7 @@ // Test suite is written using Jasmine -- see http://jasmine.github.io/ goog.require('goog.crypt.base64'); -goog.require('goog.testing.asserts'); + goog.require('jspb.BinaryWriter'); goog.require('jspb.Message'); @@ -88,15 +88,16 @@ goog.require('proto.jspb.test.extendRepeatedStringList'); goog.require('proto.jspb.test.extendRepeatedUint32List'); goog.require('proto.jspb.test.extendRepeatedUint64List'); -// CommonJS-LoadFromFile: ../node_modules/google-protobuf/google/protobuf/any_pb proto.google.protobuf +// CommonJS-LoadFromFile: ../node_modules/google-protobuf/google/protobuf/any_pb +// proto.google.protobuf goog.require('proto.google.protobuf.Any'); -var suite = {}; +const suite = {}; -var BYTES = new Uint8Array([1, 2, 8, 9]); +const BYTES = new Uint8Array([1, 2, 8, 9]); -var BYTES_B64 = goog.crypt.base64.encodeByteArray(BYTES); +const BYTES_B64 = goog.crypt.base64.encodeByteArray(BYTES); /** @@ -123,7 +124,7 @@ function fillAllFields(msg) { msg.setOptionalBytes(BYTES); msg.setOptionalGroup(new proto.jspb.test.TestAllTypes.OptionalGroup()); msg.getOptionalGroup().setA(100); - var submsg = new proto.jspb.test.ForeignMessage(); + let submsg = new proto.jspb.test.ForeignMessage(); submsg.setC(16); msg.setOptionalForeignMessage(submsg); msg.setOptionalForeignEnum(proto.jspb.test.ForeignEnum.FOREIGN_FOO); @@ -165,7 +166,6 @@ function fillAllFields(msg) { msg.setPackedRepeatedFloatList([1.5]); msg.setPackedRepeatedDoubleList([-1.5]); msg.setPackedRepeatedBoolList([true]); - } @@ -182,7 +182,7 @@ function bytesCompare(arr, expected) { if (arr.length != expected.length) { return false; } - for (var i = 0; i < arr.length; i++) { + for (let i = 0; i < arr.length; i++) { if (arr[i] != expected[i]) { return false; } @@ -198,83 +198,81 @@ function bytesCompare(arr, expected) { * @param {proto.jspb.test.TestAllTypes} copy */ function checkAllFields(original, copy) { - assertEquals(copy.getOptionalInt32(), -42); - assertEquals(copy.getOptionalInt64(), -0x7fffffff00000000); - assertEquals(copy.getOptionalUint32(), 0x80000000); - assertEquals(copy.getOptionalUint64(), 0xf000000000000000); - assertEquals(copy.getOptionalSint32(), -100); - assertEquals(copy.getOptionalSint64(), -0x8000000000000000); - assertEquals(copy.getOptionalFixed32(), 1234); - assertEquals(copy.getOptionalFixed64(), 0x1234567800000000); - assertEquals(copy.getOptionalSfixed32(), -1234); - assertEquals(copy.getOptionalSfixed64(), -0x1234567800000000); - assertEquals(copy.getOptionalFloat(), 1.5); - assertEquals(copy.getOptionalDouble(), -1.5); - assertEquals(copy.getOptionalBool(), true); - assertEquals(copy.getOptionalString(), 'hello world'); - assertEquals(true, bytesCompare(copy.getOptionalBytes(), BYTES)); - assertEquals(true, bytesCompare(copy.getOptionalBytes_asU8(), BYTES)); - assertEquals( - copy.getOptionalBytes_asB64(), goog.crypt.base64.encodeByteArray(BYTES)); - - assertEquals(copy.getOptionalGroup().getA(), 100); - assertEquals(copy.getOptionalForeignMessage().getC(), 16); - assertEquals(copy.getOptionalForeignEnum(), - proto.jspb.test.ForeignEnum.FOREIGN_FOO); - - - assertEquals(copy.getOneofString(), 'oneof'); - assertEquals(copy.getOneofFieldCase(), - proto.jspb.test.TestAllTypes.OneofFieldCase.ONEOF_STRING); - - assertElementsEquals(copy.getRepeatedInt32List(), [-42]); - assertElementsEquals(copy.getRepeatedInt64List(), [-0x7fffffff00000000]); - assertElementsEquals(copy.getRepeatedUint32List(), [0x80000000]); - assertElementsEquals(copy.getRepeatedUint64List(), [0xf000000000000000]); - assertElementsEquals(copy.getRepeatedSint32List(), [-100]); - assertElementsEquals(copy.getRepeatedSint64List(), [-0x8000000000000000]); - assertElementsEquals(copy.getRepeatedFixed32List(), [1234]); - assertElementsEquals(copy.getRepeatedFixed64List(), [0x1234567800000000]); - assertElementsEquals(copy.getRepeatedSfixed32List(), [-1234]); - assertElementsEquals(copy.getRepeatedSfixed64List(), [-0x1234567800000000]); - assertElementsEquals(copy.getRepeatedFloatList(), [1.5]); - assertElementsEquals(copy.getRepeatedDoubleList(), [-1.5]); - assertElementsEquals(copy.getRepeatedBoolList(), [true]); - assertElementsEquals(copy.getRepeatedStringList(), ['hello world']); - assertEquals(copy.getRepeatedBytesList().length, 2); - assertEquals(true, bytesCompare(copy.getRepeatedBytesList_asU8()[0], BYTES)); - assertEquals(true, bytesCompare(copy.getRepeatedBytesList()[0], BYTES)); - assertEquals(true, bytesCompare(copy.getRepeatedBytesList_asU8()[1], BYTES)); - assertEquals(copy.getRepeatedBytesList_asB64()[0], BYTES_B64); - assertEquals(copy.getRepeatedBytesList_asB64()[1], BYTES_B64); - assertEquals(copy.getRepeatedGroupList().length, 1); - assertEquals(copy.getRepeatedGroupList()[0].getA(), 100); - assertEquals(copy.getRepeatedForeignMessageList().length, 1); - assertEquals(copy.getRepeatedForeignMessageList()[0].getC(), 1000); - assertElementsEquals(copy.getRepeatedForeignEnumList(), - [proto.jspb.test.ForeignEnum.FOREIGN_FOO]); - - assertElementsEquals(copy.getPackedRepeatedInt32List(), [-42]); - assertElementsEquals(copy.getPackedRepeatedInt64List(), - [-0x7fffffff00000000]); - assertElementsEquals(copy.getPackedRepeatedUint32List(), [0x80000000]); - assertElementsEquals(copy.getPackedRepeatedUint64List(), - [0xf000000000000000]); - assertElementsEquals(copy.getPackedRepeatedSint32List(), [-100]); - assertElementsEquals(copy.getPackedRepeatedSint64List(), - [-0x8000000000000000]); - assertElementsEquals(copy.getPackedRepeatedFixed32List(), [1234]); - assertElementsEquals(copy.getPackedRepeatedFixed64List(), - [0x1234567800000000]); - assertElementsEquals(copy.getPackedRepeatedSfixed32List(), [-1234]); - assertElementsEquals(copy.getPackedRepeatedSfixed64List(), - [-0x1234567800000000]); - assertElementsEquals(copy.getPackedRepeatedFloatList(), [1.5]); - assertElementsEquals(copy.getPackedRepeatedDoubleList(), [-1.5]); + expect(copy.getOptionalInt32()).toEqual(-42); + expect(copy.getOptionalInt64()).toEqual(-0x7fffffff00000000); + expect(copy.getOptionalUint32()).toEqual(0x80000000); + expect(copy.getOptionalUint64()).toEqual(0xf000000000000000); + expect(copy.getOptionalSint32()).toEqual(-100); + expect(copy.getOptionalSint64()).toEqual(-0x8000000000000000); + expect(copy.getOptionalFixed32()).toEqual(1234); + expect(copy.getOptionalFixed64()).toEqual(0x1234567800000000); + expect(copy.getOptionalSfixed32()).toEqual(-1234); + expect(copy.getOptionalSfixed64()).toEqual(-0x1234567800000000); + expect(copy.getOptionalFloat()).toEqual(1.5); + expect(copy.getOptionalDouble()).toEqual(-1.5); + expect(copy.getOptionalBool()).toBeTrue(); + expect(copy.getOptionalString()).toEqual('hello world'); + expect(bytesCompare(copy.getOptionalBytes(), BYTES)).toEqual(true); + expect(true).toEqual(bytesCompare(copy.getOptionalBytes_asU8(), BYTES)); + expect(copy.getOptionalBytes_asB64()) + .toEqual(goog.crypt.base64.encodeByteArray(BYTES)); + + expect(copy.getOptionalGroup().getA()).toEqual(100); + expect(copy.getOptionalForeignMessage().getC()).toEqual(16); + expect(proto.jspb.test.ForeignEnum.FOREIGN_FOO) + .toEqual(copy.getOptionalForeignEnum()); + + + expect(copy.getOneofString()).toEqual('oneof'); + expect(proto.jspb.test.TestAllTypes.OneofFieldCase.ONEOF_STRING) + .toEqual(copy.getOneofFieldCase()); + + expect(copy.getRepeatedInt32List()).toEqual([-42]); + expect(copy.getRepeatedInt64List()).toEqual([-0x7fffffff00000000]); + expect(copy.getRepeatedUint32List()).toEqual([0x80000000]); + expect(copy.getRepeatedUint64List()).toEqual([0xf000000000000000]); + expect(copy.getRepeatedSint32List()).toEqual([-100]); + expect(copy.getRepeatedSint64List()).toEqual([-0x8000000000000000]); + expect(copy.getRepeatedFixed32List()).toEqual([1234]); + expect(copy.getRepeatedFixed64List()).toEqual([0x1234567800000000]); + expect(copy.getRepeatedSfixed32List()).toEqual([-1234]); + expect(copy.getRepeatedSfixed64List()).toEqual([-0x1234567800000000]); + expect(copy.getRepeatedFloatList()).toEqual([1.5]); + expect(copy.getRepeatedDoubleList()).toEqual([-1.5]); + expect(copy.getRepeatedBoolList()).toEqual([true]); + expect(copy.getRepeatedStringList()).toEqual(['hello world']); + expect(copy.getRepeatedBytesList().length).toEqual(2); + expect(true).toEqual( + bytesCompare(copy.getRepeatedBytesList_asU8()[0], BYTES)); + expect(true).toEqual(bytesCompare(copy.getRepeatedBytesList()[0], BYTES)); + expect(true).toEqual( + bytesCompare(copy.getRepeatedBytesList_asU8()[1], BYTES)); + expect(copy.getRepeatedBytesList_asB64()[0]).toEqual(BYTES_B64); + expect(copy.getRepeatedBytesList_asB64()[1]).toEqual(BYTES_B64); + expect(copy.getRepeatedGroupList().length).toEqual(1); + expect(copy.getRepeatedGroupList()[0].getA()).toEqual(100); + expect(copy.getRepeatedForeignMessageList().length).toEqual(1); + expect(copy.getRepeatedForeignMessageList()[0].getC()).toEqual(1000); + expect([ + proto.jspb.test.ForeignEnum.FOREIGN_FOO + ]).toEqual(copy.getRepeatedForeignEnumList()); + + expect(copy.getPackedRepeatedInt32List()).toEqual([-42]); + expect(copy.getPackedRepeatedInt64List()).toEqual([-0x7fffffff00000000]); + expect(copy.getPackedRepeatedUint32List()).toEqual([0x80000000]); + expect(copy.getPackedRepeatedUint64List()).toEqual([0xf000000000000000]); + expect(copy.getPackedRepeatedSint32List()).toEqual([-100]); + expect(copy.getPackedRepeatedSint64List()).toEqual([-0x8000000000000000]); + expect(copy.getPackedRepeatedFixed32List()).toEqual([1234]); + expect(copy.getPackedRepeatedFixed64List()).toEqual([0x1234567800000000]); + expect(copy.getPackedRepeatedSfixed32List()).toEqual([-1234]); + expect(copy.getPackedRepeatedSfixed64List()).toEqual([-0x1234567800000000]); + expect(copy.getPackedRepeatedFloatList()).toEqual([1.5]); + expect(copy.getPackedRepeatedDoubleList()).toEqual([-1.5]); // Check last so we get more granular errors first. - assertTrue(jspb.Message.equals(original, copy)); + expect(jspb.Message.equals(original, copy)).toBeTrue(); } @@ -283,139 +281,118 @@ function checkAllFields(original, copy) { * @param {!proto.jspb.test.TestExtendable} msg */ function checkExtensions(msg) { - assertEquals(0, msg.getExtension(proto.jspb.test.extendOptionalInt32)); - assertEquals(-0x7fffffff00000000, - msg.getExtension(proto.jspb.test.extendOptionalInt64)); - assertEquals(0x80000000, - msg.getExtension(proto.jspb.test.extendOptionalUint32)); - assertEquals(0xf000000000000000, - msg.getExtension(proto.jspb.test.extendOptionalUint64)); - assertEquals(-100, - msg.getExtension(proto.jspb.test.extendOptionalSint32)); - assertEquals(-0x8000000000000000, - msg.getExtension(proto.jspb.test.extendOptionalSint64)); - assertEquals(1234, - msg.getExtension(proto.jspb.test.extendOptionalFixed32)); - assertEquals(0x1234567800000000, - msg.getExtension(proto.jspb.test.extendOptionalFixed64)); - assertEquals(-1234, + expect(0).toEqual(msg.getExtension(proto.jspb.test.extendOptionalInt32)); + expect(-0x7fffffff00000000) + .toEqual(msg.getExtension(proto.jspb.test.extendOptionalInt64)); + expect(0x80000000) + .toEqual(msg.getExtension(proto.jspb.test.extendOptionalUint32)); + expect(0xf000000000000000) + .toEqual(msg.getExtension(proto.jspb.test.extendOptionalUint64)); + expect(-100).toEqual(msg.getExtension(proto.jspb.test.extendOptionalSint32)); + expect(-0x8000000000000000) + .toEqual(msg.getExtension(proto.jspb.test.extendOptionalSint64)); + expect(1234).toEqual(msg.getExtension(proto.jspb.test.extendOptionalFixed32)); + expect(0x1234567800000000) + .toEqual(msg.getExtension(proto.jspb.test.extendOptionalFixed64)); + expect(-1234).toEqual( msg.getExtension(proto.jspb.test.extendOptionalSfixed32)); - assertEquals(-0x1234567800000000, - msg.getExtension(proto.jspb.test.extendOptionalSfixed64)); - assertEquals(1.5, - msg.getExtension(proto.jspb.test.extendOptionalFloat)); - assertEquals(-1.5, - msg.getExtension(proto.jspb.test.extendOptionalDouble)); - assertEquals(true, - msg.getExtension(proto.jspb.test.extendOptionalBool)); - assertEquals('hello world', - msg.getExtension(proto.jspb.test.extendOptionalString)); - assertEquals( - true, bytesCompare( - msg.getExtension(proto.jspb.test.extendOptionalBytes), BYTES)); - assertEquals(16, - msg.getExtension( - proto.jspb.test.ExtendsWithMessage.optionalExtension).getFoo()); - - - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedInt32List), - [-42]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedInt64List), - [-0x7fffffff00000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedUint32List), - [0x80000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedUint64List), - [0xf000000000000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedSint32List), - [-100]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedSint64List), - [-0x8000000000000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedFixed32List), - [1234]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedFixed64List), - [0x1234567800000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedSfixed32List), - [-1234]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedSfixed64List), - [-0x1234567800000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedFloatList), - [1.5]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedDoubleList), - [-1.5]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedBoolList), - [true]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedStringList), - ['hello world']); - assertEquals( - true, - bytesCompare( - msg.getExtension(proto.jspb.test.extendRepeatedBytesList)[0], BYTES)); - assertEquals(1000, + expect(-0x1234567800000000) + .toEqual(msg.getExtension(proto.jspb.test.extendOptionalSfixed64)); + expect(msg.getExtension(proto.jspb.test.extendOptionalFloat)).toEqual(1.5); + expect(msg.getExtension(proto.jspb.test.extendOptionalDouble)).toEqual(-1.5); + expect(msg.getExtension(proto.jspb.test.extendOptionalBool)).toEqual(true); + expect(msg.getExtension(proto.jspb.test.extendOptionalString)) + .toEqual('hello world'); + expect(bytesCompare( + msg.getExtension(proto.jspb.test.extendOptionalBytes), BYTES)) + .toEqual(true); + expect(msg.getExtension(proto.jspb.test.ExtendsWithMessage.optionalExtension) + .getFoo()) + .toEqual(16); + + + expect(msg.getExtension(proto.jspb.test.extendRepeatedInt32List)).toEqual([ + -42 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedInt64List)).toEqual([ + -0x7fffffff00000000 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedUint32List)).toEqual([ + 0x80000000 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedUint64List)).toEqual([ + 0xf000000000000000 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedSint32List)).toEqual([ + -100 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedSint64List)).toEqual([ + -0x8000000000000000 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedFixed32List)).toEqual([ + 1234 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedFixed64List)).toEqual([ + 0x1234567800000000 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedSfixed32List)).toEqual([ + -1234 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedSfixed64List)).toEqual([ + -0x1234567800000000 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedFloatList)).toEqual([ + 1.5 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedDoubleList)).toEqual([ + -1.5 + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedBoolList)).toEqual([ + true + ]); + expect(msg.getExtension(proto.jspb.test.extendRepeatedStringList)).toEqual([ + 'hello world' + ]); + expect(true).toEqual(bytesCompare( + msg.getExtension(proto.jspb.test.extendRepeatedBytesList)[0], BYTES)); + expect(1000).toEqual( msg.getExtension( - proto.jspb.test.ExtendsWithMessage.repeatedExtensionList)[0] - .getFoo()); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendRepeatedForeignEnumList), - [proto.jspb.test.ForeignEnum.FOREIGN_FOO]); - - - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedInt32List), - [-42]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedInt64List), - [-0x7fffffff00000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedUint32List), - [0x80000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedUint64List), - [0xf000000000000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedSint32List), - [-100]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedSint64List), - [-0x8000000000000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedFixed32List), - [1234]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedFixed64List), - [0x1234567800000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedSfixed32List), - [-1234]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedSfixed64List), - [-0x1234567800000000]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedFloatList), - [1.5]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedDoubleList), - [-1.5]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedBoolList), - [true]); - assertElementsEquals( - msg.getExtension(proto.jspb.test.extendPackedRepeatedForeignEnumList), - [proto.jspb.test.ForeignEnum.FOREIGN_FOO]); - + proto.jspb.test.ExtendsWithMessage.repeatedExtensionList)[0] + .getFoo()); + expect([ + proto.jspb.test.ForeignEnum.FOREIGN_FOO + ]).toEqual(msg.getExtension(proto.jspb.test.extendRepeatedForeignEnumList)); + + + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedInt32List)) + .toEqual([-42]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedInt64List)) + .toEqual([-0x7fffffff00000000]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedUint32List)) + .toEqual([0x80000000]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedUint64List)) + .toEqual([0xf000000000000000]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedSint32List)) + .toEqual([-100]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedSint64List)) + .toEqual([-0x8000000000000000]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedFixed32List)) + .toEqual([1234]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedFixed64List)) + .toEqual([0x1234567800000000]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedSfixed32List)) + .toEqual([-1234]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedSfixed64List)) + .toEqual([-0x1234567800000000]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedFloatList)) + .toEqual([1.5]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedDoubleList)) + .toEqual([-1.5]); + expect(msg.getExtension(proto.jspb.test.extendPackedRepeatedBoolList)) + .toEqual([true]); + expect([proto.jspb.test.ForeignEnum.FOREIGN_FOO]) + .toEqual(msg.getExtension( + proto.jspb.test.extendPackedRepeatedForeignEnumList)); } @@ -425,10 +402,10 @@ describe('protoBinaryTest', function() { * field types (on the TestAllTypes message type). */ it('testRoundTrip', function() { - var msg = new proto.jspb.test.TestAllTypes(); + const msg = new proto.jspb.test.TestAllTypes(); fillAllFields(msg); - var encoded = msg.serializeBinary(); - var decoded = proto.jspb.test.TestAllTypes.deserializeBinary(encoded); + const encoded = msg.serializeBinary(); + const decoded = proto.jspb.test.TestAllTypes.deserializeBinary(encoded); checkAllFields(msg, decoded); }); @@ -436,64 +413,68 @@ describe('protoBinaryTest', function() { * Test that base64 string and Uint8Array are interchangeable in bytes fields. */ it('testBytesFieldsGettersInterop', function() { - var msg = new proto.jspb.test.TestAllTypes(); + let msg = new proto.jspb.test.TestAllTypes(); // Set from a base64 string and check all the getters work. msg.setOptionalBytes(BYTES_B64); - assertTrue(bytesCompare(msg.getOptionalBytes_asU8(), BYTES)); - assertTrue(bytesCompare(msg.getOptionalBytes_asB64(), BYTES)); - assertTrue(bytesCompare(msg.getOptionalBytes(), BYTES)); + expect(bytesCompare(msg.getOptionalBytes_asU8(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getOptionalBytes_asB64(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getOptionalBytes(), BYTES)).toBeTrue(); // Test binary serialize round trip doesn't break it. msg = proto.jspb.test.TestAllTypes.deserializeBinary(msg.serializeBinary()); - assertTrue(bytesCompare(msg.getOptionalBytes_asU8(), BYTES)); - assertTrue(bytesCompare(msg.getOptionalBytes_asB64(), BYTES)); - assertTrue(bytesCompare(msg.getOptionalBytes(), BYTES)); + expect(bytesCompare(msg.getOptionalBytes_asU8(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getOptionalBytes_asB64(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getOptionalBytes(), BYTES)).toBeTrue(); msg = new proto.jspb.test.TestAllTypes(); // Set from a Uint8Array and check all the getters work. msg.setOptionalBytes(BYTES); - assertTrue(bytesCompare(msg.getOptionalBytes_asU8(), BYTES)); - assertTrue(bytesCompare(msg.getOptionalBytes_asB64(), BYTES)); - assertTrue(bytesCompare(msg.getOptionalBytes(), BYTES)); - + expect(bytesCompare(msg.getOptionalBytes_asU8(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getOptionalBytes_asB64(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getOptionalBytes(), BYTES)).toBeTrue(); }); /** * Test that bytes setters will receive result of any of the getters. */ it('testBytesFieldsSettersInterop', function() { - var msg = new proto.jspb.test.TestAllTypes(); + const msg = new proto.jspb.test.TestAllTypes(); msg.setOptionalBytes(BYTES); - assertTrue(bytesCompare(msg.getOptionalBytes(), BYTES)); + expect(bytesCompare(msg.getOptionalBytes(), BYTES)).toBeTrue(); msg.setOptionalBytes(msg.getOptionalBytes()); - assertTrue(bytesCompare(msg.getOptionalBytes(), BYTES)); + expect(bytesCompare(msg.getOptionalBytes(), BYTES)).toBeTrue(); msg.setOptionalBytes(msg.getOptionalBytes_asB64()); - assertTrue(bytesCompare(msg.getOptionalBytes(), BYTES)); + expect(bytesCompare(msg.getOptionalBytes(), BYTES)).toBeTrue(); msg.setOptionalBytes(msg.getOptionalBytes_asU8()); - assertTrue(bytesCompare(msg.getOptionalBytes(), BYTES)); + expect(bytesCompare(msg.getOptionalBytes(), BYTES)).toBeTrue(); }); /** * Test that bytes setters will receive result of any of the getters. */ it('testRepeatedBytesGetters', function() { - var msg = new proto.jspb.test.TestAllTypes(); + const msg = new proto.jspb.test.TestAllTypes(); function assertGetters() { - assertTrue(typeof msg.getRepeatedBytesList_asB64()[0] === 'string'); - assertTrue(typeof msg.getRepeatedBytesList_asB64()[1] === 'string'); - assertTrue(msg.getRepeatedBytesList_asU8()[0] instanceof Uint8Array); - assertTrue(msg.getRepeatedBytesList_asU8()[1] instanceof Uint8Array); - - assertTrue(bytesCompare(msg.getRepeatedBytesList()[0], BYTES)); - assertTrue(bytesCompare(msg.getRepeatedBytesList()[1], BYTES)); - assertTrue(bytesCompare(msg.getRepeatedBytesList_asB64()[0], BYTES)); - assertTrue(bytesCompare(msg.getRepeatedBytesList_asB64()[1], BYTES)); - assertTrue(bytesCompare(msg.getRepeatedBytesList_asU8()[0], BYTES)); - assertTrue(bytesCompare(msg.getRepeatedBytesList_asU8()[1], BYTES)); + expect(typeof msg.getRepeatedBytesList_asB64()[0]).toEqual('string'); + expect(typeof msg.getRepeatedBytesList_asB64()[1]).toEqual('string'); + expect(msg.getRepeatedBytesList_asU8()[0] instanceof Uint8Array) + .toBeTrue(); + expect(msg.getRepeatedBytesList_asU8()[1] instanceof Uint8Array) + .toBeTrue(); + + expect(bytesCompare(msg.getRepeatedBytesList()[0], BYTES)).toBeTrue(); + expect(bytesCompare(msg.getRepeatedBytesList()[1], BYTES)).toBeTrue(); + expect(bytesCompare(msg.getRepeatedBytesList_asB64()[0], BYTES)) + .toBeTrue(); + expect(bytesCompare(msg.getRepeatedBytesList_asB64()[1], BYTES)) + .toBeTrue(); + expect(bytesCompare(msg.getRepeatedBytesList_asU8()[0], BYTES)) + .toBeTrue(); + expect(bytesCompare(msg.getRepeatedBytesList_asU8()[1], BYTES)) + .toBeTrue(); } - msg.setRepeatedBytesList([BYTES, BYTES]); assertGetters(); @@ -501,9 +482,9 @@ describe('protoBinaryTest', function() { assertGetters(); msg.setRepeatedBytesList([]); - assertEquals(0, msg.getRepeatedBytesList().length); - assertEquals(0, msg.getRepeatedBytesList_asB64().length); - assertEquals(0, msg.getRepeatedBytesList_asU8().length); + expect(msg.getRepeatedBytesList().length).toEqual(0); + expect(0).toEqual(msg.getRepeatedBytesList_asB64().length); + expect(0).toEqual(msg.getRepeatedBytesList_asU8().length); }); /** @@ -512,34 +493,22 @@ describe('protoBinaryTest', function() { */ function fillExtensions(msg) { msg.setExtension(proto.jspb.test.extendOptionalInt32, 0); - msg.setExtension( - proto.jspb.test.extendOptionalInt64, -0x7fffffff00000000); - msg.setExtension( - proto.jspb.test.extendOptionalUint32, 0x80000000); - msg.setExtension( - proto.jspb.test.extendOptionalUint64, 0xf000000000000000); - msg.setExtension( - proto.jspb.test.extendOptionalSint32, -100); - msg.setExtension( - proto.jspb.test.extendOptionalSint64, -0x8000000000000000); - msg.setExtension( - proto.jspb.test.extendOptionalFixed32, 1234); - msg.setExtension( - proto.jspb.test.extendOptionalFixed64, 0x1234567800000000); - msg.setExtension( - proto.jspb.test.extendOptionalSfixed32, -1234); + msg.setExtension(proto.jspb.test.extendOptionalInt64, -0x7fffffff00000000); + msg.setExtension(proto.jspb.test.extendOptionalUint32, 0x80000000); + msg.setExtension(proto.jspb.test.extendOptionalUint64, 0xf000000000000000); + msg.setExtension(proto.jspb.test.extendOptionalSint32, -100); + msg.setExtension(proto.jspb.test.extendOptionalSint64, -0x8000000000000000); + msg.setExtension(proto.jspb.test.extendOptionalFixed32, 1234); + msg.setExtension(proto.jspb.test.extendOptionalFixed64, 0x1234567800000000); + msg.setExtension(proto.jspb.test.extendOptionalSfixed32, -1234); msg.setExtension( proto.jspb.test.extendOptionalSfixed64, -0x1234567800000000); - msg.setExtension( - proto.jspb.test.extendOptionalFloat, 1.5); - msg.setExtension( - proto.jspb.test.extendOptionalDouble, -1.5); - msg.setExtension( - proto.jspb.test.extendOptionalBool, true); - msg.setExtension( - proto.jspb.test.extendOptionalString, 'hello world'); + msg.setExtension(proto.jspb.test.extendOptionalFloat, 1.5); + msg.setExtension(proto.jspb.test.extendOptionalDouble, -1.5); + msg.setExtension(proto.jspb.test.extendOptionalBool, true); + msg.setExtension(proto.jspb.test.extendOptionalString, 'hello world'); msg.setExtension(proto.jspb.test.extendOptionalBytes, BYTES); - var submsg = new proto.jspb.test.ExtendsWithMessage(); + let submsg = new proto.jspb.test.ExtendsWithMessage(); submsg.setFoo(16); msg.setExtension( proto.jspb.test.ExtendsWithMessage.optionalExtension, submsg); @@ -548,73 +517,58 @@ describe('protoBinaryTest', function() { proto.jspb.test.ForeignEnum.FOREIGN_FOO); - msg.setExtension( - proto.jspb.test.extendRepeatedInt32List, [-42]); + msg.setExtension(proto.jspb.test.extendRepeatedInt32List, [-42]); msg.setExtension( proto.jspb.test.extendRepeatedInt64List, [-0x7fffffff00000000]); - msg.setExtension( - proto.jspb.test.extendRepeatedUint32List, [0x80000000]); + msg.setExtension(proto.jspb.test.extendRepeatedUint32List, [0x80000000]); msg.setExtension( proto.jspb.test.extendRepeatedUint64List, [0xf000000000000000]); - msg.setExtension( - proto.jspb.test.extendRepeatedSint32List, [-100]); + msg.setExtension(proto.jspb.test.extendRepeatedSint32List, [-100]); msg.setExtension( proto.jspb.test.extendRepeatedSint64List, [-0x8000000000000000]); - msg.setExtension( - proto.jspb.test.extendRepeatedFixed32List, [1234]); + msg.setExtension(proto.jspb.test.extendRepeatedFixed32List, [1234]); msg.setExtension( proto.jspb.test.extendRepeatedFixed64List, [0x1234567800000000]); - msg.setExtension( - proto.jspb.test.extendRepeatedSfixed32List, [-1234]); + msg.setExtension(proto.jspb.test.extendRepeatedSfixed32List, [-1234]); msg.setExtension( proto.jspb.test.extendRepeatedSfixed64List, [-0x1234567800000000]); - msg.setExtension( - proto.jspb.test.extendRepeatedFloatList, [1.5]); - msg.setExtension( - proto.jspb.test.extendRepeatedDoubleList, [-1.5]); - msg.setExtension( - proto.jspb.test.extendRepeatedBoolList, [true]); - msg.setExtension( - proto.jspb.test.extendRepeatedStringList, ['hello world']); + msg.setExtension(proto.jspb.test.extendRepeatedFloatList, [1.5]); + msg.setExtension(proto.jspb.test.extendRepeatedDoubleList, [-1.5]); + msg.setExtension(proto.jspb.test.extendRepeatedBoolList, [true]); + msg.setExtension(proto.jspb.test.extendRepeatedStringList, ['hello world']); msg.setExtension(proto.jspb.test.extendRepeatedBytesList, [BYTES]); submsg = new proto.jspb.test.ExtendsWithMessage(); submsg.setFoo(1000); msg.setExtension( proto.jspb.test.ExtendsWithMessage.repeatedExtensionList, [submsg]); - msg.setExtension(proto.jspb.test.extendRepeatedForeignEnumList, + msg.setExtension( + proto.jspb.test.extendRepeatedForeignEnumList, [proto.jspb.test.ForeignEnum.FOREIGN_FOO]); - msg.setExtension( - proto.jspb.test.extendPackedRepeatedInt32List, [-42]); + msg.setExtension(proto.jspb.test.extendPackedRepeatedInt32List, [-42]); msg.setExtension( proto.jspb.test.extendPackedRepeatedInt64List, [-0x7fffffff00000000]); msg.setExtension( proto.jspb.test.extendPackedRepeatedUint32List, [0x80000000]); msg.setExtension( proto.jspb.test.extendPackedRepeatedUint64List, [0xf000000000000000]); - msg.setExtension( - proto.jspb.test.extendPackedRepeatedSint32List, [-100]); + msg.setExtension(proto.jspb.test.extendPackedRepeatedSint32List, [-100]); msg.setExtension( proto.jspb.test.extendPackedRepeatedSint64List, [-0x8000000000000000]); - msg.setExtension( - proto.jspb.test.extendPackedRepeatedFixed32List, [1234]); + msg.setExtension(proto.jspb.test.extendPackedRepeatedFixed32List, [1234]); msg.setExtension( proto.jspb.test.extendPackedRepeatedFixed64List, [0x1234567800000000]); - msg.setExtension( - proto.jspb.test.extendPackedRepeatedSfixed32List, [-1234]); + msg.setExtension(proto.jspb.test.extendPackedRepeatedSfixed32List, [-1234]); msg.setExtension( proto.jspb.test.extendPackedRepeatedSfixed64List, [-0x1234567800000000]); + msg.setExtension(proto.jspb.test.extendPackedRepeatedFloatList, [1.5]); + msg.setExtension(proto.jspb.test.extendPackedRepeatedDoubleList, [-1.5]); + msg.setExtension(proto.jspb.test.extendPackedRepeatedBoolList, [true]); msg.setExtension( - proto.jspb.test.extendPackedRepeatedFloatList, [1.5]); - msg.setExtension( - proto.jspb.test.extendPackedRepeatedDoubleList, [-1.5]); - msg.setExtension( - proto.jspb.test.extendPackedRepeatedBoolList, [true]); - msg.setExtension(proto.jspb.test.extendPackedRepeatedForeignEnumList, + proto.jspb.test.extendPackedRepeatedForeignEnumList, [proto.jspb.test.ForeignEnum.FOREIGN_FOO]); - } @@ -622,10 +576,10 @@ describe('protoBinaryTest', function() { * Tests extension serialization and deserialization. */ it('testExtensions', function() { - var msg = new proto.jspb.test.TestExtendable(); + const msg = new proto.jspb.test.TestExtendable(); fillExtensions(msg); - var encoded = msg.serializeBinary(); - var decoded = proto.jspb.test.TestExtendable.deserializeBinary(encoded); + const encoded = msg.serializeBinary(); + const decoded = proto.jspb.test.TestExtendable.deserializeBinary(encoded); checkExtensions(decoded); }); @@ -633,33 +587,31 @@ describe('protoBinaryTest', function() { * Tests that unknown extensions don't cause deserialization failure. */ it('testUnknownExtension', function() { - var msg = new proto.jspb.test.TestExtendable(); + const msg = new proto.jspb.test.TestExtendable(); fillExtensions(msg); - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); writer.writeBool((1 << 29) - 1, true); proto.jspb.test.TestExtendable.serializeBinaryToWriter(msg, writer); - var encoded = writer.getResultBuffer(); - var decoded = proto.jspb.test.TestExtendable.deserializeBinary(encoded); + const encoded = writer.getResultBuffer(); + const decoded = proto.jspb.test.TestExtendable.deserializeBinary(encoded); checkExtensions(decoded); }); it('testAnyWellKnownType', function() { - var any = new proto.google.protobuf.Any(); - var msg = new proto.jspb.test.TestAllTypes(); + const any = new proto.google.protobuf.Any(); + const msg = new proto.jspb.test.TestAllTypes(); fillAllFields(msg); any.pack(msg.serializeBinary(), 'jspb.test.TestAllTypes'); - assertEquals('type.googleapis.com/jspb.test.TestAllTypes', - any.getTypeUrl()); + expect(any.getTypeUrl()) + .toEqual('type.googleapis.com/jspb.test.TestAllTypes'); - var msg2 = any.unpack( + const msg2 = any.unpack( proto.jspb.test.TestAllTypes.deserializeBinary, 'jspb.test.TestAllTypes'); checkAllFields(msg, msg2); - }); - }); diff --git a/binary/reader.js b/binary/reader.js index cdae1a4..69d57dc 100644 --- a/binary/reader.js +++ b/binary/reader.js @@ -47,7 +47,7 @@ goog.provide('jspb.BinaryReader'); -goog.require('goog.asserts'); +goog.require('jspb.asserts'); goog.require('jspb.BinaryConstants'); goog.require('jspb.BinaryDecoder'); goog.require('jspb.utils'); @@ -121,8 +121,7 @@ jspb.BinaryReader.instanceCache_ = []; * we'll throw an assertion if we go off the end of the block. * @return {!jspb.BinaryReader} */ -jspb.BinaryReader.alloc = - function(opt_bytes, opt_start, opt_length) { +jspb.BinaryReader.alloc = function(opt_bytes, opt_start, opt_length) { if (jspb.BinaryReader.instanceCache_.length) { var newReader = jspb.BinaryReader.instanceCache_.pop(); if (opt_bytes) { @@ -286,7 +285,7 @@ jspb.BinaryReader.prototype.nextField = function() { // If we hit an error decoding the previous field, stop now before we // try to decode anything else if (this.getError()) { - goog.asserts.fail('Decoder hit an error'); + jspb.asserts.jspbFail('Decoder hit an error'); return false; } @@ -305,7 +304,7 @@ jspb.BinaryReader.prototype.nextField = function() { nextWireType != jspb.BinaryConstants.WireType.DELIMITED && nextWireType != jspb.BinaryConstants.WireType.START_GROUP && nextWireType != jspb.BinaryConstants.WireType.END_GROUP) { - goog.asserts.fail( + jspb.asserts.jspbFail( 'Invalid wire type: %s (at position %s)', nextWireType, this.fieldCursor_); this.error_ = true; @@ -349,7 +348,7 @@ jspb.BinaryReader.prototype.skipMatchingFields = function() { */ jspb.BinaryReader.prototype.skipVarintField = function() { if (this.nextWireType_ != jspb.BinaryConstants.WireType.VARINT) { - goog.asserts.fail('Invalid wire type for skipVarintField'); + jspb.asserts.jspbFail('Invalid wire type for skipVarintField'); this.skipField(); return; } @@ -363,7 +362,7 @@ jspb.BinaryReader.prototype.skipVarintField = function() { */ jspb.BinaryReader.prototype.skipDelimitedField = function() { if (this.nextWireType_ != jspb.BinaryConstants.WireType.DELIMITED) { - goog.asserts.fail('Invalid wire type for skipDelimitedField'); + jspb.asserts.jspbFail('Invalid wire type for skipDelimitedField'); this.skipField(); return; } @@ -378,7 +377,7 @@ jspb.BinaryReader.prototype.skipDelimitedField = function() { */ jspb.BinaryReader.prototype.skipFixed32Field = function() { if (this.nextWireType_ != jspb.BinaryConstants.WireType.FIXED32) { - goog.asserts.fail('Invalid wire type for skipFixed32Field'); + jspb.asserts.jspbFail('Invalid wire type for skipFixed32Field'); this.skipField(); return; } @@ -392,7 +391,7 @@ jspb.BinaryReader.prototype.skipFixed32Field = function() { */ jspb.BinaryReader.prototype.skipFixed64Field = function() { if (this.nextWireType_ != jspb.BinaryConstants.WireType.FIXED64) { - goog.asserts.fail('Invalid wire type for skipFixed64Field'); + jspb.asserts.jspbFail('Invalid wire type for skipFixed64Field'); this.skipField(); return; } @@ -408,15 +407,14 @@ jspb.BinaryReader.prototype.skipGroup = function() { var previousField = this.nextField_; do { if (!this.nextField()) { - goog.asserts.fail('Unmatched start-group tag: stream EOF'); + jspb.asserts.jspbFail('Unmatched start-group tag: stream EOF'); this.error_ = true; return; } - if (this.nextWireType_ == - jspb.BinaryConstants.WireType.END_GROUP) { + if (this.nextWireType_ == jspb.BinaryConstants.WireType.END_GROUP) { // Group end: check that it matches top-of-stack. if (this.nextField_ != previousField) { - goog.asserts.fail('Unmatched end-group tag'); + jspb.asserts.jspbFail('Unmatched end-group tag'); this.error_ = true; return; } @@ -449,7 +447,7 @@ jspb.BinaryReader.prototype.skipField = function() { this.skipGroup(); break; default: - goog.asserts.fail('Invalid wire encoding for field.'); + jspb.asserts.jspbFail('Invalid wire encoding for field.'); } }; @@ -464,7 +462,7 @@ jspb.BinaryReader.prototype.registerReadCallback = function( if (this.readCallbacks_ === null) { this.readCallbacks_ = {}; } - goog.asserts.assert(!this.readCallbacks_[callbackName]); + jspb.asserts.jspbAssert(!this.readCallbacks_[callbackName]); this.readCallbacks_[callbackName] = callback; }; @@ -475,9 +473,9 @@ jspb.BinaryReader.prototype.registerReadCallback = function( * @return {*} The value returned by the callback. */ jspb.BinaryReader.prototype.runReadCallback = function(callbackName) { - goog.asserts.assert(this.readCallbacks_ !== null); + jspb.asserts.jspbAssert(this.readCallbacks_ !== null); var callback = this.readCallbacks_[callbackName]; - goog.asserts.assert(callback); + jspb.asserts.jspbAssert(callback); return callback(this); }; @@ -510,9 +508,9 @@ jspb.BinaryReader.prototype.readAny = function(fieldType) { case fieldTypes.STRING: return this.readString(); case fieldTypes.GROUP: - goog.asserts.fail('Group field type not supported in readAny()'); + jspb.asserts.jspbFail('Group field type not supported in readAny()'); case fieldTypes.MESSAGE: - goog.asserts.fail('Message field type not supported in readAny()'); + jspb.asserts.jspbFail('Message field type not supported in readAny()'); case fieldTypes.BYTES: return this.readBytes(); case fieldTypes.UINT32: @@ -532,7 +530,7 @@ jspb.BinaryReader.prototype.readAny = function(fieldType) { case fieldTypes.VHASH64: return this.readVarintHash64(); default: - goog.asserts.fail('Invalid field type in readAny()'); + jspb.asserts.jspbFail('Invalid field type in readAny()'); } return 0; }; @@ -548,7 +546,7 @@ jspb.BinaryReader.prototype.readAny = function(fieldType) { * @export */ jspb.BinaryReader.prototype.readMessage = function(message, reader) { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); // Save the current endpoint of the decoder and move it to the end of the @@ -577,20 +575,19 @@ jspb.BinaryReader.prototype.readMessage = function(message, reader) { * @param {function(T, !jspb.BinaryReader)} reader * @export */ -jspb.BinaryReader.prototype.readGroup = - function(field, message, reader) { +jspb.BinaryReader.prototype.readGroup = function(field, message, reader) { // Ensure that the wire type is correct. - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.START_GROUP); // Ensure that the field number is correct. - goog.asserts.assert(this.nextField_ == field); + jspb.asserts.jspbAssert(this.nextField_ == field); // Deserialize the message. The deserialization will stop at an END_GROUP tag. reader(message, this); if (!this.error_ && this.nextWireType_ != jspb.BinaryConstants.WireType.END_GROUP) { - goog.asserts.fail('Group submessage did not end with an END_GROUP tag'); + jspb.asserts.jspbFail('Group submessage did not end with an END_GROUP tag'); this.error_ = true; } }; @@ -601,7 +598,7 @@ jspb.BinaryReader.prototype.readGroup = * @return {!jspb.BinaryDecoder} */ jspb.BinaryReader.prototype.getFieldDecoder = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); var length = this.decoder_.readUnsignedVarint32(); @@ -623,7 +620,7 @@ jspb.BinaryReader.prototype.getFieldDecoder = function() { * @export */ jspb.BinaryReader.prototype.readInt32 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint32(); }; @@ -639,7 +636,7 @@ jspb.BinaryReader.prototype.readInt32 = function() { * string. */ jspb.BinaryReader.prototype.readInt32String = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint32String(); }; @@ -653,7 +650,7 @@ jspb.BinaryReader.prototype.readInt32String = function() { * @export */ jspb.BinaryReader.prototype.readInt64 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint64(); }; @@ -669,7 +666,7 @@ jspb.BinaryReader.prototype.readInt64 = function() { * string. */ jspb.BinaryReader.prototype.readInt64String = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint64String(); }; @@ -683,7 +680,7 @@ jspb.BinaryReader.prototype.readInt64String = function() { * @export */ jspb.BinaryReader.prototype.readUint32 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readUnsignedVarint32(); }; @@ -699,7 +696,7 @@ jspb.BinaryReader.prototype.readUint32 = function() { * string. */ jspb.BinaryReader.prototype.readUint32String = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readUnsignedVarint32String(); }; @@ -713,7 +710,7 @@ jspb.BinaryReader.prototype.readUint32String = function() { * @export */ jspb.BinaryReader.prototype.readUint64 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readUnsignedVarint64(); }; @@ -729,7 +726,7 @@ jspb.BinaryReader.prototype.readUint64 = function() { * string. */ jspb.BinaryReader.prototype.readUint64String = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readUnsignedVarint64String(); }; @@ -744,7 +741,7 @@ jspb.BinaryReader.prototype.readUint64String = function() { * @export */ jspb.BinaryReader.prototype.readSint32 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readZigzagVarint32(); }; @@ -759,7 +756,7 @@ jspb.BinaryReader.prototype.readSint32 = function() { * @export */ jspb.BinaryReader.prototype.readSint64 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readZigzagVarint64(); }; @@ -770,10 +767,11 @@ jspb.BinaryReader.prototype.readSint64 = function() { * or throws an error if the next field in the stream is not of the correct * wire type. * - * @return {string} The value of the signed 64-bit integer field as a decimal string. + * @return {string} The value of the signed 64-bit integer field as a decimal + * string. */ jspb.BinaryReader.prototype.readSint64String = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readZigzagVarint64String(); }; @@ -788,7 +786,7 @@ jspb.BinaryReader.prototype.readSint64String = function() { * @export */ jspb.BinaryReader.prototype.readFixed32 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32); return this.decoder_.readUint32(); }; @@ -803,7 +801,7 @@ jspb.BinaryReader.prototype.readFixed32 = function() { * @export */ jspb.BinaryReader.prototype.readFixed64 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readUint64(); }; @@ -820,7 +818,7 @@ jspb.BinaryReader.prototype.readFixed64 = function() { * string. */ jspb.BinaryReader.prototype.readFixed64String = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readUint64String(); }; @@ -835,7 +833,7 @@ jspb.BinaryReader.prototype.readFixed64String = function() { * @export */ jspb.BinaryReader.prototype.readSfixed32 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32); return this.decoder_.readInt32(); }; @@ -850,7 +848,7 @@ jspb.BinaryReader.prototype.readSfixed32 = function() { * string. */ jspb.BinaryReader.prototype.readSfixed32String = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32); return this.decoder_.readInt32().toString(); }; @@ -865,7 +863,7 @@ jspb.BinaryReader.prototype.readSfixed32String = function() { * @export */ jspb.BinaryReader.prototype.readSfixed64 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readInt64(); }; @@ -881,7 +879,7 @@ jspb.BinaryReader.prototype.readSfixed64 = function() { * @return {string} The value of the sfixed64 field as a decimal string. */ jspb.BinaryReader.prototype.readSfixed64String = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readInt64String(); }; @@ -895,7 +893,7 @@ jspb.BinaryReader.prototype.readSfixed64String = function() { * @export */ jspb.BinaryReader.prototype.readFloat = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32); return this.decoder_.readFloat(); }; @@ -909,7 +907,7 @@ jspb.BinaryReader.prototype.readFloat = function() { * @export */ jspb.BinaryReader.prototype.readDouble = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readDouble(); }; @@ -923,7 +921,7 @@ jspb.BinaryReader.prototype.readDouble = function() { * @export */ jspb.BinaryReader.prototype.readBool = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return !!this.decoder_.readUnsignedVarint32(); }; @@ -937,7 +935,7 @@ jspb.BinaryReader.prototype.readBool = function() { * @export */ jspb.BinaryReader.prototype.readEnum = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint64(); }; @@ -951,7 +949,7 @@ jspb.BinaryReader.prototype.readEnum = function() { * @export */ jspb.BinaryReader.prototype.readString = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); var length = this.decoder_.readUnsignedVarint32(); return this.decoder_.readString(length); @@ -966,7 +964,7 @@ jspb.BinaryReader.prototype.readString = function() { * @export */ jspb.BinaryReader.prototype.readBytes = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); var length = this.decoder_.readUnsignedVarint32(); return this.decoder_.readBytes(length); @@ -981,7 +979,7 @@ jspb.BinaryReader.prototype.readBytes = function() { * @return {string} The hash value. */ jspb.BinaryReader.prototype.readVarintHash64 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readVarintHash64(); }; @@ -995,7 +993,7 @@ jspb.BinaryReader.prototype.readVarintHash64 = function() { * @return {string} The hash value. */ jspb.BinaryReader.prototype.readSintHash64 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readZigzagVarintHash64(); }; @@ -1012,7 +1010,7 @@ jspb.BinaryReader.prototype.readSintHash64 = function() { * @template T */ jspb.BinaryReader.prototype.readSplitVarint64 = function(convert) { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSplitVarint64(convert); }; @@ -1029,7 +1027,7 @@ jspb.BinaryReader.prototype.readSplitVarint64 = function(convert) { * @template T */ jspb.BinaryReader.prototype.readSplitZigzagVarint64 = function(convert) { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSplitVarint64(function(lowBits, highBits) { return jspb.utils.fromZigzag64(lowBits, highBits, convert); @@ -1045,7 +1043,7 @@ jspb.BinaryReader.prototype.readSplitZigzagVarint64 = function(convert) { * @return {string} The hash value. */ jspb.BinaryReader.prototype.readFixedHash64 = function() { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readFixedHash64(); }; @@ -1062,7 +1060,7 @@ jspb.BinaryReader.prototype.readFixedHash64 = function() { * @template T */ jspb.BinaryReader.prototype.readSplitFixed64 = function(convert) { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readSplitFixed64(convert); }; @@ -1075,7 +1073,7 @@ jspb.BinaryReader.prototype.readSplitFixed64 = function(convert) { * @private */ jspb.BinaryReader.prototype.readPackedField_ = function(decodeMethod) { - goog.asserts.assert( + jspb.asserts.jspbAssert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); var length = this.decoder_.readUnsignedVarint32(); var end = this.decoder_.getCursor() + length; diff --git a/binary/reader_test.js b/binary/reader_test.js index 6963f77..a4b4058 100644 --- a/binary/reader_test.js +++ b/binary/reader_test.js @@ -41,12 +41,12 @@ * @author aappleby@google.com (Austin Appleby) */ -goog.require('goog.testing.asserts'); goog.require('jspb.BinaryConstants'); goog.require('jspb.BinaryDecoder'); goog.require('jspb.BinaryReader'); goog.require('jspb.BinaryWriter'); goog.require('jspb.utils'); + goog.requireType('jspb.BinaryMessage'); @@ -55,12 +55,12 @@ describe('binaryReaderTest', function() { * Tests the reader instance cache. */ it('testInstanceCaches', /** @suppress {visibility} */ function() { - var writer = new jspb.BinaryWriter(); - var dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); + const writer = new jspb.BinaryWriter(); + const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); writer.writeMessage(1, dummyMessage, () => {}); writer.writeMessage(2, dummyMessage, () => {}); - var buffer = writer.getResultBuffer(); + const buffer = writer.getResultBuffer(); // Empty the instance caches. jspb.BinaryReader.instanceCache_ = []; @@ -68,53 +68,53 @@ describe('binaryReaderTest', function() { // Allocating and then freeing three decoders should leave us with three in // the cache. - var decoder1 = jspb.BinaryDecoder.alloc(); - var decoder2 = jspb.BinaryDecoder.alloc(); - var decoder3 = jspb.BinaryDecoder.alloc(); + const decoder1 = jspb.BinaryDecoder.alloc(); + const decoder2 = jspb.BinaryDecoder.alloc(); + const decoder3 = jspb.BinaryDecoder.alloc(); decoder1.free(); decoder2.free(); decoder3.free(); - assertEquals(3, jspb.BinaryDecoder.instanceCache_.length); - assertEquals(0, jspb.BinaryReader.instanceCache_.length); + expect(jspb.BinaryDecoder.instanceCache_.length).toEqual(3); + expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); // Allocating and then freeing a reader should remove one decoder from its // cache, but it should stay stuck to the reader afterwards since we can't // have a reader without a decoder. jspb.BinaryReader.alloc().free(); - assertEquals(2, jspb.BinaryDecoder.instanceCache_.length); - assertEquals(1, jspb.BinaryReader.instanceCache_.length); + expect(jspb.BinaryDecoder.instanceCache_.length).toEqual(2); + expect(jspb.BinaryReader.instanceCache_.length).toEqual(1); // Allocating a reader should remove a reader from the cache. - var reader = jspb.BinaryReader.alloc(buffer); + const reader = jspb.BinaryReader.alloc(buffer); - assertEquals(2, jspb.BinaryDecoder.instanceCache_.length); - assertEquals(0, jspb.BinaryReader.instanceCache_.length); + expect(jspb.BinaryDecoder.instanceCache_.length).toEqual(2); + expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); // Processing the message reuses the current reader. reader.nextField(); - assertEquals(1, reader.getFieldNumber()); + expect(reader.getFieldNumber()).toEqual(1); reader.readMessage(dummyMessage, function() { - assertEquals(0, jspb.BinaryReader.instanceCache_.length); + expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); }); reader.nextField(); - assertEquals(2, reader.getFieldNumber()); + expect(reader.getFieldNumber()).toEqual(2); reader.readMessage(dummyMessage, function() { - assertEquals(0, jspb.BinaryReader.instanceCache_.length); + expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); }); - assertEquals(false, reader.nextField()); + expect(reader.nextField()).toEqual(false); - assertEquals(2, jspb.BinaryDecoder.instanceCache_.length); - assertEquals(0, jspb.BinaryReader.instanceCache_.length); + expect(jspb.BinaryDecoder.instanceCache_.length).toEqual(2); + expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); // Freeing the reader should put it back into the cache. reader.free(); - assertEquals(2, jspb.BinaryDecoder.instanceCache_.length); - assertEquals(1, jspb.BinaryReader.instanceCache_.length); + expect(jspb.BinaryDecoder.instanceCache_.length).toEqual(2); + expect(jspb.BinaryReader.instanceCache_.length).toEqual(1); }); @@ -123,7 +123,7 @@ describe('binaryReaderTest', function() { * @return {number} */ function truncate(x) { - var temp = new Float32Array(1); + const temp = new Float32Array(1); temp[0] = x; return temp[0]; } @@ -135,101 +135,101 @@ describe('binaryReaderTest', function() { it('testReadErrors', /** @suppress {checkTypes|visibility} */ function() { // Calling readMessage on a non-delimited field should trigger an // assertion. - var reader = jspb.BinaryReader.alloc([8, 1]); - var dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); + let reader = jspb.BinaryReader.alloc([8, 1]); + const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); reader.nextField(); - assertThrows(function() { + expect(function() { reader.readMessage(dummyMessage, () => {}); - }); + }).toThrow(); // Reading past the end of the stream should trigger an assertion. reader = jspb.BinaryReader.alloc([9, 1]); reader.nextField(); - assertThrows(function() { + expect(function() { reader.readFixed64() - }); + }).toThrow(); // Reading past the end of a submessage should trigger an assertion. reader = jspb.BinaryReader.alloc([10, 4, 13, 1, 1, 1]); reader.nextField(); reader.readMessage(dummyMessage, function() { reader.nextField(); - assertThrows(function() { + expect(function() { reader.readFixed32() - }); + }).toThrow(); }); // Skipping an invalid field should trigger an assertion. reader = jspb.BinaryReader.alloc([12, 1]); reader.nextWireType_ = 1000; - assertThrows(function() { + expect(function() { reader.skipField() - }); + }).toThrow(); // Reading fields with the wrong wire type should assert. reader = jspb.BinaryReader.alloc([9, 0, 0, 0, 0, 0, 0, 0, 0]); reader.nextField(); - assertThrows(function() { + expect(function() { reader.readInt32() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readInt32String() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readInt64() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readInt64String() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readUint32() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readUint32String() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readUint64() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readUint64String() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readSint32() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readBool() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readEnum() - }); + }).toThrow(); reader = jspb.BinaryReader.alloc([8, 1]); reader.nextField(); - assertThrows(function() { + expect(function() { reader.readFixed32() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readFixed64() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readSfixed32() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readSfixed64() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readFloat() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readDouble() - }); + }).toThrow(); - assertThrows(function() { + expect(function() { reader.readString() - }); - assertThrows(function() { + }).toThrow(); + expect(function() { reader.readBytes() - }); + }).toThrow(); }); @@ -243,12 +243,12 @@ describe('binaryReaderTest', function() { * @private * @suppress {missingProperties} */ - var doTestUnsignedField_ = function( + const doTestUnsignedField_ = function( readField, writeField, epsilon, upperLimit, filter) { - assertNotNull(readField); - assertNotNull(writeField); + expect(readField).not.toBeNull(); + expect(writeField).not.toBeNull(); - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); // Encode zero and limits. writeField.call(writer, 1, filter(0)); @@ -256,27 +256,27 @@ describe('binaryReaderTest', function() { writeField.call(writer, 3, filter(upperLimit)); // Encode positive values. - for (var cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { + for (let cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { writeField.call(writer, 4, filter(cursor)); } - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); // Check zero and limits. reader.nextField(); - assertEquals(1, reader.getFieldNumber()); - assertEquals(filter(0), readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(1); + expect(readField.call(reader)).toEqual(filter(0)); reader.nextField(); - assertEquals(2, reader.getFieldNumber()); - assertEquals(filter(epsilon), readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(2); + expect(readField.call(reader)).toEqual(filter(epsilon)); reader.nextField(); - assertEquals(3, reader.getFieldNumber()); - assertEquals(filter(upperLimit), readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(3); + expect(readField.call(reader)).toEqual(filter(upperLimit)); // Check positive values. - for (var cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { + for (let cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { reader.nextField(); if (4 != reader.getFieldNumber()) throw 'fail!'; if (filter(cursor) != readField.call(reader)) throw 'fail!'; @@ -295,9 +295,9 @@ describe('binaryReaderTest', function() { * @private * @suppress {missingProperties} */ - var doTestSignedField_ = function( + const doTestSignedField_ = function( readField, writeField, epsilon, lowerLimit, upperLimit, filter) { - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); // Encode zero and limits. writeField.call(writer, 1, filter(lowerLimit)); @@ -306,50 +306,50 @@ describe('binaryReaderTest', function() { writeField.call(writer, 4, filter(epsilon)); writeField.call(writer, 5, filter(upperLimit)); - var inputValues = []; + const inputValues = []; // Encode negative values. - for (var cursor = lowerLimit; cursor < -epsilon; cursor /= 1.1) { - var val = filter(cursor); + for (let cursor = lowerLimit; cursor < -epsilon; cursor /= 1.1) { + const val = filter(cursor); writeField.call(writer, 6, val); inputValues.push({fieldNumber: 6, value: val}); } // Encode positive values. - for (var cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { - var val = filter(cursor); + for (let cursor = epsilon; cursor < upperLimit; cursor *= 1.1) { + const val = filter(cursor); writeField.call(writer, 7, val); inputValues.push({fieldNumber: 7, value: val}); } - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); // Check zero and limits. reader.nextField(); - assertEquals(1, reader.getFieldNumber()); - assertEquals(filter(lowerLimit), readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(1); + expect(readField.call(reader)).toEqual(filter(lowerLimit)); reader.nextField(); - assertEquals(2, reader.getFieldNumber()); - assertEquals(filter(-epsilon), readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(2); + expect(readField.call(reader)).toEqual(filter(-epsilon)); reader.nextField(); - assertEquals(3, reader.getFieldNumber()); - assertEquals(filter(0), readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(3); + expect(readField.call(reader)).toEqual(filter(0)); reader.nextField(); - assertEquals(4, reader.getFieldNumber()); - assertEquals(filter(epsilon), readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(4); + expect(readField.call(reader)).toEqual(filter(epsilon)); reader.nextField(); - assertEquals(5, reader.getFieldNumber()); - assertEquals(filter(upperLimit), readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(5); + expect(readField.call(reader)).toEqual(filter(upperLimit)); - for (var i = 0; i < inputValues.length; i++) { - var expected = inputValues[i]; + for (let i = 0; i < inputValues.length; i++) { + const expected = inputValues[i]; reader.nextField(); - assertEquals(expected.fieldNumber, reader.getFieldNumber()); - assertEquals(expected.value, readField.call(reader)); + expect(reader.getFieldNumber()).toEqual(expected.fieldNumber); + expect(readField.call(reader)).toEqual(expected.value); } }; @@ -358,12 +358,12 @@ describe('binaryReaderTest', function() { * Tests fields that use varint encoding. */ it('testVarintFields', function() { - assertNotUndefined(jspb.BinaryReader.prototype.readUint32); - assertNotUndefined(jspb.BinaryWriter.prototype.writeUint32); - assertNotUndefined(jspb.BinaryReader.prototype.readUint64); - assertNotUndefined(jspb.BinaryWriter.prototype.writeUint64); - assertNotUndefined(jspb.BinaryReader.prototype.readBool); - assertNotUndefined(jspb.BinaryWriter.prototype.writeBool); + expect(jspb.BinaryReader.prototype.readUint32).not.toBeUndefined(); + expect(jspb.BinaryWriter.prototype.writeUint32).not.toBeUndefined(); + expect(jspb.BinaryReader.prototype.readUint64).not.toBeUndefined(); + expect(jspb.BinaryWriter.prototype.writeUint64).not.toBeUndefined(); + expect(jspb.BinaryReader.prototype.readBool).not.toBeUndefined(); + expect(jspb.BinaryWriter.prototype.writeBool).not.toBeUndefined(); doTestUnsignedField_( jspb.BinaryReader.prototype.readUint32, jspb.BinaryWriter.prototype.writeUint32, 1, Math.pow(2, 32) - 1, @@ -404,14 +404,14 @@ describe('binaryReaderTest', function() { * @param {string} hexString */ function doTestHexStringVarint_(readField, expected, hexString) { - var bytesCount = (hexString.length + 1) / 3; - var bytes = new Uint8Array(bytesCount); - for (var i = 0; i < bytesCount; i++) { + const bytesCount = (hexString.length + 1) / 3; + const bytes = new Uint8Array(bytesCount); + for (let i = 0; i < bytesCount; i++) { bytes[i] = parseInt(hexString.substring(i * 3, i * 3 + 2), 16); } - var reader = jspb.BinaryReader.alloc(bytes); + const reader = jspb.BinaryReader.alloc(bytes); reader.nextField(); - assertEquals(expected, readField.call(reader)); + expect(readField.call(reader)).toEqual(expected); } @@ -419,10 +419,10 @@ describe('binaryReaderTest', function() { * Tests non-canonical redundant varint decoding. */ it('testRedundantVarintFields', function() { - assertNotNull(jspb.BinaryReader.prototype.readUint32); - assertNotNull(jspb.BinaryReader.prototype.readUint64); - assertNotNull(jspb.BinaryReader.prototype.readSint32); - assertNotNull(jspb.BinaryReader.prototype.readSint64); + expect(jspb.BinaryReader.prototype.readUint32).not.toBeNull(); + expect(jspb.BinaryReader.prototype.readUint64).not.toBeNull(); + expect(jspb.BinaryReader.prototype.readSint32).not.toBeNull(); + expect(jspb.BinaryReader.prototype.readSint64).not.toBeNull(); // uint32 and sint32 take no more than 5 bytes // 08 - field prefix (type = 0 means varint) @@ -449,11 +449,11 @@ describe('binaryReaderTest', function() { * Tests reading 64-bit integers as split values. */ it('handles split 64 fields', function() { - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); writer.writeInt64String(1, '4294967296'); writer.writeSfixed64String(2, '4294967298'); writer.writeInt64String(3, '3'); // 3 is the zig-zag encoding of -2. - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); function rejoin(lowBits, highBits) { return highBits * 2 ** 32 + (lowBits >>> 0); @@ -475,35 +475,35 @@ describe('binaryReaderTest', function() { * Tests 64-bit fields that are handled as strings. */ it('testStringInt64Fields', function() { - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); - var testSignedData = [ + const testSignedData = [ '2730538252207801776', '-2688470994844604560', '3398529779486536359', '3568577411627971000', '272477188847484900', '-6649058714086158188', '-7695254765712060806', '-4525541438037104029', '-4993706538836508568', '4990160321893729138' ]; - var testUnsignedData = [ + const testUnsignedData = [ '7822732630241694882', '6753602971916687352', '2399935075244442116', '8724292567325338867', '16948784802625696584', '4136275908516066934', '3575388346793700364', '5167142028379259461', '1557573948689737699', '17100725280812548567' ]; - for (var i = 0; i < testSignedData.length; i++) { + for (let i = 0; i < testSignedData.length; i++) { writer.writeInt64String(2 * i + 1, testSignedData[i]); writer.writeUint64String(2 * i + 2, testUnsignedData[i]); } - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); - for (var i = 0; i < testSignedData.length; i++) { + for (let i = 0; i < testSignedData.length; i++) { reader.nextField(); - assertEquals(2 * i + 1, reader.getFieldNumber()); - assertEquals(testSignedData[i], reader.readInt64String()); + expect(reader.getFieldNumber()).toEqual(2 * i + 1); + expect(testSignedData[i]).toEqual(reader.readInt64String()); reader.nextField(); - assertEquals(2 * i + 2, reader.getFieldNumber()); - assertEquals(testUnsignedData[i], reader.readUint64String()); + expect(reader.getFieldNumber()).toEqual(2 * i + 2); + expect(testUnsignedData[i]).toEqual(reader.readUint64String()); } }); @@ -580,23 +580,23 @@ describe('binaryReaderTest', function() { * Tests length-delimited string fields. */ it('testStringFields', function() { - var s1 = 'The quick brown fox jumps over the lazy dog.'; - var s2 = '人人生而自由,在尊嚴和權利上一律平等。'; + const s1 = 'The quick brown fox jumps over the lazy dog.'; + const s2 = '人人生而自由,在尊嚴和權利上一律平等。'; - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); writer.writeString(1, s1); writer.writeString(2, s2); - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); reader.nextField(); - assertEquals(1, reader.getFieldNumber()); - assertEquals(s1, reader.readString()); + expect(reader.getFieldNumber()).toEqual(1); + expect(reader.readString()).toEqual(s1); reader.nextField(); - assertEquals(2, reader.getFieldNumber()); - assertEquals(s2, reader.readString()); + expect(reader.getFieldNumber()).toEqual(2); + expect(reader.readString()).toEqual(s2); }); @@ -604,30 +604,30 @@ describe('binaryReaderTest', function() { * Tests length-delimited byte fields. */ it('testByteFields', function() { - var message = []; - var lowerLimit = 1; - var upperLimit = 256; - var scale = 1.1; + const message = []; + const lowerLimit = 1; + const upperLimit = 256; + const scale = 1.1; - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); - for (var cursor = lowerLimit; cursor < upperLimit; cursor *= 1.1) { - var len = Math.round(cursor); - var bytes = []; - for (var i = 0; i < len; i++) bytes.push(i % 256); + for (let cursor = lowerLimit; cursor < upperLimit; cursor *= 1.1) { + const len = Math.round(cursor); + const bytes = []; + for (let i = 0; i < len; i++) bytes.push(i % 256); writer.writeBytes(len, bytes); } - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); - for (var cursor = lowerLimit; reader.nextField(); cursor *= 1.1) { - var len = Math.round(cursor); + for (let cursor = lowerLimit; reader.nextField(); cursor *= 1.1) { + const len = Math.round(cursor); if (len != reader.getFieldNumber()) throw 'fail!'; - var bytes = reader.readBytes(); + const bytes = reader.readBytes(); if (len != bytes.length) throw 'fail!'; - for (var i = 0; i < bytes.length; i++) { + for (let i = 0; i < bytes.length; i++) { if (i % 256 != bytes[i]) throw 'fail!'; } } @@ -638,8 +638,8 @@ describe('binaryReaderTest', function() { * Tests nested messages. */ it('testNesting', function() { - var writer = new jspb.BinaryWriter(); - var dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); + const writer = new jspb.BinaryWriter(); + const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); writer.writeInt32(1, 100); @@ -655,46 +655,46 @@ describe('binaryReaderTest', function() { writer.writeInt32(7, 700); - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); // Validate outermost message. reader.nextField(); - assertEquals(1, reader.getFieldNumber()); - assertEquals(100, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(1); + expect(100).toEqual(reader.readInt32()); reader.nextField(); - assertEquals(2, reader.getFieldNumber()); + expect(reader.getFieldNumber()).toEqual(2); reader.readMessage(dummyMessage, function() { // Validate embedded message 1. reader.nextField(); - assertEquals(3, reader.getFieldNumber()); - assertEquals(300, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(3); + expect(300).toEqual(reader.readInt32()); reader.nextField(); - assertEquals(4, reader.getFieldNumber()); - assertEquals(400, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(4); + expect(400).toEqual(reader.readInt32()); reader.nextField(); - assertEquals(5, reader.getFieldNumber()); - assertEquals(500, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(5); + expect(500).toEqual(reader.readInt32()); - assertEquals(false, reader.nextField()); + expect(reader.nextField()).toEqual(false); }); reader.nextField(); - assertEquals(6, reader.getFieldNumber()); + expect(reader.getFieldNumber()).toEqual(6); reader.readMessage(dummyMessage, function() { // Validate embedded message 2. - assertEquals(false, reader.nextField()); + expect(reader.nextField()).toEqual(false); }); reader.nextField(); - assertEquals(7, reader.getFieldNumber()); - assertEquals(700, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(7); + expect(700).toEqual(reader.readInt32()); - assertEquals(false, reader.nextField()); + expect(reader.nextField()).toEqual(false); }); /** @@ -702,9 +702,9 @@ describe('binaryReaderTest', function() { * values and skipping everything that's not a sentinel. */ it('testSkipField', function() { - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); - var sentinel = 123456789; + const sentinel = 123456789; // Write varint fields of different sizes. writer.writeInt32(1, sentinel); @@ -732,7 +732,7 @@ describe('binaryReaderTest', function() { // Write a group with a nested group inside. writer.writeInt32(5, sentinel); - var dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); + const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); writer.writeGroup(5, dummyMessage, function() { // Previously the skipGroup implementation was wrong, which only consume // the decoder by nextField. This case is for making the previous @@ -758,10 +758,10 @@ describe('binaryReaderTest', function() { // Write final sentinel. writer.writeInt32(6, sentinel); - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); function skip(field, count) { - for (var i = 0; i < count; i++) { + for (let i = 0; i < count; i++) { reader.nextField(); if (field != reader.getFieldNumber()) throw 'fail!'; reader.skipField(); @@ -769,33 +769,33 @@ describe('binaryReaderTest', function() { } reader.nextField(); - assertEquals(1, reader.getFieldNumber()); - assertEquals(sentinel, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(1); + expect(sentinel).toEqual(reader.readInt32()); skip(1, 4); reader.nextField(); - assertEquals(2, reader.getFieldNumber()); - assertEquals(sentinel, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(2); + expect(sentinel).toEqual(reader.readInt32()); skip(2, 3); reader.nextField(); - assertEquals(3, reader.getFieldNumber()); - assertEquals(sentinel, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(3); + expect(sentinel).toEqual(reader.readInt32()); skip(3, 3); reader.nextField(); - assertEquals(4, reader.getFieldNumber()); - assertEquals(sentinel, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(4); + expect(sentinel).toEqual(reader.readInt32()); skip(4, 2); reader.nextField(); - assertEquals(5, reader.getFieldNumber()); - assertEquals(sentinel, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(5); + expect(sentinel).toEqual(reader.readInt32()); skip(5, 1); reader.nextField(); - assertEquals(6, reader.getFieldNumber()); - assertEquals(sentinel, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(6); + expect(sentinel).toEqual(reader.readInt32()); }); @@ -803,17 +803,17 @@ describe('binaryReaderTest', function() { * Tests packed fields. */ it('testPackedFields', function() { - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); - var sentinel = 123456789; + const sentinel = 123456789; - var unsignedData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - var signedData = [-1, 2, -3, 4, -5, 6, -7, 8, -9, 10]; - var floatData = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.10]; - var doubleData = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.10]; - var boolData = [true, false, true, true, false, false, true, false]; + const unsignedData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + const signedData = [-1, 2, -3, 4, -5, 6, -7, 8, -9, 10]; + const floatData = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.10]; + const doubleData = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.10]; + const boolData = [true, false, true, true, false, false, true, false]; - for (var i = 0; i < floatData.length; i++) { + for (let i = 0; i < floatData.length; i++) { floatData[i] = truncate(floatData[i]); } @@ -836,55 +836,55 @@ describe('binaryReaderTest', function() { writer.writeInt32(3, sentinel); - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); reader.nextField(); - assertEquals(sentinel, reader.readInt32()); + expect(sentinel).toEqual(reader.readInt32()); reader.nextField(); - assertElementsEquals(reader.readPackedInt32(), signedData); + expect(signedData).toEqual(reader.readPackedInt32()); reader.nextField(); - assertElementsEquals(reader.readPackedInt64(), signedData); + expect(signedData).toEqual(reader.readPackedInt64()); reader.nextField(); - assertElementsEquals(reader.readPackedUint32(), unsignedData); + expect(unsignedData).toEqual(reader.readPackedUint32()); reader.nextField(); - assertElementsEquals(reader.readPackedUint64(), unsignedData); + expect(unsignedData).toEqual(reader.readPackedUint64()); reader.nextField(); - assertElementsEquals(reader.readPackedSint32(), signedData); + expect(signedData).toEqual(reader.readPackedSint32()); reader.nextField(); - assertElementsEquals(reader.readPackedSint64(), signedData); + expect(signedData).toEqual(reader.readPackedSint64()); reader.nextField(); - assertElementsEquals(reader.readPackedFixed32(), unsignedData); + expect(unsignedData).toEqual(reader.readPackedFixed32()); reader.nextField(); - assertElementsEquals(reader.readPackedFixed64(), unsignedData); + expect(unsignedData).toEqual(reader.readPackedFixed64()); reader.nextField(); - assertElementsEquals(reader.readPackedSfixed32(), signedData); + expect(signedData).toEqual(reader.readPackedSfixed32()); reader.nextField(); - assertElementsEquals(reader.readPackedSfixed64(), signedData); + expect(signedData).toEqual(reader.readPackedSfixed64()); reader.nextField(); - assertElementsEquals(reader.readPackedFloat(), floatData); + expect(floatData).toEqual(reader.readPackedFloat()); reader.nextField(); - assertElementsEquals(reader.readPackedDouble(), doubleData); + expect(doubleData).toEqual(reader.readPackedDouble()); reader.nextField(); - assertElementsEquals(reader.readPackedBool(), boolData); + expect(boolData).toEqual(reader.readPackedBool()); reader.nextField(); - assertElementsEquals(reader.readPackedEnum(), unsignedData); + expect(unsignedData).toEqual(reader.readPackedEnum()); reader.nextField(); - assertEquals(sentinel, reader.readInt32()); + expect(sentinel).toEqual(reader.readInt32()); }); @@ -897,10 +897,10 @@ describe('binaryReaderTest', function() { // Create a proto consisting of two nested messages, with the inner one // containing a blob of bytes. - var fieldTag = (1 << 3) | jspb.BinaryConstants.WireType.DELIMITED; - var blob = [1, 2, 3, 4, 5]; - var writer = new jspb.BinaryWriter(); - var dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); + const fieldTag = (1 << 3) | jspb.BinaryConstants.WireType.DELIMITED; + const blob = [1, 2, 3, 4, 5]; + const writer = new jspb.BinaryWriter(); + const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); writer.writeMessage(1, dummyMessage, function() { writer.writeMessage(1, dummyMessage, function() { @@ -912,19 +912,20 @@ describe('binaryReaderTest', function() { // of overhead, one for the field tag and one for the length of the inner // blob. - var decoder1 = new jspb.BinaryDecoder(writer.getResultBuffer()); - assertEquals(fieldTag, decoder1.readUnsignedVarint32()); - assertEquals(blob.length + 4, decoder1.readUnsignedVarint32()); + const decoder1 = new jspb.BinaryDecoder(writer.getResultBuffer()); + expect(fieldTag).toEqual(decoder1.readUnsignedVarint32()); + expect(blob.length + 4).toEqual(decoder1.readUnsignedVarint32()); - var decoder2 = new jspb.BinaryDecoder(decoder1.readBytes(blob.length + 4)); - assertEquals(fieldTag, decoder2.readUnsignedVarint32()); - assertEquals(blob.length + 2, decoder2.readUnsignedVarint32()); + const decoder2 = + new jspb.BinaryDecoder(decoder1.readBytes(blob.length + 4)); + expect(fieldTag).toEqual(decoder2.readUnsignedVarint32()); + expect(blob.length + 2).toEqual(decoder2.readUnsignedVarint32()); - assertEquals(fieldTag, decoder2.readUnsignedVarint32()); - assertEquals(blob.length, decoder2.readUnsignedVarint32()); - var bytes = decoder2.readBytes(blob.length); + expect(fieldTag).toEqual(decoder2.readUnsignedVarint32()); + expect(blob.length).toEqual(decoder2.readUnsignedVarint32()); + const bytes = decoder2.readBytes(blob.length); - assertElementsEquals(bytes, blob); + expect(Uint8Array.from(blob)).toEqual(bytes); }); @@ -932,8 +933,8 @@ describe('binaryReaderTest', function() { * Tests read callbacks. */ it('testReadCallbacks', function() { - var writer = new jspb.BinaryWriter(); - var dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); + const writer = new jspb.BinaryWriter(); + const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); // Add an int, a submessage, and another int. writer.writeInt32(1, 100); @@ -947,7 +948,7 @@ describe('binaryReaderTest', function() { writer.writeInt32(7, 700); // Create the reader and register a custom read callback. - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); /** * @param {!jspb.BinaryReader} reader @@ -955,38 +956,38 @@ describe('binaryReaderTest', function() { */ function readCallback(reader) { reader.nextField(); - assertEquals(3, reader.getFieldNumber()); - assertEquals(300, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(3); + expect(300).toEqual(reader.readInt32()); reader.nextField(); - assertEquals(4, reader.getFieldNumber()); - assertEquals(400, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(4); + expect(400).toEqual(reader.readInt32()); reader.nextField(); - assertEquals(5, reader.getFieldNumber()); - assertEquals(500, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(5); + expect(500).toEqual(reader.readInt32()); - assertEquals(false, reader.nextField()); + expect(reader.nextField()).toEqual(false); }; reader.registerReadCallback('readCallback', readCallback); // Read the container message. reader.nextField(); - assertEquals(1, reader.getFieldNumber()); - assertEquals(100, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(1); + expect(100).toEqual(reader.readInt32()); reader.nextField(); - assertEquals(2, reader.getFieldNumber()); + expect(reader.getFieldNumber()).toEqual(2); reader.readMessage(dummyMessage, function() { // Decode the embedded message using the registered callback. reader.runReadCallback('readCallback'); }); reader.nextField(); - assertEquals(7, reader.getFieldNumber()); - assertEquals(700, reader.readInt32()); + expect(reader.getFieldNumber()).toEqual(7); + expect(700).toEqual(reader.readInt32()); - assertEquals(false, reader.nextField()); + expect(reader.nextField()).toEqual(false); }); }); diff --git a/binary/utils.js b/binary/utils.js index d912305..5509d07 100644 --- a/binary/utils.js +++ b/binary/utils.js @@ -38,10 +38,11 @@ goog.provide('jspb.utils'); -goog.require('goog.asserts'); goog.require('goog.crypt'); goog.require('goog.crypt.base64'); goog.require('goog.string'); + +goog.require('jspb.asserts'); goog.require('jspb.BinaryConstants'); @@ -76,8 +77,8 @@ jspb.utils.split64High = 0; jspb.utils.splitUint64 = function(value) { // Extract low 32 bits and high 32 bits as unsigned integers. var lowBits = value >>> 0; - var highBits = Math.floor((value - lowBits) / - jspb.BinaryConstants.TWO_TO_32) >>> 0; + var highBits = + Math.floor((value - lowBits) / jspb.BinaryConstants.TWO_TO_32) >>> 0; jspb.utils.split64Low = lowBits; jspb.utils.split64High = highBits; @@ -96,8 +97,7 @@ jspb.utils.splitInt64 = function(value) { // Extract low 32 bits and high 32 bits as unsigned integers. var lowBits = value >>> 0; - var highBits = Math.floor((value - lowBits) / - jspb.BinaryConstants.TWO_TO_32); + var highBits = Math.floor((value - lowBits) / jspb.BinaryConstants.TWO_TO_32); highBits = highBits >>> 0; // Perform two's complement conversion if the sign bit was set. @@ -434,8 +434,7 @@ jspb.utils.joinFloat32 = function(bitsLow, bitsHigh) { // Denormal. return sign * Math.pow(2, -149) * mant; } else { - return sign * Math.pow(2, exp - 150) * - (mant + Math.pow(2, 23)); + return sign * Math.pow(2, exp - 150) * (mant + Math.pow(2, 23)); } }; @@ -465,7 +464,7 @@ jspb.utils.joinFloat64 = function(bitsLow, bitsHigh) { return sign * Math.pow(2, -1074) * mant; } else { return sign * Math.pow(2, exp - 1075) * - (mant + jspb.BinaryConstants.TWO_TO_52); + (mant + jspb.BinaryConstants.TWO_TO_52); } }; @@ -494,8 +493,7 @@ jspb.utils.joinHash64 = function(bitsLow, bitsHigh) { * @const {!Array} */ jspb.utils.DIGITS = [ - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' ]; /** @const @private {number} '0' */ @@ -603,9 +601,8 @@ jspb.utils.hash64ToDecimalString = function(hash, signed) { jspb.utils.splitHash64(hash); var bitsLow = jspb.utils.split64Low; var bitsHigh = jspb.utils.split64High; - return signed ? - jspb.utils.joinSignedDecimalString(bitsLow, bitsHigh) : - jspb.utils.joinUnsignedDecimalString(bitsLow, bitsHigh); + return signed ? jspb.utils.joinSignedDecimalString(bitsLow, bitsHigh) : + jspb.utils.joinUnsignedDecimalString(bitsLow, bitsHigh); }; @@ -633,7 +630,7 @@ jspb.utils.hash64ArrayToDecimalStrings = function(hashes, signed) { * @return {string} */ jspb.utils.decimalStringToHash64 = function(dec) { - goog.asserts.assert(dec.length > 0); + jspb.asserts.jspbAssert(dec.length > 0); // Check for minus sign. var minus = false; @@ -736,9 +733,9 @@ jspb.utils.hash64ToHexString = function(hash) { */ jspb.utils.hexStringToHash64 = function(hex) { hex = hex.toLowerCase(); - goog.asserts.assert(hex.length == 18); - goog.asserts.assert(hex[0] == '0'); - goog.asserts.assert(hex[1] == 'x'); + jspb.asserts.jspbAssert(hex.length == 18); + jspb.asserts.jspbAssert(hex[0] == '0'); + jspb.asserts.jspbAssert(hex[1] == 'x'); var result = ''; for (var i = 0; i < 8; i++) { @@ -777,8 +774,7 @@ jspb.utils.hash64ToNumber = function(hash, signed) { */ jspb.utils.numberToHash64 = function(value) { jspb.utils.splitInt64(value); - return jspb.utils.joinHash64(jspb.utils.split64Low, - jspb.utils.split64High); + return jspb.utils.joinHash64(jspb.utils.split64Low, jspb.utils.split64High); }; @@ -868,8 +864,7 @@ jspb.utils.countVarintFields = function(buffer, start, end, field) { * @return {number} The number of fields with a matching tag in the buffer. * @private */ -jspb.utils.countFixedFields_ = - function(buffer, start, end, tag, stride) { +jspb.utils.countFixedFields_ = function(buffer, start, end, tag, stride) { var count = 0; var cursor = start; @@ -1026,8 +1021,9 @@ jspb.utils.stringToByteArray = function(str) { for (var i = 0; i < str.length; i++) { var codepoint = str.charCodeAt(i); if (codepoint > 255) { - throw new Error('Conversion error: string contains codepoint ' + - 'outside of byte range'); + throw new Error( + 'Conversion error: string contains codepoint ' + + 'outside of byte range'); } arr[i] = codepoint; } @@ -1043,21 +1039,21 @@ jspb.utils.stringToByteArray = function(str) { */ jspb.utils.byteSourceToUint8Array = function(data) { if (data.constructor === Uint8Array) { - return /** @type {!Uint8Array} */(data); + return /** @type {!Uint8Array} */ (data); } if (data.constructor === ArrayBuffer) { - data = /** @type {!ArrayBuffer} */(data); - return /** @type {!Uint8Array} */(new Uint8Array(data)); + data = /** @type {!ArrayBuffer} */ (data); + return /** @type {!Uint8Array} */ (new Uint8Array(data)); } if (data.constructor === Array) { - data = /** @type {!Array} */(data); - return /** @type {!Uint8Array} */(new Uint8Array(data)); + data = /** @type {!Array} */ (data); + return /** @type {!Uint8Array} */ (new Uint8Array(data)); } if (data.constructor === String) { - data = /** @type {string} */(data); + data = /** @type {string} */ (data); return goog.crypt.base64.decodeStringToUint8Array(data); } @@ -1070,6 +1066,6 @@ jspb.utils.byteSourceToUint8Array = function(data) { new Uint8Array(data.buffer, data.byteOffset, data.byteLength)); } - goog.asserts.fail('Type not convertible to Uint8Array.'); - return /** @type {!Uint8Array} */(new Uint8Array(0)); + jspb.asserts.jspbFail('Type not convertible to Uint8Array.'); + return /** @type {!Uint8Array} */ (new Uint8Array(0)); }; diff --git a/binary/utils_test.js b/binary/utils_test.js index 995f129..3bafa42 100644 --- a/binary/utils_test.js +++ b/binary/utils_test.js @@ -48,7 +48,7 @@ goog.require('jspb.utils'); * @return {number} */ function truncate(x) { - var temp = new Float32Array(1); + const temp = new Float32Array(1); temp[0] = x; return temp[0]; } @@ -62,14 +62,10 @@ function truncate(x) { * @return {string} The encoded hash string, 8 bits per character. */ function toHashString(bitsLow, bitsHigh) { - return String.fromCharCode((bitsLow >>> 0) & 0xFF, - (bitsLow >>> 8) & 0xFF, - (bitsLow >>> 16) & 0xFF, - (bitsLow >>> 24) & 0xFF, - (bitsHigh >>> 0) & 0xFF, - (bitsHigh >>> 8) & 0xFF, - (bitsHigh >>> 16) & 0xFF, - (bitsHigh >>> 24) & 0xFF); + return String.fromCharCode( + (bitsLow >>> 0) & 0xFF, (bitsLow >>> 8) & 0xFF, (bitsLow >>> 16) & 0xFF, + (bitsLow >>> 24) & 0xFF, (bitsHigh >>> 0) & 0xFF, (bitsHigh >>> 8) & 0xFF, + (bitsHigh >>> 16) & 0xFF, (bitsHigh >>> 24) & 0xFF); } @@ -79,8 +75,7 @@ describe('binaryUtilsTest', function() { */ it('testDecimalConversion', function() { // Check some magic numbers. - var result = - jspb.utils.joinUnsignedDecimalString(0x89e80001, 0x8ac72304); + let result = jspb.utils.joinUnsignedDecimalString(0x89e80001, 0x8ac72304); expect(result).toEqual('10000000000000000001'); result = jspb.utils.joinUnsignedDecimalString(0xacd05f15, 0x1b69b4b); @@ -100,15 +95,15 @@ describe('binaryUtilsTest', function() { expect(result).toEqual('18446744073709551615'); // Check each bit of the low dword. - for (var i = 0; i < 32; i++) { - var low = (1 << i) >>> 0; + for (let i = 0; i < 32; i++) { + const low = (1 << i) >>> 0; result = jspb.utils.joinUnsignedDecimalString(low, 0); expect(result).toEqual('' + Math.pow(2, i)); } // Check the first 20 bits of the high dword. - for (var i = 0; i < 20; i++) { - var high = (1 << i) >>> 0; + for (let i = 0; i < 20; i++) { + const high = (1 << i) >>> 0; result = jspb.utils.joinUnsignedDecimalString(0, high); expect(result).toEqual('' + Math.pow(2, 32 + i)); } @@ -159,8 +154,8 @@ describe('binaryUtilsTest', function() { * Going from hash strings to decimal strings should also be lossless. */ it('testHashToDecimalConversion', function() { - var result; - var convert = jspb.utils.hash64ToDecimalString; + let result; + const convert = jspb.utils.hash64ToDecimalString; result = convert(toHashString(0x00000000, 0x00000000), false); expect(result).toEqual('0'); @@ -187,10 +182,13 @@ describe('binaryUtilsTest', function() { expect(result).toEqual('-123456789123456789'); // And converting arrays of hashes should work the same way. - result = jspb.utils.hash64ArrayToDecimalStrings([ - toHashString(0xFFFFFFFF, 0xFFFFFFFF), - toHashString(0x00000000, 0x80000000), - toHashString(0xacd05f15, 0x01b69b4b)], false); + result = jspb.utils.hash64ArrayToDecimalStrings( + [ + toHashString(0xFFFFFFFF, 0xFFFFFFFF), + toHashString(0x00000000, 0x80000000), + toHashString(0xacd05f15, 0x01b69b4b) + ], + false); expect(result.length).toEqual(3); expect(result[0]).toEqual('18446744073709551615'); expect(result[1]).toEqual('9223372036854775808'); @@ -201,8 +199,8 @@ describe('binaryUtilsTest', function() { * Going from decimal strings to hash strings should be lossless. */ it('testDecimalToHashConversion', function() { - var result; - var convert = jspb.utils.decimalStringToHash64; + let result; + const convert = jspb.utils.decimalStringToHash64; result = convert('0'); expect(result).toEqual(goog.crypt.byteArrayToString( @@ -237,8 +235,8 @@ describe('binaryUtilsTest', function() { * Going from hash strings to hex strings should be lossless. */ it('testHashToHexConversion', function() { - var result; - var convert = jspb.utils.hash64ToHexString; + let result; + const convert = jspb.utils.hash64ToHexString; result = convert(toHashString(0x00000000, 0x00000000)); expect(result).toEqual('0x0000000000000000'); @@ -255,8 +253,8 @@ describe('binaryUtilsTest', function() { * Going from hex strings to hash strings should be lossless. */ it('testHexToHashConversion', function() { - var result; - var convert = jspb.utils.hexStringToHash64; + let result; + const convert = jspb.utils.hexStringToHash64; result = convert('0x0000000000000000'); expect(result).toEqual(goog.crypt.byteArrayToString( @@ -283,8 +281,8 @@ describe('binaryUtilsTest', function() { * precision. */ it('testNumberToHashConversion', function() { - var result; - var convert = jspb.utils.numberToHash64; + let result; + const convert = jspb.utils.numberToHash64; result = convert(0x0000000000000); expect(jspb.utils.hash64ToHexString(result)).toEqual('0x0000000000000000'); @@ -314,12 +312,12 @@ describe('binaryUtilsTest', function() { * with unicode characters. */ it('sanityCheckUnicodeStrings', function() { - var strings = new Array(65536); + const strings = new Array(65536); // All possible unsigned 16-bit values should be storable in a string, they // shouldn't do weird things with the length of the string, and they should // come back out of the string unchanged. - for (var i = 0; i < 65536; i++) { + for (let i = 0; i < 65536; i++) { strings[i] = 'a' + String.fromCharCode(i) + 'a'; expect(strings[i].length).toEqual(3); expect(strings[i].charCodeAt(1)).toEqual(i); @@ -327,7 +325,7 @@ describe('binaryUtilsTest', function() { // Each unicode character should compare equal to itself and not equal to a // different unicode character. - for (var i = 0; i < 65536; i++) { + for (let i = 0; i < 65536; i++) { expect(strings[i] == strings[i]).toEqual(true); expect(strings[i] == strings[(i + 1) % 65536]).toEqual(false); } @@ -338,11 +336,11 @@ describe('binaryUtilsTest', function() { * Tests conversion from 32-bit floating point numbers to split64 numbers. */ it('testFloat32ToSplit64', function() { - var f32_eps = jspb.BinaryConstants.FLOAT32_EPS; - var f32_min = jspb.BinaryConstants.FLOAT32_MIN; - var f32_max = jspb.BinaryConstants.FLOAT32_MAX; - var f32_max_safe_int = jspb.utils.joinFloat32(0x4b7fffff, 0); - var f32_pi = Math.fround(Math.PI); + const f32_eps = jspb.BinaryConstants.FLOAT32_EPS; + const f32_min = jspb.BinaryConstants.FLOAT32_MIN; + const f32_max = jspb.BinaryConstants.FLOAT32_MAX; + const f32_max_safe_int = jspb.utils.joinFloat32(0x4b7fffff, 0); + const f32_pi = Math.fround(Math.PI); // NaN. jspb.utils.splitFloat32(NaN); @@ -397,7 +395,7 @@ describe('binaryUtilsTest', function() { test(Math.sin(30 * Math.PI / 180), 0x3f000000); // sin(30 degrees) // Various positive values. - var cursor = f32_eps * 10; + let cursor = f32_eps * 10; while (cursor != Infinity) { test(cursor); cursor *= 1.1; @@ -416,9 +414,9 @@ describe('binaryUtilsTest', function() { * Tests conversion from 64-bit floating point numbers to split64 numbers. */ it('testFloat64ToSplit64', function() { - var f64_eps = jspb.BinaryConstants.FLOAT64_EPS; - var f64_min = jspb.BinaryConstants.FLOAT64_MIN; - var f64_max = jspb.BinaryConstants.FLOAT64_MAX; + const f64_eps = jspb.BinaryConstants.FLOAT64_EPS; + const f64_min = jspb.BinaryConstants.FLOAT64_MIN; + const f64_max = jspb.BinaryConstants.FLOAT64_MAX; // NaN. jspb.utils.splitFloat64(NaN); @@ -434,11 +432,11 @@ describe('binaryUtilsTest', function() { function test(x, opt_highBits, opt_lowBits) { jspb.utils.splitFloat64(x); if (opt_highBits !== undefined) { - var split64High = jspb.utils.split64High; + const split64High = jspb.utils.split64High; expect(opt_highBits.toString(16)).toEqual(split64High.toString(16)); } if (opt_lowBits !== undefined) { - var split64Low = jspb.utils.split64Low; + const split64Low = jspb.utils.split64Low; expect(opt_lowBits.toString(16)).toEqual(split64Low.toString(16)); } expect( @@ -483,7 +481,7 @@ describe('binaryUtilsTest', function() { test(jspb.BinaryConstants.FLOAT32_MIN, 0x38100000, 0x00000000); // Various positive values. - var cursor = f64_eps * 10; + let cursor = f64_eps * 10; while (cursor != Infinity) { test(cursor); cursor *= 1.1; @@ -513,7 +511,7 @@ describe('binaryUtilsTest', function() { } // Test cases directly from the protobuf dev guide. // https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types - var testCases = [ + const testCases = [ {original: stringToHiLoPair('0'), zigzag: stringToHiLoPair('0')}, {original: stringToHiLoPair('-1'), zigzag: stringToHiLoPair('1')}, {original: stringToHiLoPair('1'), zigzag: stringToHiLoPair('2')}, @@ -549,15 +547,15 @@ describe('binaryUtilsTest', function() { * Tests counting packed varints. */ it('testCountVarints', function() { - var values = []; - for (var i = 1; i < 1000000000; i *= 1.1) { + const values = []; + for (let i = 1; i < 1000000000; i *= 1.1) { values.push(Math.floor(i)); } - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); writer.writePackedUint64(1, values); - var buffer = new Uint8Array(writer.getResultBuffer()); + const buffer = new Uint8Array(writer.getResultBuffer()); // We should have two more varints than we started with - one for the field // tag, one for the packed length. @@ -570,23 +568,23 @@ describe('binaryUtilsTest', function() { * Tests counting matching varint fields. */ it('testCountVarintFields', function() { - var writer = new jspb.BinaryWriter(); + let writer = new jspb.BinaryWriter(); - var count = 0; - for (var i = 1; i < 1000000000; i *= 1.1) { + let count = 0; + for (let i = 1; i < 1000000000; i *= 1.1) { writer.writeUint64(1, Math.floor(i)); count++; } writer.writeString(2, 'terminator'); - var buffer = new Uint8Array(writer.getResultBuffer()); + let buffer = new Uint8Array(writer.getResultBuffer()); expect(jspb.utils.countVarintFields(buffer, 0, buffer.length, 1)) .toEqual(count); writer = new jspb.BinaryWriter(); count = 0; - for (var i = 1; i < 1000000000; i *= 1.1) { + for (let i = 1; i < 1000000000; i *= 1.1) { writer.writeUint64(123456789, Math.floor(i)); count++; } @@ -602,23 +600,23 @@ describe('binaryUtilsTest', function() { * Tests counting matching fixed32 fields. */ it('testCountFixed32Fields', function() { - var writer = new jspb.BinaryWriter(); + let writer = new jspb.BinaryWriter(); - var count = 0; - for (var i = 1; i < 1000000000; i *= 1.1) { + let count = 0; + for (let i = 1; i < 1000000000; i *= 1.1) { writer.writeFixed32(1, Math.floor(i)); count++; } writer.writeString(2, 'terminator'); - var buffer = new Uint8Array(writer.getResultBuffer()); + let buffer = new Uint8Array(writer.getResultBuffer()); expect(jspb.utils.countFixed32Fields(buffer, 0, buffer.length, 1)) .toEqual(count); writer = new jspb.BinaryWriter(); count = 0; - for (var i = 1; i < 1000000000; i *= 1.1) { + for (let i = 1; i < 1000000000; i *= 1.1) { writer.writeFixed32(123456789, Math.floor(i)); count++; } @@ -634,23 +632,23 @@ describe('binaryUtilsTest', function() { * Tests counting matching fixed64 fields. */ it('testCountFixed64Fields', function() { - var writer = new jspb.BinaryWriter(); + let writer = new jspb.BinaryWriter(); - var count = 0; - for (var i = 1; i < 1000000000; i *= 1.1) { + let count = 0; + for (let i = 1; i < 1000000000; i *= 1.1) { writer.writeDouble(1, i); count++; } writer.writeString(2, 'terminator'); - var buffer = new Uint8Array(writer.getResultBuffer()); + let buffer = new Uint8Array(writer.getResultBuffer()); expect(jspb.utils.countFixed64Fields(buffer, 0, buffer.length, 1)) .toEqual(count); writer = new jspb.BinaryWriter(); count = 0; - for (var i = 1; i < 1000000000; i *= 1.1) { + for (let i = 1; i < 1000000000; i *= 1.1) { writer.writeDouble(123456789, i); count++; } @@ -666,23 +664,23 @@ describe('binaryUtilsTest', function() { * Tests counting matching delimited fields. */ it('testCountDelimitedFields', function() { - var writer = new jspb.BinaryWriter(); + let writer = new jspb.BinaryWriter(); - var count = 0; - for (var i = 1; i < 1000; i *= 1.1) { + let count = 0; + for (let i = 1; i < 1000; i *= 1.1) { writer.writeBytes(1, [Math.floor(i)]); count++; } writer.writeString(2, 'terminator'); - var buffer = new Uint8Array(writer.getResultBuffer()); + let buffer = new Uint8Array(writer.getResultBuffer()); expect(jspb.utils.countDelimitedFields(buffer, 0, buffer.length, 1)) .toEqual(count); writer = new jspb.BinaryWriter(); count = 0; - for (var i = 1; i < 1000; i *= 1.1) { + for (let i = 1; i < 1000; i *= 1.1) { writer.writeBytes(123456789, [Math.floor(i)]); count++; } @@ -709,21 +707,21 @@ describe('binaryUtilsTest', function() { * Tests converting byte blob sources into byte blobs. */ it('testByteSourceToUint8Array', function() { - var convert = jspb.utils.byteSourceToUint8Array; + const convert = jspb.utils.byteSourceToUint8Array; - var sourceData = []; - for (var i = 0; i < 256; i++) { + const sourceData = []; + for (let i = 0; i < 256; i++) { sourceData.push(i); } - var sourceBytes = new Uint8Array(sourceData); - var sourceBuffer = sourceBytes.buffer; - var sourceBase64 = goog.crypt.base64.encodeByteArray(sourceData); + const sourceBytes = new Uint8Array(sourceData); + const sourceBuffer = sourceBytes.buffer; + const sourceBase64 = goog.crypt.base64.encodeByteArray(sourceData); function check(result) { expect(result.constructor).toEqual(Uint8Array); expect(result.length).toEqual(sourceData.length); - for (var i = 0; i < result.length; i++) { + for (let i = 0; i < result.length; i++) { expect(result[i]).toEqual(sourceData[i]); } } diff --git a/binary/writer.js b/binary/writer.js index 307ca58..b4d2407 100644 --- a/binary/writer.js +++ b/binary/writer.js @@ -58,8 +58,9 @@ goog.provide('jspb.BinaryWriter'); -goog.require('goog.asserts'); goog.require('goog.crypt.base64'); + +goog.require('jspb.asserts'); goog.require('jspb.BinaryConstants'); goog.require('jspb.BinaryEncoder'); goog.require('jspb.arith.Int64'); @@ -150,7 +151,7 @@ jspb.BinaryWriter.prototype.beginDelimited_ = function(field) { jspb.BinaryWriter.prototype.endDelimited_ = function(bookmark) { var oldLength = bookmark.pop(); var messageLength = this.totalLength_ + this.encoder_.length() - oldLength; - goog.asserts.assert(messageLength >= 0); + jspb.asserts.jspbAssert(messageLength >= 0); while (messageLength > 127) { bookmark.push((messageLength & 0x7f) | 0x80); @@ -207,7 +208,7 @@ jspb.BinaryWriter.prototype.reset = function() { * @export */ jspb.BinaryWriter.prototype.getResultBuffer = function() { - goog.asserts.assert(this.bookmarks_.length == 0); + jspb.asserts.jspbAssert(this.bookmarks_.length == 0); var flat = new Uint8Array(this.totalLength_ + this.encoder_.length()); @@ -226,7 +227,7 @@ jspb.BinaryWriter.prototype.getResultBuffer = function() { offset += tail.length; // Post condition: `flattened` must have had every byte written. - goog.asserts.assert(offset == flat.length); + jspb.asserts.jspbAssert(offset == flat.length); // Replace our block list with the flattened block, which lets GC reclaim // the temp blocks sooner. @@ -262,7 +263,7 @@ jspb.BinaryWriter.prototype.beginSubMessage = function(field) { * TODO(aappleby): Deprecated. Move callers to writeMessage(). */ jspb.BinaryWriter.prototype.endSubMessage = function() { - goog.asserts.assert(this.bookmarks_.length >= 0); + jspb.asserts.jspbAssert(this.bookmarks_.length >= 0); this.endDelimited_(this.bookmarks_.pop()); }; @@ -275,9 +276,8 @@ jspb.BinaryWriter.prototype.endSubMessage = function() { * protocol buffer documentation. * @private */ -jspb.BinaryWriter.prototype.writeFieldHeader_ = - function(field, wireType) { - goog.asserts.assert(field >= 1 && field == Math.floor(field)); +jspb.BinaryWriter.prototype.writeFieldHeader_ = function(field, wireType) { + jspb.asserts.jspbAssert(field >= 1 && field == Math.floor(field)); var x = field * 8 + wireType; this.encoder_.writeUnsignedVarint32(x); }; @@ -293,67 +293,67 @@ jspb.BinaryWriter.prototype.writeAny = function(fieldType, field, value) { var fieldTypes = jspb.BinaryConstants.FieldType; switch (fieldType) { case fieldTypes.DOUBLE: - this.writeDouble(field, /** @type {number} */(value)); + this.writeDouble(field, /** @type {number} */ (value)); return; case fieldTypes.FLOAT: - this.writeFloat(field, /** @type {number} */(value)); + this.writeFloat(field, /** @type {number} */ (value)); return; case fieldTypes.INT64: - this.writeInt64(field, /** @type {number} */(value)); + this.writeInt64(field, /** @type {number} */ (value)); return; case fieldTypes.UINT64: - this.writeUint64(field, /** @type {number} */(value)); + this.writeUint64(field, /** @type {number} */ (value)); return; case fieldTypes.INT32: - this.writeInt32(field, /** @type {number} */(value)); + this.writeInt32(field, /** @type {number} */ (value)); return; case fieldTypes.FIXED64: - this.writeFixed64(field, /** @type {number} */(value)); + this.writeFixed64(field, /** @type {number} */ (value)); return; case fieldTypes.FIXED32: - this.writeFixed32(field, /** @type {number} */(value)); + this.writeFixed32(field, /** @type {number} */ (value)); return; case fieldTypes.BOOL: - this.writeBool(field, /** @type {boolean} */(value)); + this.writeBool(field, /** @type {boolean} */ (value)); return; case fieldTypes.STRING: - this.writeString(field, /** @type {string} */(value)); + this.writeString(field, /** @type {string} */ (value)); return; case fieldTypes.GROUP: - goog.asserts.fail('Group field type not supported in writeAny()'); + jspb.asserts.jspbFail('Group field type not supported in writeAny()'); return; case fieldTypes.MESSAGE: - goog.asserts.fail('Message field type not supported in writeAny()'); + jspb.asserts.jspbFail('Message field type not supported in writeAny()'); return; case fieldTypes.BYTES: - this.writeBytes(field, /** @type {?Uint8Array} */(value)); + this.writeBytes(field, /** @type {?Uint8Array} */ (value)); return; case fieldTypes.UINT32: - this.writeUint32(field, /** @type {number} */(value)); + this.writeUint32(field, /** @type {number} */ (value)); return; case fieldTypes.ENUM: - this.writeEnum(field, /** @type {number} */(value)); + this.writeEnum(field, /** @type {number} */ (value)); return; case fieldTypes.SFIXED32: - this.writeSfixed32(field, /** @type {number} */(value)); + this.writeSfixed32(field, /** @type {number} */ (value)); return; case fieldTypes.SFIXED64: - this.writeSfixed64(field, /** @type {number} */(value)); + this.writeSfixed64(field, /** @type {number} */ (value)); return; case fieldTypes.SINT32: - this.writeSint32(field, /** @type {number} */(value)); + this.writeSint32(field, /** @type {number} */ (value)); return; case fieldTypes.SINT64: - this.writeSint64(field, /** @type {number} */(value)); + this.writeSint64(field, /** @type {number} */ (value)); return; case fieldTypes.FHASH64: - this.writeFixedHash64(field, /** @type {string} */(value)); + this.writeFixedHash64(field, /** @type {string} */ (value)); return; case fieldTypes.VHASH64: - this.writeVarintHash64(field, /** @type {string} */(value)); + this.writeVarintHash64(field, /** @type {string} */ (value)); return; default: - goog.asserts.fail('Invalid field type in writeAny()'); + jspb.asserts.jspbFail('Invalid field type in writeAny()'); return; } }; @@ -473,8 +473,9 @@ jspb.BinaryWriter.prototype.writeZigzagVarintHash64_ = function(field, value) { */ jspb.BinaryWriter.prototype.writeInt32 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_31) && - (value < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_31) && + (value < jspb.BinaryConstants.TWO_TO_31)); this.writeSignedVarint32_(field, value); }; @@ -488,8 +489,9 @@ jspb.BinaryWriter.prototype.writeInt32 = function(field, value) { jspb.BinaryWriter.prototype.writeInt32String = function(field, value) { if (value == null) return; var intValue = /** {number} */ parseInt(value, 10); - goog.asserts.assert((intValue >= -jspb.BinaryConstants.TWO_TO_31) && - (intValue < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert( + (intValue >= -jspb.BinaryConstants.TWO_TO_31) && + (intValue < jspb.BinaryConstants.TWO_TO_31)); this.writeSignedVarint32_(field, intValue); }; @@ -503,8 +505,9 @@ jspb.BinaryWriter.prototype.writeInt32String = function(field, value) { */ jspb.BinaryWriter.prototype.writeInt64 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_63) && - (value < jspb.BinaryConstants.TWO_TO_63)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_63) && + (value < jspb.BinaryConstants.TWO_TO_63)); this.writeSignedVarint64_(field, value); }; @@ -531,8 +534,8 @@ jspb.BinaryWriter.prototype.writeInt64String = function(field, value) { */ jspb.BinaryWriter.prototype.writeUint32 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= 0) && - (value < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert( + (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_32)); this.writeUnsignedVarint32_(field, value); }; @@ -546,8 +549,8 @@ jspb.BinaryWriter.prototype.writeUint32 = function(field, value) { jspb.BinaryWriter.prototype.writeUint32String = function(field, value) { if (value == null) return; var intValue = /** {number} */ parseInt(value, 10); - goog.asserts.assert((intValue >= 0) && - (intValue < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert( + (intValue >= 0) && (intValue < jspb.BinaryConstants.TWO_TO_32)); this.writeUnsignedVarint32_(field, intValue); }; @@ -561,8 +564,8 @@ jspb.BinaryWriter.prototype.writeUint32String = function(field, value) { */ jspb.BinaryWriter.prototype.writeUint64 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= 0) && - (value < jspb.BinaryConstants.TWO_TO_64)); + jspb.asserts.jspbAssert( + (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_64)); this.writeUnsignedVarint64_(field, value); }; @@ -589,8 +592,9 @@ jspb.BinaryWriter.prototype.writeUint64String = function(field, value) { */ jspb.BinaryWriter.prototype.writeSint32 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_31) && - (value < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_31) && + (value < jspb.BinaryConstants.TWO_TO_31)); this.writeZigzagVarint32_(field, value); }; @@ -604,8 +608,9 @@ jspb.BinaryWriter.prototype.writeSint32 = function(field, value) { */ jspb.BinaryWriter.prototype.writeSint64 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_63) && - (value < jspb.BinaryConstants.TWO_TO_63)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_63) && + (value < jspb.BinaryConstants.TWO_TO_63)); this.writeZigzagVarint64_(field, value); }; @@ -643,8 +648,8 @@ jspb.BinaryWriter.prototype.writeSint64String = function(field, value) { */ jspb.BinaryWriter.prototype.writeFixed32 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= 0) && - (value < jspb.BinaryConstants.TWO_TO_32)); + jspb.asserts.jspbAssert( + (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_32)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED32); this.encoder_.writeUint32(value); }; @@ -659,8 +664,8 @@ jspb.BinaryWriter.prototype.writeFixed32 = function(field, value) { */ jspb.BinaryWriter.prototype.writeFixed64 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= 0) && - (value < jspb.BinaryConstants.TWO_TO_64)); + jspb.asserts.jspbAssert( + (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_64)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED64); this.encoder_.writeUint64(value); }; @@ -688,8 +693,9 @@ jspb.BinaryWriter.prototype.writeFixed64String = function(field, value) { */ jspb.BinaryWriter.prototype.writeSfixed32 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_31) && - (value < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_31) && + (value < jspb.BinaryConstants.TWO_TO_31)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED32); this.encoder_.writeInt32(value); }; @@ -704,8 +710,9 @@ jspb.BinaryWriter.prototype.writeSfixed32 = function(field, value) { */ jspb.BinaryWriter.prototype.writeSfixed64 = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_63) && - (value < jspb.BinaryConstants.TWO_TO_63)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_63) && + (value < jspb.BinaryConstants.TWO_TO_63)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED64); this.encoder_.writeInt64(value); }; @@ -763,7 +770,8 @@ jspb.BinaryWriter.prototype.writeDouble = function(field, value) { */ jspb.BinaryWriter.prototype.writeBool = function(field, value) { if (value == null) return; - goog.asserts.assert(typeof value === 'boolean' || typeof value === 'number'); + jspb.asserts.jspbAssert( + typeof value === 'boolean' || typeof value === 'number'); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.VARINT); this.encoder_.writeBool(value); }; @@ -777,8 +785,9 @@ jspb.BinaryWriter.prototype.writeBool = function(field, value) { */ jspb.BinaryWriter.prototype.writeEnum = function(field, value) { if (value == null) return; - goog.asserts.assert((value >= -jspb.BinaryConstants.TWO_TO_31) && - (value < jspb.BinaryConstants.TWO_TO_31)); + jspb.asserts.jspbAssert( + (value >= -jspb.BinaryConstants.TWO_TO_31) && + (value < jspb.BinaryConstants.TWO_TO_31)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.VARINT); this.encoder_.writeSignedVarint32(value); }; @@ -908,7 +917,7 @@ jspb.BinaryWriter.prototype.writeGroup = function( */ jspb.BinaryWriter.prototype.writeFixedHash64 = function(field, value) { if (value == null) return; - goog.asserts.assert(value.length == 8); + jspb.asserts.jspbAssert(value.length == 8); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED64); this.encoder_.writeFixedHash64(value); }; @@ -922,7 +931,7 @@ jspb.BinaryWriter.prototype.writeFixedHash64 = function(field, value) { */ jspb.BinaryWriter.prototype.writeVarintHash64 = function(field, value) { if (value == null) return; - goog.asserts.assert(value.length == 8); + jspb.asserts.jspbAssert(value.length == 8); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.VARINT); this.encoder_.writeVarintHash64(value); }; @@ -1270,7 +1279,8 @@ jspb.BinaryWriter.prototype.writeRepeatedSfixed64 = function(field, value) { * @param {number} field The field number. * @param {?Array} value The array of decimal strings to write. */ -jspb.BinaryWriter.prototype.writeRepeatedSfixed64String = function(field, value) { +jspb.BinaryWriter.prototype.writeRepeatedSfixed64String = function( + field, value) { if (value == null) return; for (var i = 0; i < value.length; i++) { this.writeSfixed64String(field, value[i]); @@ -1411,8 +1421,7 @@ jspb.BinaryWriter.prototype.writeRepeatedGroup = function( * @param {number} field The field number. * @param {?Array} value The array of hashes to write. */ -jspb.BinaryWriter.prototype.writeRepeatedFixedHash64 = - function(field, value) { +jspb.BinaryWriter.prototype.writeRepeatedFixedHash64 = function(field, value) { if (value == null) return; for (var i = 0; i < value.length; i++) { this.writeFixedHash64(field, value[i]); @@ -1426,8 +1435,7 @@ jspb.BinaryWriter.prototype.writeRepeatedFixedHash64 = * @param {number} field The field number. * @param {?Array} value The array of hashes to write. */ -jspb.BinaryWriter.prototype.writeRepeatedVarintHash64 = - function(field, value) { +jspb.BinaryWriter.prototype.writeRepeatedVarintHash64 = function(field, value) { if (value == null) return; for (var i = 0; i < value.length; i++) { this.writeVarintHash64(field, value[i]); @@ -1583,8 +1591,7 @@ jspb.BinaryWriter.prototype.writePackedUint32 = function(field, value) { * @param {number} field * @param {?Array} value */ -jspb.BinaryWriter.prototype.writePackedUint32String = - function(field, value) { +jspb.BinaryWriter.prototype.writePackedUint32String = function(field, value) { if (value == null || !value.length) return; var bookmark = this.beginDelimited_(field); for (var i = 0; i < value.length; i++) { @@ -1616,8 +1623,7 @@ jspb.BinaryWriter.prototype.writePackedUint64 = function(field, value) { * @param {number} field * @param {?Array} value */ -jspb.BinaryWriter.prototype.writePackedUint64String = - function(field, value) { +jspb.BinaryWriter.prototype.writePackedUint64String = function(field, value) { if (value == null || !value.length) return; var bookmark = this.beginDelimited_(field); for (var i = 0; i < value.length; i++) { diff --git a/binary/writer_test.js b/binary/writer_test.js index 543cff6..54b9921 100644 --- a/binary/writer_test.js +++ b/binary/writer_test.js @@ -39,20 +39,14 @@ */ goog.require('goog.crypt'); -goog.require('goog.testing.asserts'); +goog.require('goog.crypt.base64'); + goog.require('jspb.BinaryConstants'); goog.require('jspb.BinaryReader'); goog.require('jspb.BinaryWriter'); goog.require('jspb.utils'); -goog.require('goog.crypt.base64'); -goog.requireType('jspb.BinaryMessage'); -/** - * @param {function()} func This function should throw an error when run. - */ -function assertFails(func) { - assertThrows(func); -} +goog.requireType('jspb.BinaryMessage'); describe('binaryWriterTest', function() { @@ -61,91 +55,91 @@ describe('binaryWriterTest', function() { */ it('testWriteErrors', function() { // Submessages with invalid field indices should assert. - var writer = new jspb.BinaryWriter(); - var dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); + let writer = new jspb.BinaryWriter(); + const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); - assertFails(function() { + expect(function() { writer.writeMessage(-1, dummyMessage, () => {}); - }); + }).toThrow(); // Writing invalid field indices should assert. writer = new jspb.BinaryWriter(); - assertFails(function() { + expect(function() { writer.writeUint64(-1, 1); - }); + }).toThrow(); // Writing out-of-range field values should assert. writer = new jspb.BinaryWriter(); - assertFails(function() { + expect(function() { writer.writeInt32(1, -Infinity); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeInt32(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeInt64(1, -Infinity); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeInt64(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeUint32(1, -1); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeUint32(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeUint64(1, -1); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeUint64(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeSint32(1, -Infinity); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeSint32(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeSint64(1, -Infinity); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeSint64(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeFixed32(1, -1); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeFixed32(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeFixed64(1, -1); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeFixed64(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeSfixed32(1, -Infinity); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeSfixed32(1, Infinity); - }); + }).toThrow(); - assertFails(function() { + expect(function() { writer.writeSfixed64(1, -Infinity); - }); - assertFails(function() { + }).toThrow(); + expect(function() { writer.writeSfixed64(1, Infinity); - }); + }).toThrow(); }); @@ -153,16 +147,16 @@ describe('binaryWriterTest', function() { * Basic test of retrieving the result as a Uint8Array buffer */ it('testGetResultBuffer', function() { - var expected = '0864120b48656c6c6f20776f726c641a0301020320c801'; + const expected = '0864120b48656c6c6f20776f726c641a0301020320c801'; - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); writer.writeUint32(1, 100); writer.writeString(2, 'Hello world'); writer.writeBytes(3, new Uint8Array([1, 2, 3])); writer.writeUint32(4, 200); - var buffer = writer.getResultBuffer(); - assertEquals(expected, goog.crypt.byteArrayToHex(buffer)); + const buffer = writer.getResultBuffer(); + expect(goog.crypt.byteArrayToHex(buffer)).toEqual(expected); }); @@ -170,20 +164,17 @@ describe('binaryWriterTest', function() { * Tests websafe encodings for base64 strings. */ it('testWebSafeOption', function() { - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); writer.writeBytes(1, new Uint8Array([127])); - assertEquals('CgF/', writer.getResultBase64String()); - assertEquals( - 'CgF/', + expect('CgF/').toEqual(writer.getResultBase64String()); + expect('CgF/').toEqual( writer.getResultBase64String(goog.crypt.base64.Alphabet.DEFAULT)); - assertEquals( - 'CgF_', - writer.getResultBase64String( - goog.crypt.base64.Alphabet.WEBSAFE_NO_PADDING)); + expect('CgF_').toEqual(writer.getResultBase64String( + goog.crypt.base64.Alphabet.WEBSAFE_NO_PADDING)); }); it('writes split 64 fields', function() { - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); writer.writeSplitVarint64(1, 0x1, 0x2); writer.writeSplitVarint64(1, 0xFFFFFFFF, 0xFFFFFFFF); writer.writeSplitFixed64(2, 0x1, 0x2); @@ -202,7 +193,7 @@ describe('binaryWriterTest', function() { function bitsAsArray(lowBits, highBits) { return [lowBits >>> 0, highBits >>> 0]; } - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); reader.nextField(); expect(reader.getFieldNumber()).toEqual(1); expect(reader.readSplitVarint64(bitsAsArray)).toEqual([0x1, 0x2]); @@ -255,7 +246,7 @@ describe('binaryWriterTest', function() { it('writes zigzag 64 fields', function() { // Test cases directly from the protobuf dev guide. // https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types - var testCases = [ + const testCases = [ {original: '0', zigzag: '0'}, {original: '-1', zigzag: '1'}, {original: '1', zigzag: '2'}, @@ -275,7 +266,7 @@ describe('binaryWriterTest', function() { return jspb.utils.split64High >>> 0; } - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); testCases.forEach(function(c) { writer.writeSint64String(1, c.original); writer.writeSintHash64(1, jspb.utils.decimalStringToHash64(c.original)); @@ -314,7 +305,7 @@ describe('binaryWriterTest', function() { // Verify by reading the stream as normal int64 fields and checking with // the canonical zigzag encoding of each value. - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); testCases.forEach(function(c) { reader.nextField(); expect(reader.getFieldNumber()).toEqual(1); @@ -365,17 +356,17 @@ describe('binaryWriterTest', function() { }); it('writes float32 fields', function() { - var testCases = [ + const testCases = [ 0, 1, -1, jspb.BinaryConstants.FLOAT32_MIN, -jspb.BinaryConstants.FLOAT32_MIN, jspb.BinaryConstants.FLOAT32_MAX, -jspb.BinaryConstants.FLOAT32_MAX, 3.1415927410125732, Infinity, -Infinity, NaN ]; - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); testCases.forEach(function(f) { writer.writeFloat(1, f); }); - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); testCases.forEach(function(f) { reader.nextField(); expect(reader.getFieldNumber()).toEqual(1); @@ -388,17 +379,17 @@ describe('binaryWriterTest', function() { }); it('writes double fields', function() { - var testCases = [ + const testCases = [ 0, 1, -1, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MAX_VALUE, Number.MIN_VALUE, jspb.BinaryConstants.FLOAT32_MIN, -jspb.BinaryConstants.FLOAT32_MIN, jspb.BinaryConstants.FLOAT32_MAX, -jspb.BinaryConstants.FLOAT32_MAX, Math.PI, Infinity, -Infinity, NaN ]; - var writer = new jspb.BinaryWriter(); + const writer = new jspb.BinaryWriter(); testCases.forEach(function(f) { writer.writeDouble(1, f); }); - var reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); + const reader = jspb.BinaryReader.alloc(writer.getResultBuffer()); testCases.forEach(function(f) { reader.nextField(); expect(reader.getFieldNumber()).toEqual(1); diff --git a/commonjs/export.js b/commonjs/export.js index 36ab4f0..724a152 100644 --- a/commonjs/export.js +++ b/commonjs/export.js @@ -8,6 +8,7 @@ goog.provide('jspb.Export'); goog.require('goog.object'); +goog.require('jspb.asserts'); goog.require('jspb.BinaryReader'); goog.require('jspb.BinaryWriter'); goog.require('jspb.ExtensionFieldBinaryInfo'); @@ -22,10 +23,11 @@ if (typeof exports === 'object') { exports['BinaryWriter'] = jspb.BinaryWriter; exports['ExtensionFieldInfo'] = jspb.ExtensionFieldInfo; exports['ExtensionFieldBinaryInfo'] = jspb.ExtensionFieldBinaryInfo; - + exports['asserts'] = {'JspbAssertionError': jspb.asserts.JspbAssertionError}; + // These are used by generated code but should not be used directly by clients. exports['exportSymbol'] = goog.exportSymbol; exports['inherits'] = goog.inherits; exports['object'] = {extend: goog.object.extend}; exports['typeOf'] = goog.typeOf; -} \ No newline at end of file +} diff --git a/commonjs/export_asserts.js b/commonjs/export_asserts.js deleted file mode 100644 index fa6e795..0000000 --- a/commonjs/export_asserts.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @fileoverview Exports symbols needed only by tests. - * - * This file exports several Closure Library symbols that are only - * used by tests. It is used to generate a file - * closure_asserts_commonjs.js that is only used at testing time. - */ - -goog.provide('jspb.ExportAsserts'); - -goog.require('goog.testing.asserts'); - -var global = Function('return this')(); - -// All of the closure "assert" functions are exported at the global level. -// -// The Google Closure assert functions start with assert, eg. -// assertThrows -// assertNotThrows -// assertTrue -// ... -// -// The one exception is the "fail" function. -function shouldExport(str) { - return str.lastIndexOf('assert') === 0 || str == 'fail'; -} - -for (var key in global) { - if ((typeof key == "string") && global.hasOwnProperty(key) && - shouldExport(key)) { - exports[key] = global[key]; - } -} - -// The COMPILED variable is set by Closure compiler to "true" when it compiles -// JavaScript, so in practice this is equivalent to "exports.COMPILED = true". -// This will disable some debugging functionality in debug.js. We could -// investigate whether this can/should be enabled in CommonJS builds. -exports.COMPILED = COMPILED diff --git a/commonjs/rewrite_tests_for_commonjs.js b/commonjs/rewrite_tests_for_commonjs.js index 160261e..a2b60da 100644 --- a/commonjs/rewrite_tests_for_commonjs.js +++ b/commonjs/rewrite_tests_for_commonjs.js @@ -68,10 +68,7 @@ console.log("var googleProtobuf = require('google-protobuf');"); console.log("var testdeps = require('testdeps_commonjs');"); console.log("global.goog = testdeps.goog;"); console.log("global.jspb = googleProtobuf;"); -console.log("var asserts = require('closure_asserts_commonjs');"); console.log(""); -console.log("// Bring asserts into the global namespace."); -console.log("googleProtobuf.object.extend(global, asserts);"); lineReader.on('line', function(line) { var isRequire = line.match(/goog\.require\('([^']*)'\)/); diff --git a/debug.js b/debug.js index 9655b2e..62a65ce 100644 --- a/debug.js +++ b/debug.js @@ -35,8 +35,9 @@ goog.provide('jspb.debug'); goog.require('goog.array'); -goog.require('goog.asserts'); goog.require('goog.object'); + +goog.require('jspb.asserts'); goog.require('jspb.Map'); goog.require('jspb.Message'); @@ -55,11 +56,11 @@ jspb.debug.dump = function(message) { if (!goog.DEBUG) { return null; } - goog.asserts.assert(message instanceof jspb.Message, + jspb.asserts.jspbAssert(message instanceof jspb.Message, 'jspb.Message instance expected'); /** @type {Object} */ var object = message; - goog.asserts.assert(object['getExtension'], + jspb.asserts.jspbAssert(object['getExtension'], 'Only unobfuscated and unoptimized compilation modes supported.'); return /** @type {Object} */ (jspb.debug.dump_(message)); }; @@ -88,7 +89,7 @@ jspb.debug.dump_ = function(thing) { } if (type == 'array') { - goog.asserts.assertArray(thing); + jspb.asserts.jspbAssertArray(thing); return goog.array.map(thing, jspb.debug.dump_); } @@ -101,7 +102,7 @@ jspb.debug.dump_ = function(thing) { return mapObject; } - goog.asserts.assert(message instanceof jspb.Message, + jspb.asserts.jspbAssert(message instanceof jspb.Message, 'Only messages expected: ' + thing); var ctor = message.constructor; var messageName = ctor.name || ctor.displayName; diff --git a/debug_test.js b/debug_test.js index 5096869..99d413c 100644 --- a/debug_test.js +++ b/debug_test.js @@ -30,8 +30,6 @@ goog.setTestOnly(); -goog.require('goog.testing.asserts'); - // CommonJS-LoadFromFile: google-protobuf goog.require('jspb.debug'); @@ -46,61 +44,61 @@ goog.require('proto.jspb.test.TestMapFieldsNoBinary'); // CommonJS-LoadFromFile: testbinary_pb goog.require('proto.jspb.test.TestAllTypes'); -describe('debugTest', function() { - it('testSimple1', function() { +describe('debugTest', function () { + it('testSimple1', function () { if (COMPILED) { return; } - var message = new proto.jspb.test.Simple1(); + const message = new proto.jspb.test.Simple1(); message.setAString('foo'); - assertObjectEquals({ + expect(jspb.debug.dump(message)).toEqual({ $name: 'proto.jspb.test.Simple1', 'aString': 'foo', 'aRepeatedStringList': [] - }, jspb.debug.dump(message)); + }); message.setABoolean(true); message.setARepeatedStringList(['1', '2']); - assertObjectEquals({ + expect(jspb.debug.dump(message)).toEqual({ $name: 'proto.jspb.test.Simple1', 'aString': 'foo', 'aRepeatedStringList': ['1', '2'], 'aBoolean': true - }, jspb.debug.dump(message)); + }); message.clearAString(); - assertObjectEquals({ + expect(jspb.debug.dump(message)).toEqual({ $name: 'proto.jspb.test.Simple1', 'aRepeatedStringList': ['1', '2'], 'aBoolean': true - }, jspb.debug.dump(message)); + }); }); - it('testBytes', function() { + it('testBytes', function () { if (COMPILED || typeof Uint8Array == 'undefined') { return; } - var message = new proto.jspb.test.TestAllTypes(); - var bytes = new Uint8Array(4); + const message = new proto.jspb.test.TestAllTypes(); + const bytes = new Uint8Array(4); message.setOptionalBytes(bytes); - assertEquals(jspb.debug.dump(message)['optionalBytes'], bytes); + expect(bytes).toEqual(jspb.debug.dump(message)['optionalBytes']); }); - it('testExtensions', function() { + it('testExtensions', function () { if (COMPILED) { return; } - var extension = new proto.jspb.test.IsExtension(); + const extension = new proto.jspb.test.IsExtension(); extension.setExt1('ext1field'); - var extendable = new proto.jspb.test.HasExtensions(); + const extendable = new proto.jspb.test.HasExtensions(); extendable.setStr1('v1'); extendable.setStr2('v2'); extendable.setStr3('v3'); extendable.setExtension(proto.jspb.test.IsExtension.extField, extension); - assertObjectEquals({ + expect(jspb.debug.dump(extendable)).toEqual({ '$name': 'proto.jspb.test.HasExtensions', 'str1': 'v1', 'str2': 'v2', @@ -112,20 +110,20 @@ describe('debugTest', function() { }, 'repeatedSimpleList': [] } - }, jspb.debug.dump(extendable)); + }); }); - it('testMapsBasicTypes', function() { + it('testMapsBasicTypes', function () { if (COMPILED) { return; } - var message = new proto.jspb.test.TestMapFieldsNoBinary(); + const message = new proto.jspb.test.TestMapFieldsNoBinary(); message.getMapBoolStringMap().set(true, 'bool_string_value1'); message.getMapBoolStringMap().set(false, 'bool_string_value2'); message.getMapStringInt32Map().set('key', 111); - assertObjectEquals({ + expect(jspb.debug.dump(message)).toEqual({ '$name': 'proto.jspb.test.TestMapFieldsNoBinary', 'mapBoolStringMap': { true: 'bool_string_value1', @@ -143,24 +141,24 @@ describe('debugTest', function() { 'mapStringMsgMap': {}, 'mapStringStringMap': {}, 'mapStringTestmapfieldsMap': {} - }, jspb.debug.dump(message)); + }); }); - it('testMapsMessageValues', function() { + it('testMapsMessageValues', function () { if (COMPILED) { return; } - var value1 = new proto.jspb.test.MapValueMessageNoBinary(); + const value1 = new proto.jspb.test.MapValueMessageNoBinary(); value1.setFoo(1111); - var value2 = new proto.jspb.test.MapValueMessageNoBinary(); + const value2 = new proto.jspb.test.MapValueMessageNoBinary(); value2.setFoo(2222); - var message = new proto.jspb.test.TestMapFieldsNoBinary(); + const message = new proto.jspb.test.TestMapFieldsNoBinary(); message.getMapStringMsgMap().set('key1', value1); message.getMapStringMsgMap().set('key2', value2); - assertObjectEquals({ + expect(jspb.debug.dump(message)).toEqual({ '$name': 'proto.jspb.test.TestMapFieldsNoBinary', 'mapBoolStringMap': {}, 'mapInt32StringMap': {}, @@ -182,7 +180,7 @@ describe('debugTest', function() { }, 'mapStringStringMap': {}, 'mapStringTestmapfieldsMap': {} - }, jspb.debug.dump(message)); + }); }); }); diff --git a/gulpfile.js b/gulpfile.js index be6edc7..7317e88 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -127,35 +127,31 @@ function getClosureCompilerCommand(exportsFile, outputFile, keepSymbols) { return [ 'node_modules/.bin/google-closure-compiler', `--js=${closureLib}/closure/goog/**.js`, - `--js=${closureLib}/third_party/closure/goog/**.js`, '--js=map.js', - '--js=message.js', '--js=binary/arith.js', '--js=binary/constants.js', - '--js=binary/decoder.js', '--js=binary/encoder.js', '--js=binary/reader.js', - '--js=binary/utils.js', '--js=binary/writer.js', `--js=${exportsFile}`, - `--compilation_level="${compilationLevel}"`, '--generate_exports', + `--js=${closureLib}/third_party/closure/goog/**.js`, + '--js=asserts.js', + '--js=map.js', + '--js=message.js', + '--js=binary/arith.js', + '--js=binary/constants.js', + '--js=binary/decoder.js', + '--js=binary/encoder.js', + '--js=binary/reader.js', + '--js=binary/utils.js', + '--js=binary/writer.js', + `--js=${exportsFile}`, + `--compilation_level="${compilationLevel}"`, + '--generate_exports', '--export_local_property_definitions', `--entry_point=${exportsFile}`, `> ${outputFile}` ].join(' '); } function gen_google_protobuf_js(cb) { - // TODO(haberman): minify this more aggressively. - // Will require proper externs/exports. exec( getClosureCompilerCommand('commonjs/export.js', 'google-protobuf.js'), make_exec_logging_callback(cb)); } - -function commonjs_asserts(cb) { - exec( - 'mkdir -p commonjs_out/test_node_modules && ' + - getClosureCompilerCommand( - 'commonjs/export_asserts.js', - 'commonjs_out/test_node_modules/closure_asserts_commonjs.js', - true), - make_exec_logging_callback(cb)); -} - function commonjs_testdeps(cb) { exec( 'mkdir -p commonjs_out/test_node_modules && ' + @@ -167,8 +163,6 @@ function commonjs_testdeps(cb) { } function commonjs_out(cb) { - // TODO(haberman): minify this more aggressively. - // Will require proper externs/exports. let cmd = 'mkdir -p commonjs_out/binary && mkdir -p commonjs_out/test_node_modules && '; function addTestFile(file) { @@ -191,7 +185,7 @@ function commonjs_out(cb) { function closure_make_deps(cb) { exec( - './node_modules/.bin/closure-make-deps --closure-path=. --file=node_modules/google-closure-library/closure/goog/deps.js binary/arith.js binary/constants.js binary/decoder.js binary/encoder.js binary/reader.js binary/utils.js binary/writer.js debug.js map.js message.js node_loader.js test_bootstrap.js > deps.js', + './node_modules/.bin/closure-make-deps --closure-path=. --file=node_modules/google-closure-library/closure/goog/deps.js binary/arith.js binary/constants.js binary/decoder.js binary/encoder.js binary/reader.js binary/utils.js binary/writer.js asserts.js debug.js map.js message.js node_loader.js test_bootstrap.js > deps.js', make_exec_logging_callback(cb)); } @@ -219,7 +213,7 @@ exports.make_commonjs_out = series( exports.dist, genproto_well_known_types_commonjs, genproto_group1_commonjs, genproto_group2_commonjs, - genproto_commonjs_wellknowntypes, commonjs_asserts, + genproto_commonjs_wellknowntypes, commonjs_testdeps, genproto_group3_commonjs_strict, commonjs_out); diff --git a/map.js b/map.js index 2279a79..b485d32 100644 --- a/map.js +++ b/map.js @@ -35,7 +35,7 @@ */ goog.provide('jspb.Map'); -goog.require('goog.asserts'); +goog.require('jspb.asserts'); goog.requireType('jspb.BinaryReader'); goog.requireType('jspb.BinaryWriter'); @@ -157,7 +157,7 @@ jspb.Map.prototype.toObject = function(includeInstance, valueToObject) { this.wrapEntry_(entry); var valueWrapper = /** @type {V|undefined} */ (entry.valueWrapper); if (valueWrapper) { - goog.asserts.assert(valueToObject); + jspb.asserts.jspbAssert(valueToObject); entries.push([entry.key, valueToObject(includeInstance, valueWrapper)]); } else { entries.push([entry.key, entry.value]); @@ -512,7 +512,7 @@ jspb.Map.deserializeBinary = function(map, reader, keyReaderFn, valueReaderFn, } else if (field == 2) { // Value. if (map.valueCtor_) { - goog.asserts.assert(opt_valueReaderCallback); + jspb.asserts.jspbAssert(opt_valueReaderCallback); if (!value) { // Old generator still doesn't provide default value message. // Need this for backward compatibility. @@ -527,8 +527,8 @@ jspb.Map.deserializeBinary = function(map, reader, keyReaderFn, valueReaderFn, } } - goog.asserts.assert(key != undefined); - goog.asserts.assert(value != undefined); + jspb.asserts.jspbAssert(key != undefined); + jspb.asserts.jspbAssert(value != undefined); map.set(key, value); }; diff --git a/maps_test.js b/maps_test.js index c71c2de..5c701ff 100644 --- a/maps_test.js +++ b/maps_test.js @@ -28,7 +28,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -goog.require('goog.testing.asserts'); goog.require('goog.testing.TestCase'); goog.require('goog.userAgent'); @@ -56,20 +55,21 @@ goog.require('proto.jspb.test.TestMapFieldsNoBinary'); goog.requireType('jspb.Map'); + /** * Helper: check that the given map has exactly this set of (sorted) entries. * @param {!jspb.Map} map * @param {!Array>} entries */ function checkMapEquals(map, entries) { - var arr = map.toArray(); - assertEquals(arr.length, entries.length); - for (var i = 0; i < arr.length; i++) { + const arr = map.toArray(); + expect(entries.length).toEqual(arr.length); + for (let i = 0; i < arr.length; i++) { if (Array.isArray(arr[i])) { - assertTrue(Array.isArray(entries[i])); - assertArrayEquals(arr[i], entries[i]); + expect(Array.isArray(entries[i])).toBeTrue();; + expect(entries[i]).toEqual(arr[i]); } else { - assertElementsEquals(arr[i], entries[i]); + expect(entries[i]).toEqual(arr[i]); } } } @@ -81,9 +81,9 @@ function checkMapEquals(map, entries) { * @return {!Array} */ function toArray(iter) { - var arr = []; + const arr = []; while (true) { - var val = iter.next(); + const val = iter.next(); if (val.done) { break; } @@ -104,24 +104,24 @@ function makeTests(msgInfo, submessageCtor, suffix) { * Helper: fill all maps on a TestMapFields. * @param {?} msg */ - var fillMapFields = function(msg) { + const fillMapFields = function (msg) { msg.getMapStringStringMap().set('asdf', 'jkl;').set('key 2', 'hello world'); msg.getMapStringInt32Map().set('a', 1).set('b', -2); msg.getMapStringInt64Map().set('c', 0x100000000).set('d', 0x200000000); msg.getMapStringBoolMap().set('e', true).set('f', false); msg.getMapStringDoubleMap().set('g', 3.14159).set('h', 2.71828); msg.getMapStringEnumMap() - .set('i', proto.jspb.test.MapValueEnum.MAP_VALUE_BAR) - .set('j', proto.jspb.test.MapValueEnum.MAP_VALUE_BAZ); + .set('i', proto.jspb.test.MapValueEnum.MAP_VALUE_BAR) + .set('j', proto.jspb.test.MapValueEnum.MAP_VALUE_BAZ); msg.getMapStringMsgMap() - .set('k', new submessageCtor()) - .set('l', new submessageCtor()); + .set('k', new submessageCtor()) + .set('l', new submessageCtor()); msg.getMapStringMsgMap().get('k').setFoo(42); msg.getMapStringMsgMap().get('l').setFoo(84); msg.getMapInt32StringMap().set(-1, 'a').set(42, 'b'); msg.getMapInt64StringMap() - .set(0x123456789abc, 'c') - .set(0xcba987654321, 'd'); + .set(0x123456789abc, 'c') + .set(0xcba987654321, 'd'); msg.getMapBoolStringMap().set(false, 'e').set(true, 'f'); }; @@ -129,100 +129,100 @@ function makeTests(msgInfo, submessageCtor, suffix) { * Helper: check all maps on a TestMapFields. * @param {?} msg */ - var checkMapFields = function(msg) { + const checkMapFields = function (msg) { checkMapEquals( - msg.getMapStringStringMap(), - [['asdf', 'jkl;'], ['key 2', 'hello world']]); + msg.getMapStringStringMap(), + [['asdf', 'jkl;'], ['key 2', 'hello world']]); checkMapEquals(msg.getMapStringInt32Map(), [['a', 1], ['b', -2]]); checkMapEquals( - msg.getMapStringInt64Map(), [['c', 0x100000000], ['d', 0x200000000]]); + msg.getMapStringInt64Map(), [['c', 0x100000000], ['d', 0x200000000]]); checkMapEquals(msg.getMapStringBoolMap(), [['e', true], ['f', false]]); checkMapEquals( - msg.getMapStringDoubleMap(), [['g', 3.14159], ['h', 2.71828]]); + msg.getMapStringDoubleMap(), [['g', 3.14159], ['h', 2.71828]]); checkMapEquals(msg.getMapStringEnumMap(), [ ['i', proto.jspb.test.MapValueEnum.MAP_VALUE_BAR], ['j', proto.jspb.test.MapValueEnum.MAP_VALUE_BAZ] ]); checkMapEquals(msg.getMapInt32StringMap(), [[-1, 'a'], [42, 'b']]); checkMapEquals( - msg.getMapInt64StringMap(), - [[0x123456789abc, 'c'], [0xcba987654321, 'd']]); + msg.getMapInt64StringMap(), + [[0x123456789abc, 'c'], [0xcba987654321, 'd']]); checkMapEquals(msg.getMapBoolStringMap(), [[false, 'e'], [true, 'f']]); - assertEquals(msg.getMapStringMsgMap().getLength(), 2); - assertEquals(msg.getMapStringMsgMap().get('k').getFoo(), 42); - assertEquals(msg.getMapStringMsgMap().get('l').getFoo(), 84); + expect(msg.getMapStringMsgMap().getLength()).toEqual(2); + expect(msg.getMapStringMsgMap().get('k').getFoo()).toEqual(42); + expect(msg.getMapStringMsgMap().get('l').getFoo()).toEqual(84); - var entries = toArray(msg.getMapStringMsgMap().entries()); - assertEquals(entries.length, 2); - entries.forEach(function(entry) { - var key = entry[0]; - var val = entry[1]; - assert(val === msg.getMapStringMsgMap().get(key)); + const entries = toArray(msg.getMapStringMsgMap().entries()); + expect(entries.length).toEqual(2); + entries.forEach(function (entry) { + const key = entry[0]; + const val = entry[1]; + expect(msg.getMapStringMsgMap().get(key)).toEqual(val); }); - msg.getMapStringMsgMap().forEach(function(val, key) { - assert(val === msg.getMapStringMsgMap().get(key)); + msg.getMapStringMsgMap().forEach(function (val, key) { + expect(msg.getMapStringMsgMap().get(key)).toEqual(val); }); }; - it('testMapStringStringField' + suffix, function() { - var msg = new msgInfo.constructor(); - assertEquals(msg.getMapStringStringMap().getLength(), 0); - assertEquals(msg.getMapStringInt32Map().getLength(), 0); - assertEquals(msg.getMapStringInt64Map().getLength(), 0); - assertEquals(msg.getMapStringBoolMap().getLength(), 0); - assertEquals(msg.getMapStringDoubleMap().getLength(), 0); - assertEquals(msg.getMapStringEnumMap().getLength(), 0); - assertEquals(msg.getMapStringMsgMap().getLength(), 0); + it('testMapStringStringField' + suffix, function () { + let msg = new msgInfo.constructor(); + expect(msg.getMapStringStringMap().getLength()).toEqual(0); + expect(msg.getMapStringInt32Map().getLength()).toEqual(0); + expect(msg.getMapStringInt64Map().getLength()).toEqual(0); + expect(msg.getMapStringBoolMap().getLength()).toEqual(0); + expect(msg.getMapStringDoubleMap().getLength()).toEqual(0); + expect(msg.getMapStringEnumMap().getLength()).toEqual(0); + expect(msg.getMapStringMsgMap().getLength()).toEqual(0); // Re-create to clear out any internally-cached wrappers, etc. msg = new msgInfo.constructor(); - var m = msg.getMapStringStringMap(); - assertEquals(m.has('asdf'), false); - assertEquals(m.get('asdf'), undefined); + const m = msg.getMapStringStringMap(); + expect(m.has('asdf')).toBeFalse() + expect(m.get('asdf')).toBeUndefined() m.set('asdf', 'hello world'); - assertEquals(m.has('asdf'), true); - assertEquals(m.get('asdf'), 'hello world'); + expect(m.has('asdf')).toBeTrue(); + expect(m.get('asdf')).toEqual('hello world'); m.set('jkl;', 'key 2'); - assertEquals(m.has('jkl;'), true); - assertEquals(m.get('jkl;'), 'key 2'); - assertEquals(m.getLength(), 2); - var it = m.entries(); - assertElementsEquals(it.next().value, ['asdf', 'hello world']); - assertElementsEquals(it.next().value, ['jkl;', 'key 2']); - assertEquals(it.next().done, true); + expect(m.has('jkl;')).toBeTrue(); + expect(m.get('jkl;')).toEqual('key 2'); + expect(m.getLength()).toEqual(2); + let it = m.entries(); + expect(it.next().value).toEqual(['asdf', 'hello world']); + expect(it.next().value).toEqual(['jkl;', 'key 2']); + expect(it.next().done).toBeTrue(); checkMapEquals(m, [['asdf', 'hello world'], ['jkl;', 'key 2']]); m.del('jkl;'); - assertEquals(m.has('jkl;'), false); - assertEquals(m.get('jkl;'), undefined); - assertEquals(m.getLength(), 1); + expect(m.has('jkl;')).toBeFalse() + expect(m.get('jkl;')).toBeUndefined() + expect(m.getLength()).toEqual(1); it = m.keys(); - assertEquals(it.next().value, 'asdf'); - assertEquals(it.next().done, true); + expect(it.next().value).toEqual('asdf'); + expect(it.next().done).toBeTrue(); it = m.values(); - assertEquals(it.next().value, 'hello world'); - assertEquals(it.next().done, true); - - var count = 0; - m.forEach(function(value, key, map) { - assertEquals(map, m); - assertEquals(key, 'asdf'); - assertEquals(value, 'hello world'); + expect(it.next().value).toEqual('hello world'); + expect(it.next().done).toBeTrue(); + + let count = 0; + m.forEach(function (value, key, map) { + expect(m).toEqual(map); + expect(key).toEqual('asdf'); + expect(value).toEqual('hello world'); count++; }); - assertEquals(count, 1); + expect(count).toEqual(1); m.clear(); - assertEquals(m.getLength(), 0); + expect(m.getLength()).toEqual(0); }); /** * Tests operations on maps with all key and value types. */ - it('testAllMapTypes' + suffix, function() { - var msg = new msgInfo.constructor(); + it('testAllMapTypes' + suffix, function () { + const msg = new msgInfo.constructor(); fillMapFields(msg); checkMapFields(msg); }); @@ -232,7 +232,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { /** * Tests serialization and deserialization in binary format. */ - it('testBinaryFormat' + suffix, function() { + it('testBinaryFormat' + suffix, function () { if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(10)) { // IE8/9 currently doesn't support binary format because they lack // TypedArray. @@ -240,26 +240,26 @@ function makeTests(msgInfo, submessageCtor, suffix) { } // Check that the format is correct. - var msg = new msgInfo.constructor(); + let msg = new msgInfo.constructor(); msg.getMapStringStringMap().set('A', 'a'); - var serialized = msg.serializeBinary(); - var expectedSerialized = [ + let serialized = msg.serializeBinary(); + const expectedSerialized = [ 0x0a, 0x6, // field 1 (map_string_string), delimited, length 6 0x0a, 0x1, // field 1 in submessage (key), delimited, length 1 0x41, // ASCII 'A' 0x12, 0x1, // field 2 in submessage (value), delimited, length 1 0x61 // ASCII 'a' ]; - assertEquals(serialized.length, expectedSerialized.length); - for (var i = 0; i < serialized.length; i++) { - assertEquals(serialized[i], expectedSerialized[i]); + expect(expectedSerialized.length).toEqual(serialized.length); + for (let i = 0; i < serialized.length; i++) { + expect(expectedSerialized[i]).toEqual(serialized[i]); } // Check that all map fields successfully round-trip. msg = new msgInfo.constructor(); fillMapFields(msg); serialized = msg.serializeBinary(); - var decoded = msgInfo.deserializeBinary(serialized); + const decoded = msgInfo.deserializeBinary(serialized); checkMapFields(decoded); }); @@ -267,24 +267,24 @@ function makeTests(msgInfo, submessageCtor, suffix) { * Tests deserialization of undefined map keys go to default values in * binary format. */ - it('testMapDeserializationForUndefinedKeys', function() { - var testMessageOptionalKeys = - new proto.jspb.test.TestMapFieldsOptionalKeys(); - var mapEntryStringKey = - new proto.jspb.test.MapEntryOptionalKeysStringKey(); + it('testMapDeserializationForUndefinedKeys', function () { + const testMessageOptionalKeys = + new proto.jspb.test.TestMapFieldsOptionalKeys(); + const mapEntryStringKey = + new proto.jspb.test.MapEntryOptionalKeysStringKey(); mapEntryStringKey.setValue('a'); testMessageOptionalKeys.setMapStringString(mapEntryStringKey); - var mapEntryInt32Key = new proto.jspb.test.MapEntryOptionalKeysInt32Key(); + const mapEntryInt32Key = new proto.jspb.test.MapEntryOptionalKeysInt32Key(); mapEntryInt32Key.setValue('b'); testMessageOptionalKeys.setMapInt32String(mapEntryInt32Key); - var mapEntryInt64Key = new proto.jspb.test.MapEntryOptionalKeysInt64Key(); + const mapEntryInt64Key = new proto.jspb.test.MapEntryOptionalKeysInt64Key(); mapEntryInt64Key.setValue('c'); testMessageOptionalKeys.setMapInt64String(mapEntryInt64Key); - var mapEntryBoolKey = new proto.jspb.test.MapEntryOptionalKeysBoolKey(); + const mapEntryBoolKey = new proto.jspb.test.MapEntryOptionalKeysBoolKey(); mapEntryBoolKey.setValue('d'); testMessageOptionalKeys.setMapBoolString(mapEntryBoolKey); - var deserializedMessage = - msgInfo.deserializeBinary(testMessageOptionalKeys.serializeBinary()); + const deserializedMessage = + msgInfo.deserializeBinary(testMessageOptionalKeys.serializeBinary()); checkMapEquals(deserializedMessage.getMapStringStringMap(), [['', 'a']]); checkMapEquals(deserializedMessage.getMapInt32StringMap(), [[0, 'b']]); checkMapEquals(deserializedMessage.getMapInt64StringMap(), [[0, 'c']]); @@ -295,39 +295,39 @@ function makeTests(msgInfo, submessageCtor, suffix) { * Tests deserialization of undefined map values go to default values in * binary format. */ - it('testMapDeserializationForUndefinedValues', function() { - var testMessageOptionalValues = - new proto.jspb.test.TestMapFieldsOptionalValues(); - var mapEntryStringValue = - new proto.jspb.test.MapEntryOptionalValuesStringValue(); + it('testMapDeserializationForUndefinedValues', function () { + const testMessageOptionalValues = + new proto.jspb.test.TestMapFieldsOptionalValues(); + const mapEntryStringValue = + new proto.jspb.test.MapEntryOptionalValuesStringValue(); mapEntryStringValue.setKey('a'); testMessageOptionalValues.setMapStringString(mapEntryStringValue); - var mapEntryInt32Value = - new proto.jspb.test.MapEntryOptionalValuesInt32Value(); + const mapEntryInt32Value = + new proto.jspb.test.MapEntryOptionalValuesInt32Value(); mapEntryInt32Value.setKey('b'); testMessageOptionalValues.setMapStringInt32(mapEntryInt32Value); - var mapEntryInt64Value = - new proto.jspb.test.MapEntryOptionalValuesInt64Value(); + const mapEntryInt64Value = + new proto.jspb.test.MapEntryOptionalValuesInt64Value(); mapEntryInt64Value.setKey('c'); testMessageOptionalValues.setMapStringInt64(mapEntryInt64Value); - var mapEntryBoolValue = - new proto.jspb.test.MapEntryOptionalValuesBoolValue(); + const mapEntryBoolValue = + new proto.jspb.test.MapEntryOptionalValuesBoolValue(); mapEntryBoolValue.setKey('d'); testMessageOptionalValues.setMapStringBool(mapEntryBoolValue); - var mapEntryDoubleValue = - new proto.jspb.test.MapEntryOptionalValuesDoubleValue(); + const mapEntryDoubleValue = + new proto.jspb.test.MapEntryOptionalValuesDoubleValue(); mapEntryDoubleValue.setKey('e'); testMessageOptionalValues.setMapStringDouble(mapEntryDoubleValue); - var mapEntryEnumValue = - new proto.jspb.test.MapEntryOptionalValuesEnumValue(); + const mapEntryEnumValue = + new proto.jspb.test.MapEntryOptionalValuesEnumValue(); mapEntryEnumValue.setKey('f'); testMessageOptionalValues.setMapStringEnum(mapEntryEnumValue); - var mapEntryMessageValue = - new proto.jspb.test.MapEntryOptionalValuesMessageValue(); + const mapEntryMessageValue = + new proto.jspb.test.MapEntryOptionalValuesMessageValue(); mapEntryMessageValue.setKey('g'); testMessageOptionalValues.setMapStringMsg(mapEntryMessageValue); - var deserializedMessage = msgInfo.deserializeBinary( - testMessageOptionalValues.serializeBinary()); + const deserializedMessage = msgInfo.deserializeBinary( + testMessageOptionalValues.serializeBinary()); checkMapEquals(deserializedMessage.getMapStringStringMap(), [['a', '']]); checkMapEquals(deserializedMessage.getMapStringInt32Map(), [['b', 0]]); checkMapEquals(deserializedMessage.getMapStringInt64Map(), [['c', 0]]); @@ -342,43 +342,43 @@ function makeTests(msgInfo, submessageCtor, suffix) { /** * Exercises the lazy map<->underlying array sync. */ - it('testLazyMapSync' + suffix, function() { + it('testLazyMapSync' + suffix, function () { // Start with a JSPB array containing a few map entries. - var entries = [['a', 'entry 1'], ['c', 'entry 2'], ['b', 'entry 3']]; - var msg = new msgInfo.constructor([entries]); - assertEquals(entries.length, 3); - assertEquals(entries[0][0], 'a'); - assertEquals(entries[1][0], 'c'); - assertEquals(entries[2][0], 'b'); + const entries = [['a', 'entry 1'], ['c', 'entry 2'], ['b', 'entry 3']]; + const msg = new msgInfo.constructor([entries]); + expect(entries.length).toEqual(3); + expect(entries[0][0]).toEqual('a'); + expect(entries[1][0]).toEqual('c'); + expect(entries[2][0]).toEqual('b'); msg.getMapStringStringMap().del('a'); - assertEquals(entries.length, 3); // not yet sync'd + expect(entries.length).toEqual(3); // not yet sync'd msg.toArray(); // force a sync - assertEquals(entries.length, 2); - assertEquals(entries[0][0], 'b'); // now in sorted order - assertEquals(entries[1][0], 'c'); + expect(entries.length).toEqual(2); + expect(entries[0][0]).toEqual('b'); // now in sorted order + expect(entries[1][0]).toEqual('c'); - var a = msg.toArray(); - assertEquals(a[0], entries); // retains original reference + const a = msg.toArray(); + expect(entries).toEqual(a[0]); // retains original reference }); /** * Returns IteratorIterables for entries(), keys() and values(). */ - it('testIteratorIterables' + suffix, function() { - var msg = new msgInfo.constructor(); - var m = msg.getMapStringStringMap(); + it('testIteratorIterables' + suffix, function () { + const msg = new msgInfo.constructor(); + const m = msg.getMapStringStringMap(); m.set('key1', 'value1'); m.set('key2', 'value2'); - var entryIterator = m.entries(); - assertElementsEquals(entryIterator.next().value, ['key1', 'value1']); - assertElementsEquals(entryIterator.next().value, ['key2', 'value2']); - assertEquals(entryIterator.next().done, true); + const entryIterator = m.entries(); + expect(entryIterator.next().value).toEqual(['key1', 'value1']); + expect(entryIterator.next().value).toEqual(['key2', 'value2']); + expect(entryIterator.next().done).toBeTrue(); try { - var entryIterable = m.entries()[Symbol.iterator](); - assertElementsEquals(entryIterable.next().value, ['key1', 'value1']); - assertElementsEquals(entryIterable.next().value, ['key2', 'value2']); - assertEquals(entryIterable.next().done, true); + const entryIterable = m.entries()[Symbol.iterator](); + expect(entryIterable.next().value).toEqual(['key1', 'value1']); + expect(entryIterable.next().value).toEqual(['key2', 'value2']); + expect(entryIterable.next().done).toBeTrue(); } catch (err) { // jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator] may be // undefined in some environment. @@ -387,16 +387,16 @@ function makeTests(msgInfo, submessageCtor, suffix) { } } - var keyIterator = m.keys(); - assertEquals(keyIterator.next().value, 'key1'); - assertEquals(keyIterator.next().value, 'key2'); - assertEquals(keyIterator.next().done, true); + const keyIterator = m.keys(); + expect(keyIterator.next().value).toEqual('key1'); + expect(keyIterator.next().value).toEqual('key2'); + expect(keyIterator.next().done).toBeTrue(); try { - var keyIterable = m.keys()[Symbol.iterator](); - assertEquals(keyIterable.next().value, 'key1'); - assertEquals(keyIterable.next().value, 'key2'); - assertEquals(keyIterable.next().done, true); + const keyIterable = m.keys()[Symbol.iterator](); + expect(keyIterable.next().value).toEqual('key1'); + expect(keyIterable.next().value).toEqual('key2'); + expect(keyIterable.next().done).toBeTrue(); } catch (err) { // jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator] may be // undefined in some environment. @@ -404,16 +404,16 @@ function makeTests(msgInfo, submessageCtor, suffix) { throw err; } } - var valueIterator = m.values(); - assertEquals(valueIterator.next().value, 'value1'); - assertEquals(valueIterator.next().value, 'value2'); - assertEquals(valueIterator.next().done, true); + const valueIterator = m.values(); + expect(valueIterator.next().value).toEqual('value1'); + expect(valueIterator.next().value).toEqual('value2'); + expect(valueIterator.next().done).toBeTrue(); try { - var valueIterable = m.values()[Symbol.iterator](); - assertEquals(valueIterable.next().value, 'value1'); - assertEquals(valueIterable.next().value, 'value2'); - assertEquals(valueIterable.next().done, true); + const valueIterable = m.values()[Symbol.iterator](); + expect(valueIterable.next().value).toEqual('value1'); + expect(valueIterable.next().value).toEqual('value2'); + expect(valueIterable.next().done).toBeTrue(); } catch (err) { // jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator] may be // undefined in some environment. @@ -424,17 +424,17 @@ function makeTests(msgInfo, submessageCtor, suffix) { }); } -describe('mapsTest', function() { +describe('mapsTest', function () { makeTests( - { - constructor: proto.jspb.test.TestMapFields, - deserializeBinary: proto.jspb.test.TestMapFields.deserializeBinary - }, - proto.jspb.test.MapValueMessage, '_Binary'); + { + constructor: proto.jspb.test.TestMapFields, + deserializeBinary: proto.jspb.test.TestMapFields.deserializeBinary + }, + proto.jspb.test.MapValueMessage, '_Binary'); makeTests( - { - constructor: proto.jspb.test.TestMapFieldsNoBinary, - deserializeBinary: null - }, - proto.jspb.test.MapValueMessageNoBinary, '_NoBinary'); + { + constructor: proto.jspb.test.TestMapFieldsNoBinary, + deserializeBinary: null + }, + proto.jspb.test.MapValueMessageNoBinary, '_NoBinary'); }); diff --git a/message.js b/message.js index cb48114..47c2b8c 100644 --- a/message.js +++ b/message.js @@ -40,14 +40,13 @@ goog.provide('jspb.ExtensionFieldInfo'); goog.provide('jspb.Message'); goog.require('goog.array'); -goog.require('goog.asserts'); goog.require('goog.crypt.base64'); + +goog.require('jspb.asserts'); goog.require('jspb.BinaryReader'); goog.require('jspb.Map'); - - /** * Stores information for a single extension field. * @@ -89,8 +88,8 @@ goog.require('jspb.Map'); * @template T * @export */ -jspb.ExtensionFieldInfo = function(fieldNumber, fieldName, ctor, toObjectFn, - isRepeated) { +jspb.ExtensionFieldInfo = function( + fieldNumber, fieldName, ctor, toObjectFn, isRepeated) { /** @const */ this.fieldIndex = fieldNumber; /** @const */ @@ -117,8 +116,9 @@ jspb.ExtensionFieldInfo = function(fieldNumber, fieldName, ctor, toObjectFn, * @template T * @export */ -jspb.ExtensionFieldBinaryInfo = function(fieldInfo, binaryReaderFn, binaryWriterFn, - opt_binaryMessageSerializeFn, opt_binaryMessageDeserializeFn, opt_isPacked) { +jspb.ExtensionFieldBinaryInfo = function( + fieldInfo, binaryReaderFn, binaryWriterFn, opt_binaryMessageSerializeFn, + opt_binaryMessageDeserializeFn, opt_isPacked) { /** @const */ this.fieldInfo = fieldInfo; /** @const */ @@ -163,8 +163,7 @@ jspb.ExtensionFieldInfo.prototype.isMessageType = function() { * @struct * @export */ -jspb.Message = function() { -}; +jspb.Message = function() {}; /** @@ -413,9 +412,8 @@ jspb.Message.initialize = function( * present. * @private @const {!Object} */ -jspb.Message.EMPTY_LIST_SENTINEL_ = goog.DEBUG && Object.freeze ? - Object.freeze([]) : - []; +jspb.Message.EMPTY_LIST_SENTINEL_ = + goog.DEBUG && Object.freeze ? Object.freeze([]) : []; /** @@ -442,8 +440,8 @@ jspb.Message.isExtensionObject_ = function(o) { // fields can also be array). // NOTE(lukestebbing): We avoid looking at .length to avoid a JIT bug // in Safari on iOS 8. See the description of CL/86511464 for details. - return (o !== null && typeof o == 'object' && - !jspb.Message.isArray_(o) && + return ( + o !== null && typeof o == 'object' && !jspb.Message.isArray_(o) && !(jspb.Message.SUPPORTS_UINT8ARRAY_ && o instanceof Uint8Array)); }; @@ -547,15 +545,15 @@ jspb.Message.toObjectList = function(field, toObjectFn, opt_includeInstance) { * for transitional soy proto support: http://goto/soy-param-migration * @export */ -jspb.Message.toObjectExtension = function(proto, obj, extensions, - getExtensionFn, opt_includeInstance) { +jspb.Message.toObjectExtension = function( + proto, obj, extensions, getExtensionFn, opt_includeInstance) { for (var fieldNumber in extensions) { var fieldInfo = extensions[fieldNumber]; var value = getExtensionFn.call(proto, fieldInfo); if (value != null) { for (var name in fieldInfo.fieldName) { if (fieldInfo.fieldName.hasOwnProperty(name)) { - break; // the compiled field name + break; // the compiled field name } } if (!fieldInfo.toObjectFn) { @@ -580,12 +578,13 @@ jspb.Message.toObjectExtension = function(proto, obj, extensions, * @param {!jspb.Message} proto The proto whose extensions to convert. * @param {*} writer The binary-format writer to write to. * @param {!Object} extensions The proto class' registered extensions. - * @param {function(this:jspb.Message,!jspb.ExtensionFieldInfo) : *} getExtensionFn The proto - * class' getExtension function. Passed for effective dead code removal. + * @param {function(this:jspb.Message,!jspb.ExtensionFieldInfo) : *} + * getExtensionFn The proto class' getExtension function. Passed for + * effective dead code removal. * @export */ -jspb.Message.serializeBinaryExtensions = function(proto, writer, extensions, - getExtensionFn) { +jspb.Message.serializeBinaryExtensions = function( + proto, writer, extensions, getExtensionFn) { for (var fieldNumber in extensions) { var binaryFieldInfo = extensions[fieldNumber]; var fieldInfo = binaryFieldInfo.fieldInfo; @@ -594,8 +593,9 @@ jspb.Message.serializeBinaryExtensions = function(proto, writer, extensions, // need to gracefully error-out here rather than produce a null dereference // below. if (!binaryFieldInfo.binaryWriterFn) { - throw new Error('Message extension present that was generated ' + - 'without binary serialization support'); + throw new Error( + 'Message extension present that was generated ' + + 'without binary serialization support'); } var value = getExtensionFn.call(proto, fieldInfo); if (value != null) { @@ -607,12 +607,14 @@ jspb.Message.serializeBinaryExtensions = function(proto, writer, extensions, // here, at runtime (and this decoupled codegen is the whole point of // extensions!). if (binaryFieldInfo.binaryMessageSerializeFn) { - binaryFieldInfo.binaryWriterFn.call(writer, fieldInfo.fieldIndex, - value, binaryFieldInfo.binaryMessageSerializeFn); + binaryFieldInfo.binaryWriterFn.call( + writer, fieldInfo.fieldIndex, value, + binaryFieldInfo.binaryMessageSerializeFn); } else { - throw new Error('Message extension present holding submessage ' + - 'without binary support enabled, and message is ' + - 'being serialized to binary format'); + throw new Error( + 'Message extension present holding submessage ' + + 'without binary support enabled, and message is ' + + 'being serialized to binary format'); } } else { binaryFieldInfo.binaryWriterFn.call( @@ -630,11 +632,12 @@ jspb.Message.serializeBinaryExtensions = function(proto, writer, extensions, * @param {!jspb.BinaryReader} reader * @param {!Object} extensions The extensions object. * @param {function(this:jspb.Message,!jspb.ExtensionFieldInfo)} getExtensionFn - * @param {function(this:jspb.Message,!jspb.ExtensionFieldInfo, ?)} setExtensionFn + * @param {function(this:jspb.Message,!jspb.ExtensionFieldInfo, ?)} + * setExtensionFn * @export */ -jspb.Message.readBinaryExtension = function(msg, reader, extensions, - getExtensionFn, setExtensionFn) { +jspb.Message.readBinaryExtension = function( + msg, reader, extensions, getExtensionFn, setExtensionFn) { var binaryFieldInfo = extensions[reader.getFieldNumber()]; if (!binaryFieldInfo) { reader.skipField(); @@ -642,8 +645,9 @@ jspb.Message.readBinaryExtension = function(msg, reader, extensions, } var fieldInfo = binaryFieldInfo.fieldInfo; if (!binaryFieldInfo.binaryReaderFn) { - throw new Error('Deserializing extension whose generated code does not ' + - 'support binary format'); + throw new Error( + 'Deserializing extension whose generated code does not ' + + 'support binary format'); } var value; @@ -798,7 +802,7 @@ jspb.Message.bytesAsB64 = function(value) { if (jspb.Message.SUPPORTS_UINT8ARRAY_ && value instanceof Uint8Array) { return goog.crypt.base64.encodeByteArray(value); } - goog.asserts.fail('Cannot coerce to b64 string: ' + goog.typeOf(value)); + jspb.asserts.jspbFail('Cannot coerce to b64 string: ' + goog.typeOf(value)); return null; }; @@ -818,7 +822,7 @@ jspb.Message.bytesAsU8 = function(value) { if (typeof value === 'string') { return goog.crypt.base64.decodeStringToUint8Array(value); } - goog.asserts.fail('Cannot coerce to Uint8Array: ' + goog.typeOf(value)); + jspb.asserts.jspbFail('Cannot coerce to Uint8Array: ' + goog.typeOf(value)); return null; }; @@ -867,7 +871,8 @@ jspb.Message.assertConsistentTypes_ = function(array) { var expected = goog.typeOf(array[0]); goog.array.forEach(array, function(e) { if (goog.typeOf(e) != expected) { - goog.asserts.fail('Inconsistent type in JSPB repeated field array. ' + + jspb.asserts.jspbFail( + 'Inconsistent type in JSPB repeated field array. ' + 'Got ' + goog.typeOf(e) + ' expected ' + expected); } }); @@ -967,8 +972,8 @@ jspb.Message.getFieldProto3 = jspb.Message.getFieldWithDefault; * @return {!jspb.Map|undefined} * @export */ -jspb.Message.getMapField = function(msg, fieldNumber, noLazyCreate, - opt_valueCtor) { +jspb.Message.getMapField = function( + msg, fieldNumber, noLazyCreate, opt_valueCtor) { if (!msg.wrappers_) { msg.wrappers_ = {}; } @@ -985,9 +990,8 @@ jspb.Message.getMapField = function(msg, fieldNumber, noLazyCreate, arr = []; jspb.Message.setField(msg, fieldNumber, arr); } - return msg.wrappers_[fieldNumber] = - new jspb.Map( - /** @type {!Array>} */ (arr), opt_valueCtor); + return msg.wrappers_[fieldNumber] = new jspb.Map( + /** @type {!Array>} */ (arr), opt_valueCtor); }; @@ -1002,7 +1006,7 @@ jspb.Message.getMapField = function(msg, fieldNumber, noLazyCreate, */ jspb.Message.setField = function(msg, fieldNumber, value) { // TODO(b/35241823): replace this with a bounded generic when available - goog.asserts.assertInstanceof(msg, jspb.Message); + jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); if (fieldNumber < msg.pivot_) { msg.array[jspb.Message.getIndex_(msg, fieldNumber)] = value; } else { @@ -1126,7 +1130,7 @@ jspb.Message.setProto3StringIntField = function(msg, fieldNumber, value) { jspb.Message.setFieldIgnoringDefault_ = function( msg, fieldNumber, value, defaultValue) { // TODO(b/35241823): replace this with a bounded generic when available - goog.asserts.assertInstanceof(msg, jspb.Message); + jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); if (value !== defaultValue) { jspb.Message.setField(msg, fieldNumber, value); } else if (fieldNumber < msg.pivot_) { @@ -1151,7 +1155,7 @@ jspb.Message.setFieldIgnoringDefault_ = function( */ jspb.Message.addToRepeatedField = function(msg, fieldNumber, value, opt_index) { // TODO(b/35241823): replace this with a bounded generic when available - goog.asserts.assertInstanceof(msg, jspb.Message); + jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); var arr = jspb.Message.getRepeatedField(msg, fieldNumber); if (opt_index != undefined) { arr.splice(opt_index, 0, value); @@ -1175,7 +1179,7 @@ jspb.Message.addToRepeatedField = function(msg, fieldNumber, value, opt_index) { */ jspb.Message.setOneofField = function(msg, fieldNumber, oneof, value) { // TODO(b/35241823): replace this with a bounded generic when available - goog.asserts.assertInstanceof(msg, jspb.Message); + jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); var currentCase = jspb.Message.computeOneofCase(msg, oneof); if (currentCase && currentCase !== fieldNumber && value !== undefined) { if (msg.wrappers_ && currentCase in msg.wrappers_) { @@ -1307,7 +1311,7 @@ jspb.Message.wrapRepeatedField_ = function(msg, ctor, fieldNumber) { */ jspb.Message.setWrapperField = function(msg, fieldNumber, value) { // TODO(b/35241823): replace this with a bounded generic when available - goog.asserts.assertInstanceof(msg, jspb.Message); + jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); if (!msg.wrappers_) { msg.wrappers_ = {}; } @@ -1330,7 +1334,7 @@ jspb.Message.setWrapperField = function(msg, fieldNumber, value) { */ jspb.Message.setOneofWrapperField = function(msg, fieldNumber, oneof, value) { // TODO(b/35241823): replace this with a bounded generic when available - goog.asserts.assertInstanceof(msg, jspb.Message); + jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); if (!msg.wrappers_) { msg.wrappers_ = {}; } @@ -1351,7 +1355,7 @@ jspb.Message.setOneofWrapperField = function(msg, fieldNumber, oneof, value) { */ jspb.Message.setRepeatedWrapperField = function(msg, fieldNumber, value) { // TODO(b/35241823): replace this with a bounded generic when available - goog.asserts.assertInstanceof(msg, jspb.Message); + jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); if (!msg.wrappers_) { msg.wrappers_ = {}; } @@ -1429,8 +1433,10 @@ jspb.Message.toMap = function( var result = {}; for (var i = 0; i < field.length; i++) { result[mapKeyGetterFn.call(field[i])] = opt_toObjectFn ? - opt_toObjectFn.call(field[i], opt_includeInstance, - /** @type {!jspb.Message} */ (field[i])) : field[i]; + opt_toObjectFn.call( + field[i], opt_includeInstance, + /** @type {!jspb.Message} */ (field[i])) : + field[i]; } return result; }; @@ -1483,19 +1489,17 @@ jspb.Message.prototype.toArray = function() { if (jspb.Message.GENERATE_TO_STRING) { - -/** - * Creates a string representation of the internal data array of this proto. - *

NOTE: This string is *not* suitable for use in server requests. - * @return {string} A string representation of this proto. - * @override - * @export - */ -jspb.Message.prototype.toString = function() { - this.syncMapFields_(); - return this.array.toString(); -}; - + /** + * Creates a string representation of the internal data array of this proto. + *

NOTE: This string is *not* suitable for use in server requests. + * @return {string} A string representation of this proto. + * @override + * @export + */ + jspb.Message.prototype.toString = function() { + this.syncMapFields_(); + return this.array.toString(); + }; } /** @@ -1516,11 +1520,10 @@ jspb.Message.prototype.getExtension = function(fieldInfo) { if (fieldInfo.isRepeated) { if (fieldInfo.isMessageType()) { if (!this.wrappers_[fieldNumber]) { - this.wrappers_[fieldNumber] = - goog.array.map(this.extensionObject_[fieldNumber] || [], - function(arr) { - return new fieldInfo.ctor(arr); - }); + this.wrappers_[fieldNumber] = goog.array.map( + this.extensionObject_[fieldNumber] || [], function(arr) { + return new fieldInfo.ctor(arr); + }); } return this.wrappers_[fieldNumber]; } else { @@ -1566,8 +1569,8 @@ jspb.Message.prototype.setExtension = function(fieldInfo, value) { self.wrappers_[fieldNumber] = value; self.extensionObject_[fieldNumber] = goog.array.map( /** @type {!Array} */ (value), function(msg) { - return msg.toArray(); - }); + return msg.toArray(); + }); } else { self.extensionObject_[fieldNumber] = value; } @@ -1637,8 +1640,9 @@ jspb.Message.difference = function(m1, m2) { * @export */ jspb.Message.equals = function(m1, m2) { - return m1 == m2 || (!!(m1 && m2) && (m1 instanceof m2.constructor) && - jspb.Message.compareFields(m1.toArray(), m2.toArray())); + return m1 == m2 || + (!!(m1 && m2) && (m1 instanceof m2.constructor) && + jspb.Message.compareFields(m1.toArray(), m2.toArray())); }; @@ -1694,14 +1698,14 @@ jspb.Message.compareFields = function(field1, field2) { } // We have two objects. If they're different types, they're not equal. - field1 = /** @type {!Object} */(field1); - field2 = /** @type {!Object} */(field2); + field1 = /** @type {!Object} */ (field1); + field2 = /** @type {!Object} */ (field2); if (field1.constructor != field2.constructor) return false; // If both are Uint8Arrays, compare them element-by-element. if (jspb.Message.SUPPORTS_UINT8ARRAY_ && field1.constructor === Uint8Array) { - var bytes1 = /** @type {!Uint8Array} */(field1); - var bytes2 = /** @type {!Uint8Array} */(field2); + var bytes1 = /** @type {!Uint8Array} */ (field1); + var bytes2 = /** @type {!Uint8Array} */ (field2); if (bytes1.length != bytes2.length) return false; for (var i = 0; i < bytes1.length; i++) { if (bytes1[i] != bytes2[i]) return false; @@ -1723,15 +1727,15 @@ jspb.Message.compareFields = function(field1, field2) { var val2 = typedField2[i]; if (val1 && (val1.constructor == Object)) { - goog.asserts.assert(extension1 === undefined); - goog.asserts.assert(i === typedField1.length - 1); + jspb.asserts.jspbAssert(extension1 === undefined); + jspb.asserts.jspbAssert(i === typedField1.length - 1); extension1 = val1; val1 = undefined; } if (val2 && (val2.constructor == Object)) { - goog.asserts.assert(extension2 === undefined); - goog.asserts.assert(i === typedField2.length - 1); + jspb.asserts.jspbAssert(extension2 === undefined); + jspb.asserts.jspbAssert(i === typedField2.length - 1); extension2 = val2; val2 = undefined; } @@ -1822,11 +1826,11 @@ jspb.Message.cloneMessage = function(msg) { * @export */ jspb.Message.copyInto = function(fromMessage, toMessage) { - goog.asserts.assertInstanceof(fromMessage, jspb.Message); - goog.asserts.assertInstanceof(toMessage, jspb.Message); - - if(fromMessage.constructor !== toMessage.constructor) - throw new Error('Copy source and target message should have the same type.'); + jspb.asserts.jspbAssertInstanceof(fromMessage, jspb.Message); + jspb.asserts.jspbAssertInstanceof(toMessage, jspb.Message); + jspb.asserts.jspbAssert( + fromMessage.constructor == toMessage.constructor, + 'Copy source and target message should have the same type.'); var copyOfFrom = jspb.Message.clone(fromMessage); @@ -1865,7 +1869,7 @@ jspb.Message.clone_ = function(obj) { // NOTE:redundant null check existing for NTI compatibility. // see b/70515949 clonedArray[i] = (typeof o == 'object') ? - jspb.Message.clone_(goog.asserts.assert(o)) : + jspb.Message.clone_(jspb.asserts.jspbAssert(o)) : o; } } @@ -1881,7 +1885,7 @@ jspb.Message.clone_ = function(obj) { // NOTE:redundant null check existing for NTI compatibility. // see b/70515949 clone[key] = (typeof o == 'object') ? - jspb.Message.clone_(goog.asserts.assert(o)) : + jspb.Message.clone_(jspb.asserts.jspbAssert(o)) : o; } } @@ -1896,8 +1900,9 @@ jspb.Message.clone_ = function(obj) { * @export */ jspb.Message.registerMessageType = function(id, constructor) { - // This is needed so we can later access messageId directly on the constructor, - // otherwise it is not available due to 'property collapsing' by the compiler. + // This is needed so we can later access messageId directly on the + // constructor, otherwise it is not available due to 'property collapsing' by + // the compiler. /** * @suppress {strictMissingProperties} messageId is not defined on Function */ diff --git a/message_test.js b/message_test.js index 7e25dbc..a5bb0c9 100644 --- a/message_test.js +++ b/message_test.js @@ -33,13 +33,15 @@ goog.setTestOnly(); goog.require('goog.testing.PropertyReplacer'); -goog.require('goog.testing.asserts'); -goog.require('goog.testing.TestCase'); + goog.require('goog.userAgent'); // CommonJS-LoadFromFile: protos/google-protobuf jspb goog.require('jspb.Message'); +// CommonJS-LoadFromFile: protos/google-protobuf jspb.asserts +goog.require('jspb.asserts'); + // CommonJS-LoadFromFile: protos/test15_pb proto.jspb.filenametest.package1 goog.require('proto.jspb.filenametest.package1.b'); @@ -125,7 +127,7 @@ goog.require('proto.jspb.test.MessageWithLargeFieldNumbers'); goog.require('proto.jspb.test.simple1'); describe('Message test suite', function() { - var stubs = new goog.testing.PropertyReplacer(); + const stubs = new goog.testing.PropertyReplacer(); beforeEach(function() { stubs.set(jspb.Message, 'SERIALIZE_EMPTY_TRAILING_FIELDS', false); @@ -136,112 +138,98 @@ describe('Message test suite', function() { }); it('testEmptyProto', function() { - var empty1 = new proto.jspb.test.Empty([]); - var empty2 = new proto.jspb.test.Empty([]); - assertObjectEquals({}, empty1.toObject()); - assertObjectEquals('Message should not be corrupted:', empty2, empty1); + const empty1 = new proto.jspb.test.Empty([]); + const empty2 = new proto.jspb.test.Empty([]); + expect(empty1.toObject()).toEqual({}); + expect(empty1).toEqual(empty2); }); it('testTopLevelEnum', function() { - var response = new proto.jspb.test.EnumContainer([]); + const response = new proto.jspb.test.EnumContainer([]); response.setOuterEnum(proto.jspb.test.OuterEnum.FOO); - assertEquals(proto.jspb.test.OuterEnum.FOO, response.getOuterEnum()); + expect(response.getOuterEnum()).toEqual(proto.jspb.test.OuterEnum.FOO); }); it('testByteStrings', function() { - var data = new proto.jspb.test.DefaultValues([]); + const data = new proto.jspb.test.DefaultValues([]); data.setBytesField('some_bytes'); - assertEquals('some_bytes', data.getBytesField()); + expect(data.getBytesField()).toEqual('some_bytes'); }); it('testComplexConversion', function() { - var data1 = ['a', , , [, 11], [[, 22], [, 33]], , ['s1', 's2'], , 1]; - var data2 = ['a', , , [, 11], [[, 22], [, 33]], , ['s1', 's2'], , 1]; - var foo = new proto.jspb.test.Complex(data1); - var bar = new proto.jspb.test.Complex(data2); - var result = foo.toObject(); - assertObjectEquals( - { - aString: 'a', - anOutOfOrderBool: true, - aNestedMessage: {anInt: 11}, - aRepeatedMessageList: [{anInt: 22}, {anInt: 33}], - aRepeatedStringList: ['s1', 's2'], - aFloatingPointField: undefined, - }, - result); + const data1 = ['a', , , [, 11], [[, 22], [, 33]], , ['s1', 's2'], , 1]; + const foo = new proto.jspb.test.Complex(data1); + let result = foo.toObject(); + expect(result).toEqual({ + aString: 'a', + anOutOfOrderBool: true, + aNestedMessage: {anInt: 11}, + aRepeatedMessageList: [{anInt: 22}, {anInt: 33}], + aRepeatedStringList: ['s1', 's2'], + aFloatingPointField: undefined, + }); // Now test with the jspb instances included. result = foo.toObject(true /* opt_includeInstance */); - assertObjectEquals( - { - aString: 'a', - anOutOfOrderBool: true, - aNestedMessage: - {anInt: 11, $jspbMessageInstance: foo.getANestedMessage()}, - aRepeatedMessageList: [ - {anInt: 22, $jspbMessageInstance: foo.getARepeatedMessageList()[0]}, - {anInt: 33, $jspbMessageInstance: foo.getARepeatedMessageList()[1]} - ], - aRepeatedStringList: ['s1', 's2'], - aFloatingPointField: undefined, - $jspbMessageInstance: foo - }, - result); + expect(result).toEqual({ + aString: 'a', + anOutOfOrderBool: true, + aNestedMessage: + {anInt: 11, $jspbMessageInstance: foo.getANestedMessage()}, + aRepeatedMessageList: [ + {anInt: 22, $jspbMessageInstance: foo.getARepeatedMessageList()[0]}, + {anInt: 33, $jspbMessageInstance: foo.getARepeatedMessageList()[1]} + ], + aRepeatedStringList: ['s1', 's2'], + aFloatingPointField: undefined, + $jspbMessageInstance: foo + }); }); it('testMissingFields', function() { - var foo = new proto.jspb.test.Complex([ - undefined, undefined, undefined, [], undefined, undefined, undefined, - undefined - ]); - var bar = new proto.jspb.test.Complex([ + const foo = new proto.jspb.test.Complex([ undefined, undefined, undefined, [], undefined, undefined, undefined, undefined ]); - var result = foo.toObject(); - assertObjectEquals( - { - aString: undefined, - anOutOfOrderBool: undefined, - aNestedMessage: {anInt: undefined}, - // Note: JsPb converts undefined repeated fields to empty arrays. - aRepeatedMessageList: [], - aRepeatedStringList: [], - aFloatingPointField: undefined, - }, - result); + const result = foo.toObject(); + expect(result).toEqual({ + aString: undefined, + anOutOfOrderBool: undefined, + aNestedMessage: {anInt: undefined}, + // Note: JsPb converts undefined repeated fields to empty arrays. + aRepeatedMessageList: [], + aRepeatedStringList: [], + aFloatingPointField: undefined, + }); }); it('testNestedComplexMessage', function() { // Instantiate the message and set a unique field, just to ensure that we // are not getting jspb.test.Complex instead. - var msg = new proto.jspb.test.OuterMessage.Complex(); + const msg = new proto.jspb.test.OuterMessage.Complex(); msg.setInnerComplexField(5); }); it('testSpecialCases', function() { // Note: Some property names are reserved in JavaScript. // These names are converted to the Js property named pb_. - var special = new proto.jspb.test.SpecialCases( + const special = new proto.jspb.test.SpecialCases( ['normal', 'default', 'function', 'var']); - var result = special.toObject(); - assertObjectEquals( - { - normal: 'normal', - pb_default: 'default', - pb_function: 'function', - pb_var: 'var' - }, - result); + const result = special.toObject(); + expect(result).toEqual({ + normal: 'normal', + pb_default: 'default', + pb_function: 'function', + pb_var: 'var' + }); }); it('testDefaultValues', function() { - var defaultString = 'default<>\'"abc'; - var response = new proto.jspb.test.DefaultValues(); + const defaultString = 'default<>\'"abc'; + let response = new proto.jspb.test.DefaultValues(); // Test toObject - var expectedObject = { + const expectedObject = { stringField: defaultString, boolField: true, intField: 11, @@ -249,17 +237,17 @@ describe('Message test suite', function() { emptyField: '', bytesField: 'bW9v' }; - assertObjectEquals(expectedObject, response.toObject()); + expect(response.toObject()).toEqual(expectedObject); // Test getters response = new proto.jspb.test.DefaultValues(); - assertEquals(defaultString, response.getStringField()); - assertEquals(true, response.getBoolField()); - assertEquals(11, response.getIntField()); - assertEquals(13, response.getEnumField()); - assertEquals('', response.getEmptyField()); - assertEquals('bW9v', response.getBytesField()); + expect(response.getStringField()).toEqual(defaultString); + expect(response.getBoolField()).toEqual(true); + expect(response.getIntField()).toEqual(11); + expect(response.getEnumField()).toEqual(13); + expect(response.getEmptyField()).toEqual(''); + expect(response.getBytesField()).toEqual('bW9v'); function makeDefault(values) { return new proto.jspb.test.DefaultValues(values); @@ -268,36 +256,36 @@ describe('Message test suite', function() { // Test with undefined values, // Use push to workaround IE treating undefined array elements as holes. response = makeDefault([undefined, undefined, undefined, undefined]); - assertEquals(defaultString, response.getStringField()); - assertEquals(true, response.getBoolField()); - assertEquals(11, response.getIntField()); - assertEquals(13, response.getEnumField()); - assertFalse(response.hasStringField()); - assertFalse(response.hasBoolField()); - assertFalse(response.hasIntField()); - assertFalse(response.hasEnumField()); + expect(response.getStringField()).toEqual(defaultString); + expect(response.getBoolField()).toEqual(true); + expect(response.getIntField()).toEqual(11); + expect(response.getEnumField()).toEqual(13); + expect(response.hasStringField()).toEqual(false); + expect(response.hasBoolField()).toEqual(false); + expect(response.hasIntField()).toEqual(false); + expect(response.hasEnumField()).toEqual(false); // Test with null values, as would be returned by a JSON serializer. response = makeDefault([null, null, null, null]); - assertEquals(defaultString, response.getStringField()); - assertEquals(true, response.getBoolField()); - assertEquals(11, response.getIntField()); - assertEquals(13, response.getEnumField()); - assertFalse(response.hasStringField()); - assertFalse(response.hasBoolField()); - assertFalse(response.hasIntField()); - assertFalse(response.hasEnumField()); + expect(response.getStringField()).toEqual(defaultString); + expect(response.getBoolField()).toEqual(true); + expect(response.getIntField()).toEqual(11); + expect(response.getEnumField()).toEqual(13); + expect(response.hasStringField()).toEqual(false); + expect(response.hasBoolField()).toEqual(false); + expect(response.hasIntField()).toEqual(false); + expect(response.hasEnumField()).toEqual(false); // Test with false-like values. response = makeDefault(['', false, 0, 0]); - assertEquals('', response.getStringField()); - assertEquals(false, response.getBoolField()); - assertEquals(true, response.getIntField() == 0); - assertEquals(true, response.getEnumField() == 0); - assertTrue(response.hasStringField()); - assertTrue(response.hasBoolField()); - assertTrue(response.hasIntField()); - assertTrue(response.hasEnumField()); + expect(response.getStringField()).toEqual(''); + expect(response.getBoolField()).toEqual(false); + expect(response.getIntField()).toEqual(0); + expect(response.getEnumField()).toEqual(0); + expect(response.hasStringField()).toEqual(true); + expect(response.hasBoolField()).toEqual(true); + expect(response.hasIntField()).toEqual(true); + expect(response.hasEnumField()).toEqual(true); // Test that clearing the values reverts them to the default state. response = makeDefault(['blah', false, 111, 77]); @@ -305,14 +293,14 @@ describe('Message test suite', function() { response.clearBoolField(); response.clearIntField(); response.clearEnumField(); - assertEquals(defaultString, response.getStringField()); - assertEquals(true, response.getBoolField()); - assertEquals(11, response.getIntField()); - assertEquals(13, response.getEnumField()); - assertFalse(response.hasStringField()); - assertFalse(response.hasBoolField()); - assertFalse(response.hasIntField()); - assertFalse(response.hasEnumField()); + expect(response.getStringField()).toEqual(defaultString); + expect(response.getBoolField()).toEqual(true); + expect(response.getIntField()).toEqual(11); + expect(response.getEnumField()).toEqual(13); + expect(response.hasStringField()).toEqual(false); + expect(response.hasBoolField()).toEqual(false); + expect(response.hasIntField()).toEqual(false); + expect(response.hasEnumField()).toEqual(false); // Test that setFoo(null) clears the values. response = makeDefault(['blah', false, 111, 77]); @@ -320,460 +308,466 @@ describe('Message test suite', function() { response.setBoolField(null); response.setIntField(undefined); response.setEnumField(undefined); - assertEquals(defaultString, response.getStringField()); - assertEquals(true, response.getBoolField()); - assertEquals(11, response.getIntField()); - assertEquals(13, response.getEnumField()); - assertFalse(response.hasStringField()); - assertFalse(response.hasBoolField()); - assertFalse(response.hasIntField()); - assertFalse(response.hasEnumField()); + expect(response.getStringField()).toEqual(defaultString); + expect(response.getBoolField()).toEqual(true); + expect(response.getIntField()).toEqual(11); + expect(response.getEnumField()).toEqual(13); + expect(response.hasStringField()).toEqual(false); + expect(response.hasBoolField()).toEqual(false); + expect(response.hasIntField()).toEqual(false); + expect(response.hasEnumField()).toEqual(false); }); it('testEqualsSimple', function() { - var s1 = new proto.jspb.test.Simple1(['hi']); - assertTrue(jspb.Message.equals(s1, new proto.jspb.test.Simple1(['hi']))); - assertFalse(jspb.Message.equals(s1, new proto.jspb.test.Simple1(['bye']))); - var s1b = new proto.jspb.test.Simple1(['hi', ['hello']]); - assertTrue(jspb.Message.equals( - s1b, new proto.jspb.test.Simple1(['hi', ['hello']]))); - assertTrue(jspb.Message.equals(s1b, new proto.jspb.test.Simple1([ + const s1 = new proto.jspb.test.Simple1(['hi']); + expect(jspb.Message.equals(s1, new proto.jspb.test.Simple1(['hi']))) + .toEqual(true); + expect(jspb.Message.equals(s1, new proto.jspb.test.Simple1(['bye']))) + .toEqual(false); + const s1b = new proto.jspb.test.Simple1(['hi', ['hello']]); + expect(jspb.Message.equals(s1b, new proto.jspb.test.Simple1([ + 'hi', ['hello'] + ]))).toEqual(true); + expect(jspb.Message.equals(s1b, new proto.jspb.test.Simple1([ 'hi', ['hello', undefined, undefined, undefined] - ]))); - assertFalse(jspb.Message.equals( - s1b, new proto.jspb.test.Simple1(['no', ['hello']]))); + ]))).toEqual(true); + expect(jspb.Message.equals(s1b, new proto.jspb.test.Simple1([ + 'no', ['hello'] + ]))).toEqual(false); // Test with messages of different types - var s2 = new proto.jspb.test.Simple2(['hi']); - assertFalse(jspb.Message.equals(s1, s2)); + const s2 = new proto.jspb.test.Simple2(['hi']); + expect(jspb.Message.equals(s1, s2)).toEqual(false); }); it('testEquals_softComparison', function() { - var s1 = new proto.jspb.test.Simple1(['hi', [], null]); - assertTrue( - jspb.Message.equals(s1, new proto.jspb.test.Simple1(['hi', []]))); + const s1 = new proto.jspb.test.Simple1(['hi', [], null]); + expect(jspb.Message.equals(s1, new proto.jspb.test.Simple1(['hi', []]))) + .toBeTrue(); - var s1b = new proto.jspb.test.Simple1(['hi', [], true]); - assertTrue( - jspb.Message.equals(s1b, new proto.jspb.test.Simple1(['hi', [], 1]))); + const s1b = new proto.jspb.test.Simple1(['hi', [], true]); + expect(jspb.Message.equals(s1b, new proto.jspb.test.Simple1(['hi', [], 1]))) + .toBeTrue(); }); it('testEqualsComplex', function() { - var data1 = ['a', , , [, 11], [[, 22], [, 33]], , ['s1', 's2'], , 1]; - var data2 = ['a', , , [, 11], [[, 22], [, 34]], , ['s1', 's2'], , 1]; - var data3 = ['a', , , [, 11], [[, 22]], , ['s1', 's2'], , 1]; - var data4 = ['hi']; - var c1a = new proto.jspb.test.Complex(data1); - var c1b = new proto.jspb.test.Complex(data1); - var c2 = new proto.jspb.test.Complex(data2); - var c3 = new proto.jspb.test.Complex(data3); - var s1 = new proto.jspb.test.Simple1(data4); - - assertTrue(jspb.Message.equals(c1a, c1b)); - assertFalse(jspb.Message.equals(c1a, c2)); - assertFalse(jspb.Message.equals(c2, c3)); - assertFalse(jspb.Message.equals(c1a, s1)); + const data1 = ['a', , , [, 11], [[, 22], [, 33]], , ['s1', 's2'], , 1]; + const data2 = ['a', , , [, 11], [[, 22], [, 34]], , ['s1', 's2'], , 1]; + const data3 = ['a', , , [, 11], [[, 22]], , ['s1', 's2'], , 1]; + const data4 = ['hi']; + const c1a = new proto.jspb.test.Complex(data1); + const c1b = new proto.jspb.test.Complex(data1); + const c2 = new proto.jspb.test.Complex(data2); + const c3 = new proto.jspb.test.Complex(data3); + const s1 = new proto.jspb.test.Simple1(data4); + + expect(jspb.Message.equals(c1a, c1b)).toBeTrue(); + expect(jspb.Message.equals(c1a, c2)).toBeFalse(); + expect(jspb.Message.equals(c2, c3)).toBeFalse(); + expect(jspb.Message.equals(c1a, s1)).toBeFalse(); }); it('testEqualsExtensionsConstructed', function() { - assertTrue(jspb.Message.equals( - new proto.jspb.test.HasExtensions([]), - new proto.jspb.test.HasExtensions([{}]))); - assertTrue(jspb.Message.equals( - new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]), - new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]))); - assertFalse(jspb.Message.equals( - new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]), - new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'b'}]}]))); - assertTrue(jspb.Message.equals( - new proto.jspb.test.HasExtensions([{100: [{200: 'a'}]}]), - new proto.jspb.test.HasExtensions([{100: [{200: 'a'}]}]))); - assertTrue(jspb.Message.equals( - new proto.jspb.test.HasExtensions([{100: [{200: 'a'}]}]), - new proto.jspb.test.HasExtensions([, , , {100: [{200: 'a'}]}]))); - assertTrue(jspb.Message.equals( - new proto.jspb.test.HasExtensions([, , , {100: [{200: 'a'}]}]), - new proto.jspb.test.HasExtensions([{100: [{200: 'a'}]}]))); - assertTrue(jspb.Message.equals( - new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]), - new proto.jspb.test.HasExtensions(['hi', , , {100: [{200: 'a'}]}]))); - assertTrue(jspb.Message.equals( - new proto.jspb.test.HasExtensions(['hi', , , {100: [{200: 'a'}]}]), - new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]))); + expect(jspb.Message.equals( + new proto.jspb.test.HasExtensions([]), + new proto.jspb.test.HasExtensions([{}]))) + .toBeTrue(); + expect(jspb.Message.equals( + new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]), + new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]))) + .toBeTrue(); + expect(jspb.Message.equals( + new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]), + new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'b'}]}]))) + .toBeFalse(); + expect(jspb.Message.equals( + new proto.jspb.test.HasExtensions([{100: [{200: 'a'}]}]), + new proto.jspb.test.HasExtensions([{100: [{200: 'a'}]}]))) + .toBeTrue(); + expect(jspb.Message.equals( + new proto.jspb.test.HasExtensions([{100: [{200: 'a'}]}]), + new proto.jspb.test.HasExtensions([, , , {100: [{200: 'a'}]}]))) + .toBeTrue(); + expect(jspb.Message.equals( + new proto.jspb.test.HasExtensions([, , , {100: [{200: 'a'}]}]), + new proto.jspb.test.HasExtensions([{100: [{200: 'a'}]}]))) + .toBeTrue(); + expect( + jspb.Message.equals( + new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]), + new proto.jspb.test.HasExtensions(['hi', , , {100: [{200: 'a'}]}]))) + .toBeTrue(); + expect( + jspb.Message.equals( + new proto.jspb.test.HasExtensions(['hi', , , {100: [{200: 'a'}]}]), + new proto.jspb.test.HasExtensions(['hi', {100: [{200: 'a'}]}]))) + .toBeTrue(); }); it('testEqualsExtensionsUnconstructed', function() { - assertTrue(jspb.Message.compareFields([], [{}])); - assertTrue(jspb.Message.compareFields([, , , {}], [])); - assertTrue(jspb.Message.compareFields([, , , {}], [, , {}])); - assertTrue(jspb.Message.compareFields( - ['hi', {100: [{200: 'a'}]}], ['hi', {100: [{200: 'a'}]}])); - assertFalse(jspb.Message.compareFields( - ['hi', {100: [{200: 'a'}]}], ['hi', {100: [{200: 'b'}]}])); - assertTrue(jspb.Message.compareFields( - [{100: [{200: 'a'}]}], [{100: [{200: 'a'}]}])); - assertTrue(jspb.Message.compareFields( - [{100: [{200: 'a'}]}], [, , , {100: [{200: 'a'}]}])); - assertTrue(jspb.Message.compareFields( - [, , , {100: [{200: 'a'}]}], [{100: [{200: 'a'}]}])); - assertTrue(jspb.Message.compareFields( - ['hi', {100: [{200: 'a'}]}], ['hi', , , {100: [{200: 'a'}]}])); - assertTrue(jspb.Message.compareFields( - ['hi', , , {100: [{200: 'a'}]}], ['hi', {100: [{200: 'a'}]}])); + expect(jspb.Message.compareFields([], [{}])).toBeTrue(); + expect(jspb.Message.compareFields([, , , {}], [])).toBeTrue(); + expect(jspb.Message.compareFields([, , , {}], [, , {}])).toBeTrue(); + expect(jspb.Message.compareFields(['hi', {100: [{200: 'a'}]}], [ + 'hi', {100: [{200: 'a'}]} + ])).toBeTrue(); + expect(jspb.Message.compareFields(['hi', {100: [{200: 'a'}]}], [ + 'hi', {100: [{200: 'b'}]} + ])).toBeFalse(); + expect(jspb.Message.compareFields([{100: [{200: 'a'}]}], [ + {100: [{200: 'a'}]} + ])).toBeTrue(); + expect(jspb.Message.compareFields([{100: [{200: 'a'}]}], [ + , , , {100: [{200: 'a'}]} + ])).toBeTrue(); + expect(jspb.Message.compareFields([, , , {100: [{200: 'a'}]}], [ + {100: [{200: 'a'}]} + ])).toBeTrue(); + expect(jspb.Message.compareFields(['hi', {100: [{200: 'a'}]}], [ + 'hi', , , {100: [{200: 'a'}]} + ])).toBeTrue(); + expect(jspb.Message.compareFields(['hi', , , {100: [{200: 'a'}]}], [ + 'hi', {100: [{200: 'a'}]} + ])).toBeTrue(); }); it('testInitializeMessageWithLastFieldNull', function() { // This tests for regression to bug http://b/117298778 - var msg = new proto.jspb.test.TestLastFieldBeforePivot([null]); - assertNotUndefined(msg.getLastFieldBeforePivot()); + const msg = new proto.jspb.test.TestLastFieldBeforePivot([null]); + expect(msg.getLastFieldBeforePivot()).not.toBeUndefined(); }); it('testEqualsNonFinite', function() { - assertTrue(jspb.Message.compareFields(NaN, NaN)); - assertTrue(jspb.Message.compareFields(NaN, 'NaN')); - assertTrue(jspb.Message.compareFields('NaN', NaN)); - assertTrue(jspb.Message.compareFields(Infinity, Infinity)); - assertTrue(jspb.Message.compareFields(Infinity, 'Infinity')); - assertTrue(jspb.Message.compareFields('-Infinity', -Infinity)); - assertTrue(jspb.Message.compareFields([NaN], ['NaN'])); - assertFalse(jspb.Message.compareFields(undefined, NaN)); - assertFalse(jspb.Message.compareFields(NaN, undefined)); + expect(jspb.Message.compareFields(NaN, NaN)).toEqual(true); + expect(jspb.Message.compareFields(NaN, 'NaN')).toEqual(true); + expect(jspb.Message.compareFields('NaN', NaN)).toEqual(true); + expect(jspb.Message.compareFields(Infinity, Infinity)).toEqual(true); + expect(jspb.Message.compareFields(Infinity, 'Infinity')).toEqual(true); + expect(jspb.Message.compareFields('-Infinity', -Infinity)).toEqual(true); + expect(jspb.Message.compareFields([NaN], ['NaN'])).toEqual(true); + expect(jspb.Message.compareFields(undefined, NaN)).toEqual(false); + expect(jspb.Message.compareFields(NaN, undefined)).toEqual(false); }); it('testToMap', function() { - var p1 = new proto.jspb.test.Simple1(['k', ['v']]); - var p2 = new proto.jspb.test.Simple1(['k1', ['v1', 'v2']]); - var soymap = jspb.Message.toMap( + const p1 = new proto.jspb.test.Simple1(['k', ['v']]); + const p2 = new proto.jspb.test.Simple1(['k1', ['v1', 'v2']]); + const soymap = jspb.Message.toMap( [p1, p2], proto.jspb.test.Simple1.prototype.getAString, proto.jspb.test.Simple1.prototype.toObject); - assertEquals('k', soymap['k'].aString); - assertArrayEquals(['v'], soymap['k'].aRepeatedStringList); - var protomap = jspb.Message.toMap( + expect(soymap['k'].aString).toEqual('k'); + expect(soymap['k'].aRepeatedStringList).toEqual(['v']); + const protomap = jspb.Message.toMap( [p1, p2], proto.jspb.test.Simple1.prototype.getAString); - assertEquals('k', protomap['k'].getAString()); - assertArrayEquals(['v'], protomap['k'].getARepeatedStringList()); + expect(protomap['k'].getAString()).toEqual('k'); + expect(protomap['k'].getARepeatedStringList()).toEqual(['v']); }); it('testClone', function() { - var supportsUint8Array = + const supportsUint8Array = !goog.userAgent.IE || goog.userAgent.isVersionOrHigher('10'); - var original = new proto.jspb.test.TestClone(); + const original = new proto.jspb.test.TestClone(); original.setStr('v1'); - var simple1 = new proto.jspb.test.Simple1(['x1', ['y1', 'z1']]); - var simple2 = new proto.jspb.test.Simple1(['x2', ['y2', 'z2']]); - var simple3 = new proto.jspb.test.Simple1(['x3', ['y3', 'z3']]); + const simple1 = new proto.jspb.test.Simple1(['x1', ['y1', 'z1']]); + const simple2 = new proto.jspb.test.Simple1(['x2', ['y2', 'z2']]); + const simple3 = new proto.jspb.test.Simple1(['x3', ['y3', 'z3']]); original.setSimple1(simple1); original.setSimple2List([simple2, simple3]); - var bytes1 = supportsUint8Array ? new Uint8Array([1, 2, 3]) : '123'; + const bytes1 = supportsUint8Array ? new Uint8Array([1, 2, 3]) : '123'; original.setBytesField(bytes1); - var extension = new proto.jspb.test.CloneExtension(); + const extension = new proto.jspb.test.CloneExtension(); extension.setExt('e1'); original.setExtension(proto.jspb.test.IsExtension.extField, extension); - var clone = original.clone(); - assertArrayEquals( - [ - 'v1', , ['x1', ['y1', 'z1']], , - [['x2', ['y2', 'z2']], ['x3', ['y3', 'z3']]], bytes1, , - {100: [, 'e1']} - ], - clone.toArray()); + const clone = original.clone(); + expect(clone.toArray()).toEqual([ + 'v1', , ['x1', ['y1', 'z1']], , + [['x2', ['y2', 'z2']], ['x3', ['y3', 'z3']]], bytes1, , {100: [, 'e1']} + ]); clone.setStr('v2'); - var simple4 = new proto.jspb.test.Simple1(['a1', ['b1', 'c1']]); - var simple5 = new proto.jspb.test.Simple1(['a2', ['b2', 'c2']]); - var simple6 = new proto.jspb.test.Simple1(['a3', ['b3', 'c3']]); + const simple4 = new proto.jspb.test.Simple1(['a1', ['b1', 'c1']]); + const simple5 = new proto.jspb.test.Simple1(['a2', ['b2', 'c2']]); + const simple6 = new proto.jspb.test.Simple1(['a3', ['b3', 'c3']]); clone.setSimple1(simple4); clone.setSimple2List([simple5, simple6]); if (supportsUint8Array) { clone.getBytesField()[0] = 4; - assertObjectEquals(bytes1, original.getBytesField()); + expect(original.getBytesField()).toEqual(bytes1); } - var bytes2 = supportsUint8Array ? new Uint8Array([4, 5, 6]) : '456'; + const bytes2 = supportsUint8Array ? new Uint8Array([4, 5, 6]) : '456'; clone.setBytesField(bytes2); - var newExtension = new proto.jspb.test.CloneExtension(); + const newExtension = new proto.jspb.test.CloneExtension(); newExtension.setExt('e2'); clone.setExtension(proto.jspb.test.CloneExtension.extField, newExtension); - assertArrayEquals( - [ - 'v2', , ['a1', ['b1', 'c1']], , - [['a2', ['b2', 'c2']], ['a3', ['b3', 'c3']]], bytes2, , - {100: [, 'e2']} - ], - clone.toArray()); - assertArrayEquals( - [ - 'v1', , ['x1', ['y1', 'z1']], , - [['x2', ['y2', 'z2']], ['x3', ['y3', 'z3']]], bytes1, , - {100: [, 'e1']} - ], - original.toArray()); + expect(clone.toArray()).toEqual([ + 'v2', , ['a1', ['b1', 'c1']], , + [['a2', ['b2', 'c2']], ['a3', ['b3', 'c3']]], bytes2, , {100: [, 'e2']} + ]); + + expect(original.toArray()).toEqual([ + 'v1', , ['x1', ['y1', 'z1']], , + [['x2', ['y2', 'z2']], ['x3', ['y3', 'z3']]], bytes1, , {100: [, 'e1']} + ]); }); it('testCopyInto', function() { - var supportsUint8Array = + const supportsUint8Array = !goog.userAgent.IE || goog.userAgent.isVersionOrHigher('10'); - var original = new proto.jspb.test.TestClone(); + const original = new proto.jspb.test.TestClone(); original.setStr('v1'); - var dest = new proto.jspb.test.TestClone(); + const dest = new proto.jspb.test.TestClone(); dest.setStr('override'); - var simple1 = new proto.jspb.test.Simple1(['x1', ['y1', 'z1']]); - var simple2 = new proto.jspb.test.Simple1(['x2', ['y2', 'z2']]); - var simple3 = new proto.jspb.test.Simple1(['x3', ['y3', 'z3']]); - var destSimple1 = new proto.jspb.test.Simple1(['ox1', ['oy1', 'oz1']]); - var destSimple2 = new proto.jspb.test.Simple1(['ox2', ['oy2', 'oz2']]); - var destSimple3 = new proto.jspb.test.Simple1(['ox3', ['oy3', 'oz3']]); + const simple1 = new proto.jspb.test.Simple1(['x1', ['y1', 'z1']]); + const simple2 = new proto.jspb.test.Simple1(['x2', ['y2', 'z2']]); + const simple3 = new proto.jspb.test.Simple1(['x3', ['y3', 'z3']]); + const destSimple1 = new proto.jspb.test.Simple1(['ox1', ['oy1', 'oz1']]); + const destSimple2 = new proto.jspb.test.Simple1(['ox2', ['oy2', 'oz2']]); + const destSimple3 = new proto.jspb.test.Simple1(['ox3', ['oy3', 'oz3']]); original.setSimple1(simple1); original.setSimple2List([simple2, simple3]); dest.setSimple1(destSimple1); dest.setSimple2List([destSimple2, destSimple3]); - var bytes1 = supportsUint8Array ? new Uint8Array([1, 2, 3]) : '123'; - var bytes2 = supportsUint8Array ? new Uint8Array([4, 5, 6]) : '456'; + const bytes1 = supportsUint8Array ? new Uint8Array([1, 2, 3]) : '123'; + const bytes2 = supportsUint8Array ? new Uint8Array([4, 5, 6]) : '456'; original.setBytesField(bytes1); dest.setBytesField(bytes2); - var extension = new proto.jspb.test.CloneExtension(); + const extension = new proto.jspb.test.CloneExtension(); extension.setExt('e1'); original.setExtension(proto.jspb.test.CloneExtension.extField, extension); jspb.Message.copyInto(original, dest); - assertArrayEquals(original.toArray(), dest.toArray()); - assertEquals('x1', dest.getSimple1().getAString()); - assertEquals( - 'e1', - dest.getExtension(proto.jspb.test.CloneExtension.extField).getExt()); + expect(dest.toArray()).toEqual(original.toArray()); + expect(dest.getSimple1().getAString()).toEqual('x1'); + expect(dest.getExtension(proto.jspb.test.CloneExtension.extField).getExt()) + .toEqual('e1'); + dest.getSimple1().setAString('new value'); - assertNotEquals( - dest.getSimple1().getAString(), original.getSimple1().getAString()); + expect(dest.getSimple1().getAString()) + .not.toEqual(original.getSimple1().getAString()); if (supportsUint8Array) { dest.getBytesField()[0] = 7; - assertObjectEquals(bytes1, original.getBytesField()); - assertObjectEquals(new Uint8Array([7, 2, 3]), dest.getBytesField()); + expect(original.getBytesField()).toEqual(bytes1); + + expect(dest.getBytesField()).toEqual(new Uint8Array([7, 2, 3])); } else { dest.setBytesField('789'); - assertObjectEquals(bytes1, original.getBytesField()); - assertObjectEquals('789', dest.getBytesField()); + expect(original.getBytesField()).toEqual(bytes1); + expect(dest.getBytesField()).toEqual('789'); } dest.getExtension(proto.jspb.test.CloneExtension.extField) .setExt('new value'); - assertNotEquals( - dest.getExtension(proto.jspb.test.CloneExtension.extField).getExt(), - original.getExtension(proto.jspb.test.CloneExtension.extField) - .getExt()); + expect( + original.getExtension(proto.jspb.test.CloneExtension.extField).getExt()) + .not.toEqual(dest.getExtension(proto.jspb.test.CloneExtension.extField) + .getExt()); }); it('testCopyInto_notSameType', function() { - var a = new proto.jspb.test.TestClone(); - var b = new proto.jspb.test.Simple1(['str', ['s1', 's2']]); + const a = new proto.jspb.test.TestClone(); + const b = new proto.jspb.test.Simple1(['str', ['s1', 's2']]); - var e = assertThrows(function() { - jspb.Message.copyInto(a, b); - }); - assertContains('should have the same type', e.message); + expect(() => {jspb.Message.copyInto(a, b)}) + .toThrowError( + jspb.asserts.JspbAssertionError, /should have the same type/); }); it('testExtensions', function() { - var extension1 = new proto.jspb.test.IsExtension(['ext1field']); - var extension2 = new proto.jspb.test.Simple1(['str', ['s1', 's2']]); - var extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); + const extension1 = new proto.jspb.test.IsExtension(['ext1field']); + const extension2 = new proto.jspb.test.Simple1(['str', ['s1', 's2']]); + const extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); extendable.setExtension(proto.jspb.test.IsExtension.extField, extension1); extendable.setExtension( proto.jspb.test.IndirectExtension.simple, extension2); extendable.setExtension(proto.jspb.test.IndirectExtension.str, 'xyzzy'); extendable.setExtension( proto.jspb.test.IndirectExtension.repeatedStrList, ['a', 'b']); - var s1 = new proto.jspb.test.Simple1(['foo', ['s1', 's2']]); - var s2 = new proto.jspb.test.Simple1(['bar', ['t1', 't2']]); + const s1 = new proto.jspb.test.Simple1(['foo', ['s1', 's2']]); + const s2 = new proto.jspb.test.Simple1(['bar', ['t1', 't2']]); extendable.setExtension( proto.jspb.test.IndirectExtension.repeatedSimpleList, [s1, s2]); - assertObjectEquals( - extension1, - extendable.getExtension(proto.jspb.test.IsExtension.extField)); - assertObjectEquals( - extension2, - extendable.getExtension(proto.jspb.test.IndirectExtension.simple)); - assertObjectEquals( - 'xyzzy', - extendable.getExtension(proto.jspb.test.IndirectExtension.str)); - assertObjectEquals( - ['a', 'b'], - extendable.getExtension( - proto.jspb.test.IndirectExtension.repeatedStrList)); - assertObjectEquals( - [s1, s2], - extendable.getExtension( - proto.jspb.test.IndirectExtension.repeatedSimpleList)); + expect(extendable.getExtension(proto.jspb.test.IsExtension.extField)) + .toEqual(extension1); + + expect(extendable.getExtension(proto.jspb.test.IndirectExtension.simple)) + .toEqual(extension2); + + expect(extendable.getExtension(proto.jspb.test.IndirectExtension.str)) + .toEqual('xyzzy'); + + expect(extendable.getExtension( + proto.jspb.test.IndirectExtension.repeatedStrList)) + .toEqual(['a', 'b']); + expect(extendable.getExtension( + proto.jspb.test.IndirectExtension.repeatedSimpleList)) + .toEqual([s1, s2]); // Not supported yet, but it should work... extendable.setExtension(proto.jspb.test.IndirectExtension.simple, null); - assertNull( - extendable.getExtension(proto.jspb.test.IndirectExtension.simple)); + expect(extendable.getExtension(proto.jspb.test.IndirectExtension.simple)) + .toBeNull(); extendable.setExtension(proto.jspb.test.IndirectExtension.str, null); - assertNull(extendable.getExtension(proto.jspb.test.IndirectExtension.str)); + expect(extendable.getExtension(proto.jspb.test.IndirectExtension.str)) + .toBeNull(); // Extension fields with jspb.ignore = true are ignored. - assertUndefined(proto.jspb.test.IndirectExtension['ignored']); - assertUndefined(proto.jspb.test.HasExtensions['ignoredFloating']); + expect(proto.jspb.test.IndirectExtension['ignored']).toBeUndefined(); + expect(proto.jspb.test.HasExtensions['ignoredFloating']).toBeUndefined(); }); it('testFloatingExtensions', function() { // From an autogenerated container. - var extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); - var extension = new proto.jspb.test.Simple1(['foo', ['s1', 's2']]); + let extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); + let extension = new proto.jspb.test.Simple1(['foo', ['s1', 's2']]); extendable.setExtension(proto.jspb.test.simple1, extension); - assertObjectEquals( - extension, extendable.getExtension(proto.jspb.test.simple1)); + expect(extendable.getExtension(proto.jspb.test.simple1)).toEqual(extension); // From _lib mode. extension = new proto.jspb.test.ExtensionMessage(['s1']); extendable = new proto.jspb.test.TestExtensionsMessage([16]); extendable.setExtension(proto.jspb.test.floatingMsgField, extension); extendable.setExtension(proto.jspb.test.floatingStrField, 's2'); - assertObjectEquals( - extension, extendable.getExtension(proto.jspb.test.floatingMsgField)); - assertObjectEquals( - 's2', extendable.getExtension(proto.jspb.test.floatingStrField)); - assertNotUndefined(proto.jspb.exttest.floatingMsgField); - assertNotUndefined(proto.jspb.exttest.floatingMsgFieldTwo); - assertNotUndefined(proto.jspb.exttest.beta.floatingStrField); + expect(extendable.getExtension(proto.jspb.test.floatingMsgField)) + .toEqual(extension); + expect(extendable.getExtension(proto.jspb.test.floatingStrField)) + .toEqual('s2'); + expect(proto.jspb.exttest.floatingMsgField).not.toBeUndefined(); + expect(proto.jspb.exttest.floatingMsgFieldTwo).not.toBeUndefined(); + expect(proto.jspb.exttest.beta.floatingStrField).not.toBeUndefined(); }); it('testNestedExtensions', function() { - var extendable = + const extendable = new proto.jspb.exttest.nested.TestNestedExtensionsMessage(); - var extension = + const extension = new proto.jspb.exttest.nested.TestOuterMessage.NestedExtensionMessage( ['s1']); extendable.setExtension( proto.jspb.exttest.nested.TestOuterMessage.innerExtension, extension); - assertObjectEquals( - extension, - extendable.getExtension( - proto.jspb.exttest.nested.TestOuterMessage.innerExtension)); + expect(extendable.getExtension( + proto.jspb.exttest.nested.TestOuterMessage.innerExtension)) + .toEqual(extension); }); it('testToObject_extendedObject', function() { - var extension1 = new proto.jspb.test.IsExtension(['ext1field']); - var extension2 = new proto.jspb.test.Simple1(['str', ['s1', 's2'], true]); - var extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); + const extension1 = new proto.jspb.test.IsExtension(['ext1field']); + const extension2 = new proto.jspb.test.Simple1(['str', ['s1', 's2'], true]); + const extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); extendable.setExtension(proto.jspb.test.IsExtension.extField, extension1); extendable.setExtension( proto.jspb.test.IndirectExtension.simple, extension2); extendable.setExtension(proto.jspb.test.IndirectExtension.str, 'xyzzy'); extendable.setExtension( proto.jspb.test.IndirectExtension.repeatedStrList, ['a', 'b']); - var s1 = new proto.jspb.test.Simple1(['foo', ['s1', 's2'], true]); - var s2 = new proto.jspb.test.Simple1(['bar', ['t1', 't2'], false]); + const s1 = new proto.jspb.test.Simple1(['foo', ['s1', 's2'], true]); + const s2 = new proto.jspb.test.Simple1(['bar', ['t1', 't2'], false]); extendable.setExtension( proto.jspb.test.IndirectExtension.repeatedSimpleList, [s1, s2]); - assertObjectEquals( - { - str1: 'v1', - str2: 'v2', - str3: 'v3', - extField: {ext1: 'ext1field'}, - simple: { - aString: 'str', - aRepeatedStringList: ['s1', 's2'], - aBoolean: true - }, - str: 'xyzzy', - repeatedStrList: ['a', 'b'], - repeatedSimpleList: [ - {aString: 'foo', aRepeatedStringList: ['s1', 's2'], aBoolean: true}, - {aString: 'bar', aRepeatedStringList: ['t1', 't2'], aBoolean: false} - ] - }, - extendable.toObject()); + expect(extendable.toObject()).toEqual({ + str1: 'v1', + str2: 'v2', + str3: 'v3', + extField: {ext1: 'ext1field'}, + simple: + {aString: 'str', aRepeatedStringList: ['s1', 's2'], aBoolean: true}, + str: 'xyzzy', + repeatedStrList: ['a', 'b'], + repeatedSimpleList: [ + {aString: 'foo', aRepeatedStringList: ['s1', 's2'], aBoolean: true}, + {aString: 'bar', aRepeatedStringList: ['t1', 't2'], aBoolean: false} + ] + }); // Now, with instances included. - assertObjectEquals( + expect(extendable.toObject(true /* opt_includeInstance */)).toEqual({ + str1: 'v1', + str2: 'v2', + str3: 'v3', + extField: { + ext1: 'ext1field', + $jspbMessageInstance: + extendable.getExtension(proto.jspb.test.IsExtension.extField) + }, + simple: { + aString: 'str', + aRepeatedStringList: ['s1', 's2'], + aBoolean: true, + $jspbMessageInstance: + extendable.getExtension(proto.jspb.test.IndirectExtension.simple) + }, + str: 'xyzzy', + repeatedStrList: ['a', 'b'], + repeatedSimpleList: [ { - str1: 'v1', - str2: 'v2', - str3: 'v3', - extField: { - ext1: 'ext1field', - $jspbMessageInstance: - extendable.getExtension(proto.jspb.test.IsExtension.extField) - }, - simple: { - aString: 'str', - aRepeatedStringList: ['s1', 's2'], - aBoolean: true, - $jspbMessageInstance: extendable.getExtension( - proto.jspb.test.IndirectExtension.simple) - }, - str: 'xyzzy', - repeatedStrList: ['a', 'b'], - repeatedSimpleList: [ - { - aString: 'foo', - aRepeatedStringList: ['s1', 's2'], - aBoolean: true, - $jspbMessageInstance: s1 - }, - { - aString: 'bar', - aRepeatedStringList: ['t1', 't2'], - aBoolean: false, - $jspbMessageInstance: s2 - } - ], - $jspbMessageInstance: extendable + aString: 'foo', + aRepeatedStringList: ['s1', 's2'], + aBoolean: true, + $jspbMessageInstance: s1 }, - extendable.toObject(true /* opt_includeInstance */)); + { + aString: 'bar', + aRepeatedStringList: ['t1', 't2'], + aBoolean: false, + $jspbMessageInstance: s2 + } + ], + $jspbMessageInstance: extendable + }); }); it('testInitialization_emptyArray', function() { - var msg = new proto.jspb.test.HasExtensions([]); - assertArrayEquals([], msg.toArray()); + const msg = new proto.jspb.test.HasExtensions([]); + expect(msg.toArray()).toEqual([]); }); it('testInitialization_justExtensionObject', function() { - var msg = new proto.jspb.test.Empty([{1: 'hi'}]); + const msg = new proto.jspb.test.Empty([{1: 'hi'}]); // The extensionObject is not moved from its original location. - assertArrayEquals([{1: 'hi'}], msg.toArray()); + expect(msg.toArray()).toEqual([{1: 'hi'}]) }); it('testInitialization_incompleteList', function() { - var msg = new proto.jspb.test.Empty([1, {4: 'hi'}]); + const msg = new proto.jspb.test.Empty([1, {4: 'hi'}]); // The extensionObject is not moved from its original location. - assertArrayEquals([1, {4: 'hi'}], msg.toArray()); + expect(msg.toArray()).toEqual([1, {4: 'hi'}]); }); it('testInitialization_forwardCompatible', function() { - var msg = new proto.jspb.test.Empty([1, 2, 3, {1: 'hi'}]); - assertArrayEquals([1, 2, 3, {1: 'hi'}], msg.toArray()); + const msg = new proto.jspb.test.Empty([1, 2, 3, {1: 'hi'}]); + + expect(msg.toArray()).toEqual([1, 2, 3, {1: 'hi'}]); }); it('testExtendedMessageEnsureObject', /** @suppress {visibility} */ function() { - var data = + const data = new proto.jspb.test.HasExtensions(['str1', {'a_key': 'an_object'}]); - assertEquals('an_object', jspb.Message.getField(data,['a_key'])); + + expect(jspb.Message.getField(data, ['a_key'])).toEqual('an_object'); }); it('testToObject_hasExtensionField', function() { - var data = + const data = new proto.jspb.test.HasExtensions(['str1', {100: ['ext1'], 102: ''}]); - var obj = data.toObject(); - assertEquals('str1', obj.str1); - assertEquals('ext1', obj.extField.ext1); - assertEquals('', obj.str); + const obj = data.toObject(); + expect(obj.str1).toEqual('str1'); + expect(obj.extField.ext1).toEqual('ext1'); + expect(obj.str).toEqual(''); }); it('testGetExtension', function() { - var data = new proto.jspb.test.HasExtensions(['str1', {100: ['ext1']}]); - assertEquals('str1', data.getStr1()); - var extension = data.getExtension(proto.jspb.test.IsExtension.extField); - assertNotNull(extension); - assertEquals('ext1', extension.getExt1()); + const data = new proto.jspb.test.HasExtensions(['str1', {100: ['ext1']}]); + expect(data.getStr1()).toEqual('str1'); + const extension = data.getExtension(proto.jspb.test.IsExtension.extField); + expect(extension).not.toBeNull(); + expect(extension.getExt1()).toEqual('ext1'); }); it('testSetExtension', function() { - var data = new proto.jspb.test.HasExtensions(); - var extensionMessage = new proto.jspb.test.IsExtension(['is_extension']); + const data = new proto.jspb.test.HasExtensions(); + const extensionMessage = new proto.jspb.test.IsExtension(['is_extension']); data.setExtension(proto.jspb.test.IsExtension.extField, extensionMessage); - var obj = data.toObject(); - assertNotNull(data.getExtension(proto.jspb.test.IsExtension.extField)); - assertEquals('is_extension', obj.extField.ext1); + const obj = data.toObject(); + expect(data.getExtension(proto.jspb.test.IsExtension.extField)) + .not.toBeNull(); + expect(obj.extField.ext1).toEqual('is_extension'); }); /** @@ -781,150 +775,123 @@ describe('Message test suite', function() { * a goal of being able to generate JS classes for all proto descriptors. */ it('testGroups', function() { - var group = new proto.jspb.test.TestGroup(); - var someGroup = new proto.jspb.test.TestGroup.RepeatedGroup(); + const group = new proto.jspb.test.TestGroup(); + const someGroup = new proto.jspb.test.TestGroup.RepeatedGroup(); someGroup.setId('g1'); someGroup.setSomeBoolList([true, false]); group.setRepeatedGroupList([someGroup]); - var groups = group.getRepeatedGroupList(); - assertEquals('g1', groups[0].getId()); - assertObjectEquals([true, false], groups[0].getSomeBoolList()); - assertObjectEquals( - {id: 'g1', someBoolList: [true, false]}, groups[0].toObject()); - assertObjectEquals( - { - repeatedGroupList: [{id: 'g1', someBoolList: [true, false]}], - requiredGroup: {id: undefined}, - optionalGroup: undefined, - requiredSimple: {aRepeatedStringList: [], aString: undefined}, - optionalSimple: undefined, - id: undefined - }, - group.toObject()); - var group1 = new proto.jspb.test.TestGroup1(); + const groups = group.getRepeatedGroupList(); + expect(groups[0].getId()).toEqual('g1'); + expect(groups[0].getSomeBoolList()).toEqual([true, false]); + expect(groups[0].toObject()) + .toEqual({id: 'g1', someBoolList: [true, false]}); + expect(group.toObject()).toEqual({ + repeatedGroupList: [{id: 'g1', someBoolList: [true, false]}], + requiredGroup: {id: undefined}, + optionalGroup: undefined, + requiredSimple: {aRepeatedStringList: [], aString: undefined}, + optionalSimple: undefined, + id: undefined + }); + const group1 = new proto.jspb.test.TestGroup1(); group1.setGroup(someGroup); - assertEquals(someGroup, group1.getGroup()); + expect(group1.getGroup()).toEqual(someGroup); }); it('testNonExtensionFieldsAfterExtensionRange', function() { - var data = [{'1': 'a_string'}]; - var message = new proto.jspb.test.Complex(data); - assertArrayEquals([], message.getARepeatedStringList()); + const data = [{'1': 'a_string'}]; + const message = new proto.jspb.test.Complex(data); + expect(message.getARepeatedStringList()).toEqual([]) }); it('testReservedGetterNames', function() { - var message = new proto.jspb.test.TestReservedNames(); + const message = new proto.jspb.test.TestReservedNames(); message.setExtension$(11); message.setExtension(proto.jspb.test.TestReservedNamesExtension.foo, 12); - assertEquals(11, message.getExtension$()); - assertEquals( - 12, - message.getExtension(proto.jspb.test.TestReservedNamesExtension.foo)); - assertObjectEquals({extension: 11, foo: 12}, message.toObject()); + expect(message.getExtension$()).toEqual(11); + expect(message.getExtension(proto.jspb.test.TestReservedNamesExtension.foo)) + .toEqual(12); + expect(message.toObject()).toEqual({extension: 11, foo: 12}); }); it('testInitializeMessageWithUnsetOneof', function() { - var message = new proto.jspb.test.TestMessageWithOneof([]); - assertEquals( - proto.jspb.test.TestMessageWithOneof.PartialOneofCase - .PARTIAL_ONEOF_NOT_SET, - message.getPartialOneofCase()); - assertEquals( - proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase - .RECURSIVE_ONEOF_NOT_SET, - message.getRecursiveOneofCase()); + const message = new proto.jspb.test.TestMessageWithOneof([]); + expect(message.getPartialOneofCase()) + .toEqual(proto.jspb.test.TestMessageWithOneof.PartialOneofCase + .PARTIAL_ONEOF_NOT_SET); + + expect(message.getRecursiveOneofCase()) + .toEqual(proto.jspb.test.TestMessageWithOneof.RecursiveOneofCase + .RECURSIVE_ONEOF_NOT_SET); }); it('testUnsetsOneofCaseWhenFieldIsCleared', function() { - var message = new proto.jspb.test.TestMessageWithOneof; - assertEquals( - proto.jspb.test.TestMessageWithOneof.PartialOneofCase - .PARTIAL_ONEOF_NOT_SET, - message.getPartialOneofCase()); + const message = new proto.jspb.test.TestMessageWithOneof; + expect(message.getPartialOneofCase()) + .toEqual(proto.jspb.test.TestMessageWithOneof.PartialOneofCase + .PARTIAL_ONEOF_NOT_SET); + message.setPone('hi'); - assertEquals( - proto.jspb.test.TestMessageWithOneof.PartialOneofCase.PONE, - message.getPartialOneofCase()); + expect(message.getPartialOneofCase()) + .toEqual(proto.jspb.test.TestMessageWithOneof.PartialOneofCase.PONE); message.clearPone(); - assertEquals( - proto.jspb.test.TestMessageWithOneof.PartialOneofCase - .PARTIAL_ONEOF_NOT_SET, - message.getPartialOneofCase()); + expect(message.getPartialOneofCase()) + .toEqual(proto.jspb.test.TestMessageWithOneof.PartialOneofCase + .PARTIAL_ONEOF_NOT_SET); }); it('testFloatingPointFieldsSupportNan', function() { - var assertNan = function(x) { - assertTrue( - 'Expected ' + x + ' (' + goog.typeOf(x) + ') to be NaN.', - typeof x === 'number' && isNaN(x)); - }; - - var message = new proto.jspb.test.FloatingPointFields([ + const message = new proto.jspb.test.FloatingPointFields([ 'NaN', 'NaN', ['NaN', 'NaN'], 'NaN', 'NaN', 'NaN', ['NaN', 'NaN'], 'NaN' ]); - assertNan(message.getOptionalFloatField()); - assertNan(message.getRequiredFloatField()); - assertNan(message.getRepeatedFloatFieldList()[0]); - assertNan(message.getRepeatedFloatFieldList()[1]); - assertNan(message.getDefaultFloatField()); - assertNan(message.getOptionalDoubleField()); - assertNan(message.getRequiredDoubleField()); - assertNan(message.getRepeatedDoubleFieldList()[0]); - assertNan(message.getRepeatedDoubleFieldList()[1]); - assertNan(message.getDefaultDoubleField()); + expect(message.getOptionalFloatField()).toBeNaN(); + expect(message.getRequiredFloatField()).toBeNaN(); + expect(message.getRepeatedFloatFieldList()[0]).toBeNaN(); + expect(message.getRepeatedFloatFieldList()[1]).toBeNaN(); + expect(message.getDefaultFloatField()).toBeNaN(); + expect(message.getOptionalDoubleField()).toBeNaN(); + expect(message.getRequiredDoubleField()).toBeNaN() + expect(message.getRepeatedDoubleFieldList()[0]).toBeNaN(); + expect(message.getRepeatedDoubleFieldList()[1]).toBeNaN(); + expect(message.getDefaultDoubleField()).toBeNaN(); }); it('testFloatingPointsAreConvertedFromStringInput', function() { - var assertInf = function(x) { - assertTrue( - 'Expected ' + x + ' (' + goog.typeOf(x) + ') to be Infinity.', - x === Infinity); - }; - var message = new proto.jspb.test.FloatingPointFields([ + const message = new proto.jspb.test.FloatingPointFields([ Infinity, 'Infinity', ['Infinity', Infinity], 'Infinity', 'Infinity', 'Infinity', ['Infinity', Infinity], 'Infinity' ]); - assertInf(message.getOptionalFloatField()); - assertInf(message.getRequiredFloatField()); - assertInf(message.getRepeatedFloatFieldList()[0]); - assertInf(message.getRepeatedFloatFieldList()[1]); - assertInf(message.getDefaultFloatField()); - assertInf(message.getOptionalDoubleField()); - assertInf(message.getRequiredDoubleField()); - assertInf(message.getRepeatedDoubleFieldList()[0]); - assertInf(message.getRepeatedDoubleFieldList()[1]); - assertInf(message.getDefaultDoubleField()); + expect(message.getOptionalFloatField()).toBePositiveInfinity(); + expect(message.getRequiredFloatField()).toBePositiveInfinity(); + expect(message.getRepeatedFloatFieldList()[0]).toBePositiveInfinity(); + expect(message.getRepeatedFloatFieldList()[1]).toBePositiveInfinity(); + expect(message.getDefaultFloatField()).toBePositiveInfinity(); + expect(message.getOptionalDoubleField()).toBePositiveInfinity(); + expect(message.getRequiredDoubleField()).toBePositiveInfinity(); + expect(message.getRepeatedDoubleFieldList()[0]).toBePositiveInfinity(); + expect(message.getRepeatedDoubleFieldList()[1]).toBePositiveInfinity(); + expect(message.getDefaultDoubleField()).toBePositiveInfinity(); }); it('testBooleansAreConvertedFromNumberInput', function() { - var assertBooleanFieldTrue = function(x) { - assertTrue( - 'Expected ' + x + ' (' + goog.typeOf(x) + ') to be True.', - x === true); - }; - var message = new proto.jspb.test.BooleanFields([1, 1, [true, 1]]); - assertBooleanFieldTrue(message.getOptionalBooleanField()); - assertBooleanFieldTrue(message.getRequiredBooleanField()); - assertBooleanFieldTrue(message.getRepeatedBooleanFieldList()[0]); - assertBooleanFieldTrue(message.getRepeatedBooleanFieldList()[1]); - assertBooleanFieldTrue(message.getDefaultBooleanField()); - - var assertBooleanFieldFalse = function(x) { - assertTrue( - 'Expected ' + x + ' (' + goog.typeOf(x) + ') to be False.', - x === false); - }; + let message = new proto.jspb.test.BooleanFields([1, 1, [true, 1]]); + expect(message.getOptionalBooleanField()).toBeTrue(); + expect(message.getRequiredBooleanField()).toBeTrue(); + expect(message.getRepeatedBooleanFieldList()[0]).toBeTrue(); + expect(message.getRepeatedBooleanFieldList()[1]).toBeTrue(); + expect(message.getDefaultBooleanField()).toBeTrue(); + message = new proto.jspb.test.BooleanFields([0, 0, [0, 0]]); - assertBooleanFieldFalse(message.getOptionalBooleanField()); - assertBooleanFieldFalse(message.getRequiredBooleanField()); - assertBooleanFieldFalse(message.getRepeatedBooleanFieldList()[0]); - assertBooleanFieldFalse(message.getRepeatedBooleanFieldList()[1]); + expect(message.getOptionalBooleanField()).toBeFalse(); + expect(message.getRequiredBooleanField()).toBeFalse(); + expect(message.getRepeatedBooleanFieldList()[0]).toBeFalse(); + expect(message.getRepeatedBooleanFieldList()[1]).toBeFalse(); }); it('testExtensionReverseOrder', function() { - var message2 = + const message2 = new proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage2; message2.setExtension( @@ -935,23 +902,21 @@ describe('Message test suite', function() { 2333); message2.setExtension(proto.jspb.exttest.reverse.c, 23333); - assertEquals( - 233, - message2.getExtension( - proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage1.a)); - assertEquals( - 2333, - message2.getExtension( - proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage1 - .TestExtensionReverseOrderNestedMessage1.b)); - assertEquals(23333, message2.getExtension(proto.jspb.exttest.reverse.c)); + expect(message2.getExtension( + proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage1.a)) + .toEqual(233); + expect(message2.getExtension( + proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage1 + .TestExtensionReverseOrderNestedMessage1.b)) + .toEqual(2333); + expect(message2.getExtension(proto.jspb.exttest.reverse.c)).toEqual(23333); }); it('testCircularDepsBaseOnMessageField', function() { - var nestMessage1 = new proto.jspb.circulartest.MessageField1; - var nestMessage2 = new proto.jspb.circulartest.MessageField2; - var message1 = new proto.jspb.circulartest.MessageField1; - var message2 = new proto.jspb.circulartest.MessageField2; + const nestMessage1 = new proto.jspb.circulartest.MessageField1; + const nestMessage2 = new proto.jspb.circulartest.MessageField2; + const message1 = new proto.jspb.circulartest.MessageField1; + const message2 = new proto.jspb.circulartest.MessageField2; nestMessage1.setA(1); nestMessage2.setA(2); @@ -959,16 +924,16 @@ describe('Message test suite', function() { message2.setB(nestMessage1); - assertEquals(2, message1.getB().getA()); - assertEquals(1, message2.getB().getA()); + expect(message1.getB().getA()).toEqual(2); + expect(message2.getB().getA()).toEqual(1); }); it('testCircularDepsBaseOnRepeatedMessageField', function() { - var nestMessage1 = new proto.jspb.circulartest.RepeatedMessageField1; - var nestMessage2 = new proto.jspb.circulartest.RepeatedMessageField2; - var message1 = new proto.jspb.circulartest.RepeatedMessageField1; - var message2 = new proto.jspb.circulartest.RepeatedMessageField2; + const nestMessage1 = new proto.jspb.circulartest.RepeatedMessageField1; + const nestMessage2 = new proto.jspb.circulartest.RepeatedMessageField2; + const message1 = new proto.jspb.circulartest.RepeatedMessageField1; + const message2 = new proto.jspb.circulartest.RepeatedMessageField2; nestMessage1.setA(1); nestMessage2.setA(2); @@ -976,15 +941,15 @@ describe('Message test suite', function() { message2.addB(nestMessage1); - assertEquals(2, message1.getB().getA()); - assertEquals(1, message2.getBList()[0].getA()); + expect(message1.getB().getA()).toEqual(2); + expect(message2.getBList()[0].getA()).toEqual(1); }); it('testCircularDepsBaseOnMapField', function() { - var nestMessage1 = new proto.jspb.circulartest.MapField1; - var nestMessage2 = new proto.jspb.circulartest.MapField2; - var message1 = new proto.jspb.circulartest.MapField1; - var message2 = new proto.jspb.circulartest.MapField2; + const nestMessage1 = new proto.jspb.circulartest.MapField1; + const nestMessage2 = new proto.jspb.circulartest.MapField2; + const message1 = new proto.jspb.circulartest.MapField1; + const message2 = new proto.jspb.circulartest.MapField2; nestMessage1.setA(1); nestMessage2.setA(2); @@ -992,16 +957,16 @@ describe('Message test suite', function() { message2.getBMap().set(1, nestMessage1); - assertEquals(2, message1.getB().getA()); - assertEquals(1, message2.getBMap().get(1).getA()); + expect(message1.getB().getA()).toEqual(2); + expect(message2.getBMap().get(1).getA()).toEqual(1); }); it('testCircularDepsBaseOnNestedMessage', function() { - var nestMessage1 = + const nestMessage1 = new proto.jspb.circulartest.NestedMessage1.NestedNestedMessage; - var nestMessage2 = new proto.jspb.circulartest.NestedMessage2; - var message1 = new proto.jspb.circulartest.NestedMessage1; - var message2 = new proto.jspb.circulartest.NestedMessage2; + const nestMessage2 = new proto.jspb.circulartest.NestedMessage2; + const message1 = new proto.jspb.circulartest.NestedMessage1; + const message2 = new proto.jspb.circulartest.NestedMessage2; nestMessage1.setA(1); nestMessage2.setA(2); @@ -1009,29 +974,28 @@ describe('Message test suite', function() { message2.setB(nestMessage1); - assertEquals(2, message1.getB().getA()); - assertEquals(1, message2.getB().getA()); + expect(message1.getB().getA()).toEqual(2); + expect(message2.getB().getA()).toEqual(1); }); it('testCircularDepsBaseOnNestedEnum', function() { - var nestMessage2 = new proto.jspb.circulartest.NestedEnum2; - var message1 = new proto.jspb.circulartest.NestedEnum1; - var message2 = new proto.jspb.circulartest.NestedEnum2; + const nestMessage2 = new proto.jspb.circulartest.NestedEnum2; + const message1 = new proto.jspb.circulartest.NestedEnum1; + const message2 = new proto.jspb.circulartest.NestedEnum2; nestMessage2.setA(2); message1.setB(nestMessage2); message2.setB(proto.jspb.circulartest.NestedEnum1.NestedNestedEnum.VALUE_1); - assertEquals(2, message1.getB().getA()); - assertEquals( - proto.jspb.circulartest.NestedEnum1.NestedNestedEnum.VALUE_1, - message2.getB()); + expect(message1.getB().getA()).toEqual(2); + expect(message2.getB()) + .toEqual(proto.jspb.circulartest.NestedEnum1.NestedNestedEnum.VALUE_1); }); it('testCircularDepsBaseOnExtensionContainingType', function() { - var nestMessage2 = new proto.jspb.circulartest.ExtensionContainingType2; - var message1 = new proto.jspb.circulartest.ExtensionContainingType1; + const nestMessage2 = new proto.jspb.circulartest.ExtensionContainingType2; + const message1 = new proto.jspb.circulartest.ExtensionContainingType1; nestMessage2.setA(2); message1.setB(nestMessage2); @@ -1039,74 +1003,72 @@ describe('Message test suite', function() { proto.jspb.circulartest.ExtensionContainingType2.c, 1); - assertEquals(2, message1.getB().getA()); - assertEquals( - 1, - message1.getExtension( - proto.jspb.circulartest.ExtensionContainingType2.c)); + expect(message1.getB().getA()).toEqual(2); + expect(message1.getExtension( + proto.jspb.circulartest.ExtensionContainingType2.c)) + .toEqual(1); }); it('testCircularDepsBaseOnExtensionField', function() { - var nestMessage2 = new proto.jspb.circulartest.ExtensionField2; - var message1 = new proto.jspb.circulartest.ExtensionField1; - var message3 = new proto.jspb.circulartest.ExtensionField3; + const nestMessage2 = new proto.jspb.circulartest.ExtensionField2; + const message1 = new proto.jspb.circulartest.ExtensionField1; + const message3 = new proto.jspb.circulartest.ExtensionField3; nestMessage2.setA(2); message1.setB(nestMessage2); message3.setExtension(proto.jspb.circulartest.ExtensionField2.c, message1); - assertEquals( - 2, - message3.getExtension(proto.jspb.circulartest.ExtensionField2.c) - .getB() - .getA()); + expect(message3.getExtension(proto.jspb.circulartest.ExtensionField2.c) + .getB() + .getA()) + .toEqual(2); }); it('testSameMessageNameOuputs', function() { - var package1Message = new proto.jspb.filenametest.package1.TestMessage; - var package2Message = new proto.jspb.filenametest.package2.TestMessage; + const package1Message = new proto.jspb.filenametest.package1.TestMessage; + const package2Message = new proto.jspb.filenametest.package2.TestMessage; package1Message.setExtension(proto.jspb.filenametest.package1.a, 10); package1Message.setExtension(proto.jspb.filenametest.package1.b, 11); package2Message.setA(12); - assertEquals( - 10, package1Message.getExtension(proto.jspb.filenametest.package1.a)); - assertEquals( - 11, package1Message.getExtension(proto.jspb.filenametest.package1.b)); - assertEquals(12, package2Message.getA()); + expect(package1Message.getExtension(proto.jspb.filenametest.package1.a)) + .toEqual(10); + expect(package1Message.getExtension(proto.jspb.filenametest.package1.b)) + .toEqual(11); + expect(package2Message.getA()).toEqual(12); }); it('testMessageWithLargeFieldNumbers', function() { - var message = new proto.jspb.test.MessageWithLargeFieldNumbers; + const message = new proto.jspb.test.MessageWithLargeFieldNumbers; message.setAString('string'); - assertEquals('string', message.getAString()); + expect(message.getAString()).toEqual('string'); message.setAString(''); - assertEquals('', message.getAString()); + expect(message.getAString()).toEqual(''); message.setAString('new string'); - assertEquals('new string', message.getAString()); + expect(message.getAString()).toEqual('new string'); message.setABoolean(true); - assertEquals(true, message.getABoolean()); + expect(message.getABoolean()).toBeTrue(); message.setABoolean(false); - assertEquals(false, message.getABoolean()); + expect(message.getABoolean()).toBeFalse(); message.setABoolean(true); - assertEquals(true, message.getABoolean()); + expect(message.getABoolean()).toBeTrue(); message.setAInt(42); - assertEquals(42, message.getAInt()); + expect(message.getAInt()).toEqual(42); message.setAInt(0); - assertEquals(0, message.getAInt()); + expect(message.getAInt()).toEqual(0); message.setAInt(42); - assertEquals(42, message.getAInt()); + expect(message.getAInt()).toEqual(42); }); }); diff --git a/package-lock.json b/package-lock.json index 84cf8da..58fa470 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "google-closure-deps": "^20210406.0.0", "google-closure-library": "~20200315.0.0", "gulp": "~4.0.2", - "jasmine": "~3.4.0" + "jasmine": "~3.5.0" } }, "node_modules/ansi-colors": { @@ -2182,22 +2182,22 @@ } }, "node_modules/jasmine": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.4.0.tgz", - "integrity": "sha512-sR9b4n+fnBFDEd7VS2el2DeHgKcPiMVn44rtKFumq9q7P/t8WrxsVIZPob4UDdgcDNCwyDqwxCt4k9TDRmjPoQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz", + "integrity": "sha512-DYypSryORqzsGoMazemIHUfMkXM7I7easFaxAvNM3Mr6Xz3Fy36TupTrAOxZWN8MVKEU5xECv22J4tUQf3uBzQ==", "dev": true, "dependencies": { - "glob": "^7.1.3", - "jasmine-core": "~3.4.0" + "glob": "^7.1.4", + "jasmine-core": "~3.5.0" }, "bin": { "jasmine": "bin/jasmine.js" } }, "node_modules/jasmine-core": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.4.0.tgz", - "integrity": "sha512-HU/YxV4i6GcmiH4duATwAbJQMlE0MsDIR5XmSVxURxKHn3aGAdbY1/ZJFmVRbKtnLwIxxMJD7gYaPsypcbYimg==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.5.0.tgz", + "integrity": "sha512-nCeAiw37MIMA9w9IXso7bRaLl+c/ef3wnxsoSAlYrzS+Ot0zTG6nU8G/cIfGkqpkjX2wNaIW9RFG0TwIFnG6bA==", "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { @@ -6136,19 +6136,19 @@ "dev": true }, "jasmine": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.4.0.tgz", - "integrity": "sha512-sR9b4n+fnBFDEd7VS2el2DeHgKcPiMVn44rtKFumq9q7P/t8WrxsVIZPob4UDdgcDNCwyDqwxCt4k9TDRmjPoQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz", + "integrity": "sha512-DYypSryORqzsGoMazemIHUfMkXM7I7easFaxAvNM3Mr6Xz3Fy36TupTrAOxZWN8MVKEU5xECv22J4tUQf3uBzQ==", "dev": true, "requires": { - "glob": "^7.1.3", - "jasmine-core": "~3.4.0" + "glob": "^7.1.4", + "jasmine-core": "~3.5.0" } }, "jasmine-core": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.4.0.tgz", - "integrity": "sha512-HU/YxV4i6GcmiH4duATwAbJQMlE0MsDIR5XmSVxURxKHn3aGAdbY1/ZJFmVRbKtnLwIxxMJD7gYaPsypcbYimg==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.5.0.tgz", + "integrity": "sha512-nCeAiw37MIMA9w9IXso7bRaLl+c/ef3wnxsoSAlYrzS+Ot0zTG6nU8G/cIfGkqpkjX2wNaIW9RFG0TwIFnG6bA==", "dev": true }, "json-stable-stringify-without-jsonify": { diff --git a/package.json b/package.json index cf2b8b6..ccd4899 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "google-closure-deps": "^20210406.0.0", "google-closure-library": "~20200315.0.0", "gulp": "~4.0.2", - "jasmine": "~3.4.0" + "jasmine": "~3.5.0" }, "scripts": { "build": "node ./node_modules/gulp/bin/gulp.js dist", diff --git a/proto3_test.js b/proto3_test.js index 79b3205..575df65 100644 --- a/proto3_test.js +++ b/proto3_test.js @@ -29,7 +29,6 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. goog.require('goog.crypt.base64'); -goog.require('goog.testing.asserts'); // CommonJS-LoadFromFile: protos/testbinary_pb proto.jspb.test goog.require('proto.jspb.test.ForeignMessage'); // CommonJS-LoadFromFile: protos/proto3_test_pb proto.jspb.test @@ -43,9 +42,9 @@ goog.require('proto.google.protobuf.Timestamp'); goog.require('proto.google.protobuf.Struct'); goog.require('jspb.Message'); -var BYTES = new Uint8Array([1, 2, 8, 9]); -var BYTES_B64 = goog.crypt.base64.encodeByteArray(BYTES); +const BYTES = new Uint8Array([1, 2, 8, 9]); +const BYTES_B64 = goog.crypt.base64.encodeByteArray(BYTES); /** * Helper: compare a bytes field to an expected value @@ -60,7 +59,7 @@ function bytesCompare(arr, expected) { if (arr.length != expected.length) { return false; } - for (var i = 0; i < arr.length; i++) { + for (let i = 0; i < arr.length; i++) { if (arr[i] != expected[i]) { return false; } @@ -74,11 +73,11 @@ describe('proto3Test', function() { * Test default values don't affect equality test. */ it('testEqualsProto3', function() { - var msg1 = new proto.jspb.test.TestProto3(); - var msg2 = new proto.jspb.test.TestProto3(); + const msg1 = new proto.jspb.test.TestProto3(); + const msg2 = new proto.jspb.test.TestProto3(); msg2.setSingularString(''); - assertTrue(jspb.Message.equals(msg1, msg2)); + expect(jspb.Message.equals(msg1, msg2)).toBeTrue(); }); @@ -86,145 +85,144 @@ describe('proto3Test', function() { * Test setting when a field has default semantics. */ it('testSetProto3ToValueAndBackToDefault', function() { - var msg = new proto.jspb.test.TestProto3(); + const msg = new proto.jspb.test.TestProto3(); // Setting should work normally. msg.setSingularString('optionalString'); - assertEquals(msg.getSingularString(), 'optionalString'); + expect(msg.getSingularString()).toEqual('optionalString'); // Clearing should work too ... msg.setSingularString(''); - assertEquals(msg.getSingularString(), ''); + expect(msg.getSingularString()).toEqual(''); // ... and shouldn't affect the equality with a brand new message. - assertTrue(jspb.Message.equals(msg, new proto.jspb.test.TestProto3())); + expect(jspb.Message.equals(msg, new proto.jspb.test.TestProto3())) + .toBeTrue(); }); /** * Test defaults for proto3 message fields. */ it('testProto3FieldDefaults', function() { - var msg = new proto.jspb.test.TestProto3(); - - assertEquals(msg.getSingularInt32(), 0); - assertEquals(msg.getSingularInt64(), 0); - assertEquals(msg.getSingularUint32(), 0); - assertEquals(msg.getSingularUint64(), 0); - assertEquals(msg.getSingularSint32(), 0); - assertEquals(msg.getSingularSint64(), 0); - assertEquals(msg.getSingularFixed32(), 0); - assertEquals(msg.getSingularFixed64(), 0); - assertEquals(msg.getSingularSfixed32(), 0); - assertEquals(msg.getSingularSfixed64(), 0); - assertEquals(msg.getSingularFloat(), 0); - assertEquals(msg.getSingularDouble(), 0); - assertEquals(msg.getSingularString(), ''); + const msg = new proto.jspb.test.TestProto3(); + + expect(msg.getSingularInt32()).toEqual(0); + expect(msg.getSingularInt64()).toEqual(0); + expect(msg.getSingularUint32()).toEqual(0); + expect(msg.getSingularUint64()).toEqual(0); + expect(msg.getSingularSint32()).toEqual(0); + expect(msg.getSingularSint64()).toEqual(0); + expect(msg.getSingularFixed32()).toEqual(0); + expect(msg.getSingularFixed64()).toEqual(0); + expect(msg.getSingularSfixed32()).toEqual(0); + expect(msg.getSingularSfixed64()).toEqual(0); + expect(msg.getSingularFloat()).toEqual(0); + expect(msg.getSingularDouble()).toEqual(0); + expect(msg.getSingularString()).toEqual(''); // TODO(b/26173701): when we change bytes fields default getter to return - // Uint8Array, we'll want to switch this assertion to match the u8 case. - assertEquals(typeof msg.getSingularBytes(), 'string'); - assertEquals(msg.getSingularBytes_asU8() instanceof Uint8Array, true); - assertEquals(typeof msg.getSingularBytes_asB64(), 'string'); - assertEquals(msg.getSingularBytes().length, 0); - assertEquals(msg.getSingularBytes_asU8().length, 0); - assertEquals(msg.getSingularBytes_asB64(), ''); - - assertEquals( - msg.getSingularForeignEnum(), proto.jspb.test.Proto3Enum.PROTO3_FOO); - assertEquals(msg.getSingularForeignMessage(), undefined); - assertEquals(msg.getSingularForeignMessage(), undefined); - - assertEquals(msg.getRepeatedInt32List().length, 0); - assertEquals(msg.getRepeatedInt64List().length, 0); - assertEquals(msg.getRepeatedUint32List().length, 0); - assertEquals(msg.getRepeatedUint64List().length, 0); - assertEquals(msg.getRepeatedSint32List().length, 0); - assertEquals(msg.getRepeatedSint64List().length, 0); - assertEquals(msg.getRepeatedFixed32List().length, 0); - assertEquals(msg.getRepeatedFixed64List().length, 0); - assertEquals(msg.getRepeatedSfixed32List().length, 0); - assertEquals(msg.getRepeatedSfixed64List().length, 0); - assertEquals(msg.getRepeatedFloatList().length, 0); - assertEquals(msg.getRepeatedDoubleList().length, 0); - assertEquals(msg.getRepeatedStringList().length, 0); - assertEquals(msg.getRepeatedBytesList().length, 0); - assertEquals(msg.getRepeatedForeignEnumList().length, 0); - assertEquals(msg.getRepeatedForeignMessageList().length, 0); + expect(typeof msg.getSingularBytes()).toEqual('string'); + expect(msg.getSingularBytes_asU8() instanceof Uint8Array).toBeTrue(); + expect(typeof msg.getSingularBytes_asB64()).toEqual('string'); + expect(msg.getSingularBytes().length).toEqual(0); + expect(msg.getSingularBytes_asU8().length).toEqual(0); + expect(msg.getSingularBytes_asB64()).toEqual(''); + + expect(msg.getSingularForeignEnum()) + .toEqual(proto.jspb.test.Proto3Enum.PROTO3_FOO); + expect(msg.getSingularForeignMessage()).toBeUndefined(); + expect(msg.getSingularForeignMessage()).toBeUndefined(); + + expect(msg.getRepeatedInt32List().length).toEqual(0); + expect(msg.getRepeatedInt64List().length).toEqual(0); + expect(msg.getRepeatedUint32List().length).toEqual(0); + expect(msg.getRepeatedUint64List().length).toEqual(0); + expect(msg.getRepeatedSint32List().length).toEqual(0); + expect(msg.getRepeatedSint64List().length).toEqual(0); + expect(msg.getRepeatedFixed32List().length).toEqual(0); + expect(msg.getRepeatedFixed64List().length).toEqual(0); + expect(msg.getRepeatedSfixed32List().length).toEqual(0); + expect(msg.getRepeatedSfixed64List().length).toEqual(0); + expect(msg.getRepeatedFloatList().length).toEqual(0); + expect(msg.getRepeatedDoubleList().length).toEqual(0); + expect(msg.getRepeatedStringList().length).toEqual(0); + expect(msg.getRepeatedBytesList().length).toEqual(0); + expect(msg.getRepeatedForeignEnumList().length).toEqual(0); + expect(msg.getRepeatedForeignMessageList().length).toEqual(0); }); /** * Test presence for proto3 optional fields. */ it('testProto3Optional', function() { - var msg = new proto.jspb.test.TestProto3(); - - assertEquals(msg.getOptionalInt32(), 0); - assertEquals(msg.getOptionalInt64(), 0); - assertEquals(msg.getOptionalUint32(), 0); - assertEquals(msg.getOptionalUint64(), 0); - assertEquals(msg.getOptionalSint32(), 0); - assertEquals(msg.getOptionalSint64(), 0); - assertEquals(msg.getOptionalFixed32(), 0); - assertEquals(msg.getOptionalFixed64(), 0); - assertEquals(msg.getOptionalSfixed32(), 0); - assertEquals(msg.getOptionalSfixed64(), 0); - assertEquals(msg.getOptionalFloat(), 0); - assertEquals(msg.getOptionalDouble(), 0); - assertEquals(msg.getOptionalString(), ''); + const msg = new proto.jspb.test.TestProto3(); + + expect(msg.getOptionalInt32()).toEqual(0); + expect(msg.getOptionalInt64()).toEqual(0); + expect(msg.getOptionalUint32()).toEqual(0); + expect(msg.getOptionalUint64()).toEqual(0); + expect(msg.getOptionalSint32()).toEqual(0); + expect(msg.getOptionalSint64()).toEqual(0); + expect(msg.getOptionalFixed32()).toEqual(0); + expect(msg.getOptionalFixed64()).toEqual(0); + expect(msg.getOptionalSfixed32()).toEqual(0); + expect(msg.getOptionalSfixed64()).toEqual(0); + expect(msg.getOptionalFloat()).toEqual(0); + expect(msg.getOptionalDouble()).toEqual(0); + expect(msg.getOptionalString()).toEqual(''); // TODO(b/26173701): when we change bytes fields default getter to return - // Uint8Array, we'll want to switch this assertion to match the u8 case. - assertEquals(typeof msg.getOptionalBytes(), 'string'); - assertEquals(msg.getOptionalBytes_asU8() instanceof Uint8Array, true); - assertEquals(typeof msg.getOptionalBytes_asB64(), 'string'); - assertEquals(msg.getOptionalBytes().length, 0); - assertEquals(msg.getOptionalBytes_asU8().length, 0); - assertEquals(msg.getOptionalBytes_asB64(), ''); - - assertEquals( - msg.getOptionalForeignEnum(), proto.jspb.test.Proto3Enum.PROTO3_FOO); - assertEquals(msg.getOptionalForeignMessage(), undefined); - assertEquals(msg.getOptionalForeignMessage(), undefined); + expect(typeof msg.getOptionalBytes()).toEqual('string'); + expect(msg.getOptionalBytes_asU8() instanceof Uint8Array).toBeTrue(); + expect(typeof msg.getOptionalBytes_asB64()).toEqual('string'); + expect(msg.getOptionalBytes().length).toEqual(0); + expect(msg.getOptionalBytes_asU8().length).toEqual(0); + expect(msg.getOptionalBytes_asB64()).toEqual(''); + + expect(msg.getOptionalForeignEnum()) + .toEqual(proto.jspb.test.Proto3Enum.PROTO3_FOO); + expect(msg.getOptionalForeignMessage()).toBeUndefined(); + expect(msg.getOptionalForeignMessage()).toBeUndefined(); // Serializing an empty proto yields the empty string. - assertEquals(msg.serializeBinary().length, 0); + expect(msg.serializeBinary().length).toEqual(0); // Values start as unset, but can be explicitly set even to default values // like 0. - assertFalse(msg.hasOptionalInt32()); + expect(msg.hasOptionalInt32()).toBeFalse(); msg.setOptionalInt32(0); - assertTrue(msg.hasOptionalInt32()); + expect(msg.hasOptionalInt32()).toBeTrue(); - assertFalse(msg.hasOptionalInt64()); + expect(msg.hasOptionalInt64()).toBeFalse(); msg.setOptionalInt64(0); - assertTrue(msg.hasOptionalInt64()); + expect(msg.hasOptionalInt64()).toBeTrue(); - assertFalse(msg.hasOptionalString()); + expect(msg.hasOptionalString()).toBeFalse(); msg.setOptionalString(''); - assertTrue(msg.hasOptionalString()); + expect(msg.hasOptionalString()).toBeTrue(); // Now the proto will have a non-zero size, even though its values are 0. - var serialized = msg.serializeBinary(); - assertNotEquals(serialized.length, 0); + const serialized = msg.serializeBinary(); + expect(serialized.length).not.toEqual(0); - var msg2 = proto.jspb.test.TestProto3.deserializeBinary(serialized); - assertTrue(msg2.hasOptionalInt32()); - assertTrue(msg2.hasOptionalInt64()); - assertTrue(msg2.hasOptionalString()); + const msg2 = proto.jspb.test.TestProto3.deserializeBinary(serialized); + expect(msg2.hasOptionalInt32()).toBeTrue(); + expect(msg2.hasOptionalInt64()).toBeTrue(); + expect(msg2.hasOptionalString()).toBeTrue(); // We can clear fields to go back to empty. msg2.clearOptionalInt32(); - assertFalse(msg2.hasOptionalInt32()); + expect(msg2.hasOptionalInt32()).toBeFalse(); msg2.clearOptionalString(); - assertFalse(msg2.hasOptionalString()); + expect(msg2.hasOptionalString()).toBeFalse(); }); /** * Test that all fields can be set ,and read via a serialization roundtrip. */ it('testProto3FieldSetGet', function() { - var msg = new proto.jspb.test.TestProto3(); + let msg = new proto.jspb.test.TestProto3(); msg.setSingularInt32(-42); msg.setSingularInt64(-0x7fffffff00000000); @@ -241,7 +239,7 @@ describe('proto3Test', function() { msg.setSingularBool(true); msg.setSingularString('hello world'); msg.setSingularBytes(BYTES); - var submsg = new proto.jspb.test.ForeignMessage(); + let submsg = new proto.jspb.test.ForeignMessage(); submsg.setC(16); msg.setSingularForeignMessage(submsg); msg.setSingularForeignEnum(proto.jspb.test.Proto3Enum.PROTO3_BAR); @@ -268,51 +266,51 @@ describe('proto3Test', function() { msg.setOneofString('asdf'); - var serialized = msg.serializeBinary(); + const serialized = msg.serializeBinary(); msg = proto.jspb.test.TestProto3.deserializeBinary(serialized); - assertEquals(msg.getSingularInt32(), -42); - assertEquals(msg.getSingularInt64(), -0x7fffffff00000000); - assertEquals(msg.getSingularUint32(), 0x80000000); - assertEquals(msg.getSingularUint64(), 0xf000000000000000); - assertEquals(msg.getSingularSint32(), -100); - assertEquals(msg.getSingularSint64(), -0x8000000000000000); - assertEquals(msg.getSingularFixed32(), 1234); - assertEquals(msg.getSingularFixed64(), 0x1234567800000000); - assertEquals(msg.getSingularSfixed32(), -1234); - assertEquals(msg.getSingularSfixed64(), -0x1234567800000000); - assertEquals(msg.getSingularFloat(), 1.5); - assertEquals(msg.getSingularDouble(), -1.5); - assertEquals(msg.getSingularBool(), true); - assertEquals(msg.getSingularString(), 'hello world'); - assertEquals(true, bytesCompare(msg.getSingularBytes(), BYTES)); - assertEquals(msg.getSingularForeignMessage().getC(), 16); - assertEquals( - msg.getSingularForeignEnum(), proto.jspb.test.Proto3Enum.PROTO3_BAR); - - assertElementsEquals(msg.getRepeatedInt32List(), [-42]); - assertElementsEquals(msg.getRepeatedInt64List(), [-0x7fffffff00000000]); - assertElementsEquals(msg.getRepeatedUint32List(), [0x80000000]); - assertElementsEquals(msg.getRepeatedUint64List(), [0xf000000000000000]); - assertElementsEquals(msg.getRepeatedSint32List(), [-100]); - assertElementsEquals(msg.getRepeatedSint64List(), [-0x8000000000000000]); - assertElementsEquals(msg.getRepeatedFixed32List(), [1234]); - assertElementsEquals(msg.getRepeatedFixed64List(), [0x1234567800000000]); - assertElementsEquals(msg.getRepeatedSfixed32List(), [-1234]); - assertElementsEquals(msg.getRepeatedSfixed64List(), [-0x1234567800000000]); - assertElementsEquals(msg.getRepeatedFloatList(), [1.5]); - assertElementsEquals(msg.getRepeatedDoubleList(), [-1.5]); - assertElementsEquals(msg.getRepeatedBoolList(), [true]); - assertElementsEquals(msg.getRepeatedStringList(), ['hello world']); - assertEquals(msg.getRepeatedBytesList().length, 1); - assertEquals(true, bytesCompare(msg.getRepeatedBytesList()[0], BYTES)); - assertEquals(msg.getRepeatedForeignMessageList().length, 1); - assertEquals(msg.getRepeatedForeignMessageList()[0].getC(), 1000); - assertElementsEquals( - msg.getRepeatedForeignEnumList(), - [proto.jspb.test.Proto3Enum.PROTO3_BAR]); - - assertEquals(msg.getOneofString(), 'asdf'); + expect(msg.getSingularInt32()).toEqual(-42); + expect(msg.getSingularInt64()).toEqual(-0x7fffffff00000000); + expect(msg.getSingularUint32()).toEqual(0x80000000); + expect(msg.getSingularUint64()).toEqual(0xf000000000000000); + expect(msg.getSingularSint32()).toEqual(-100); + expect(msg.getSingularSint64()).toEqual(-0x8000000000000000); + expect(msg.getSingularFixed32()).toEqual(1234); + expect(msg.getSingularFixed64()).toEqual(0x1234567800000000); + expect(msg.getSingularSfixed32()).toEqual(-1234); + expect(msg.getSingularSfixed64()).toEqual(-0x1234567800000000); + expect(msg.getSingularFloat()).toEqual(1.5); + expect(msg.getSingularDouble()).toEqual(-1.5); + expect(msg.getSingularBool()).toBeTrue(); + expect(msg.getSingularString()).toEqual('hello world'); + expect(bytesCompare(msg.getSingularBytes(), BYTES)).toEqual(true); + expect(msg.getSingularForeignMessage().getC()).toEqual(16); + expect(msg.getSingularForeignEnum()) + .toEqual(proto.jspb.test.Proto3Enum.PROTO3_BAR); + + expect(msg.getRepeatedInt32List()).toEqual([-42]); + expect(msg.getRepeatedInt64List()).toEqual([-0x7fffffff00000000]); + expect(msg.getRepeatedUint32List()).toEqual([0x80000000]); + expect(msg.getRepeatedUint64List()).toEqual([0xf000000000000000]); + expect(msg.getRepeatedSint32List()).toEqual([-100]); + expect(msg.getRepeatedSint64List()).toEqual([-0x8000000000000000]); + expect(msg.getRepeatedFixed32List()).toEqual([1234]); + expect(msg.getRepeatedFixed64List()).toEqual([0x1234567800000000]); + expect(msg.getRepeatedSfixed32List()).toEqual([-1234]); + expect(msg.getRepeatedSfixed64List()).toEqual([-0x1234567800000000]); + expect(msg.getRepeatedFloatList()).toEqual([1.5]); + expect(msg.getRepeatedDoubleList()).toEqual([-1.5]); + expect(msg.getRepeatedBoolList()).toEqual([true]); + expect(msg.getRepeatedStringList()).toEqual(['hello world']); + expect(msg.getRepeatedBytesList().length).toEqual(1); + expect(true).toEqual(bytesCompare(msg.getRepeatedBytesList()[0], BYTES)); + expect(msg.getRepeatedForeignMessageList().length).toEqual(1); + expect(msg.getRepeatedForeignMessageList()[0].getC()).toEqual(1000); + expect(msg.getRepeatedForeignEnumList()).toEqual([ + proto.jspb.test.Proto3Enum.PROTO3_BAR + ]); + + expect(msg.getOneofString()).toEqual('asdf'); }); @@ -321,67 +319,66 @@ describe('proto3Test', function() { */ it('testOneofs', function() { // Default instance. - var msg = new proto.jspb.test.TestProto3(); - assertEquals(msg.getOneofUint32(), 0); - assertEquals(msg.getOneofForeignMessage(), undefined); - assertEquals(msg.getOneofString(), ''); - assertEquals(msg.getOneofBytes(), ''); + const msg = new proto.jspb.test.TestProto3(); + expect(msg.getOneofUint32()).toEqual(0); + expect(msg.getOneofForeignMessage()).toBeUndefined(); + expect(msg.getOneofString()).toEqual(''); + expect(msg.getOneofBytes()).toEqual(''); - assertFalse(msg.hasOneofUint32()); - assertFalse(msg.hasOneofForeignMessage()); - assertFalse(msg.hasOneofString()); - assertFalse(msg.hasOneofBytes()); + expect(msg.hasOneofUint32()).toBeFalse(); + expect(msg.hasOneofForeignMessage()).toBeFalse(); + expect(msg.hasOneofString()).toBeFalse(); + expect(msg.hasOneofBytes()).toBeFalse(); // Integer field. msg.setOneofUint32(42); - assertEquals(msg.getOneofUint32(), 42); - assertEquals(msg.getOneofForeignMessage(), undefined); - assertEquals(msg.getOneofString(), ''); - assertEquals(msg.getOneofBytes(), ''); + expect(msg.getOneofUint32()).toEqual(42); + expect(msg.getOneofForeignMessage()).toBeUndefined(); + expect(msg.getOneofString()).toEqual(''); + expect(msg.getOneofBytes()).toEqual(''); - assertTrue(msg.hasOneofUint32()); - assertFalse(msg.hasOneofForeignMessage()); - assertFalse(msg.hasOneofString()); - assertFalse(msg.hasOneofBytes()); + expect(msg.hasOneofUint32()).toBeTrue(); + expect(msg.hasOneofForeignMessage()).toBeFalse(); + expect(msg.hasOneofString()).toBeFalse(); + expect(msg.hasOneofBytes()).toBeFalse(); // Sub-message field. - var submsg = new proto.jspb.test.ForeignMessage(); + const submsg = new proto.jspb.test.ForeignMessage(); msg.setOneofForeignMessage(submsg); - assertEquals(msg.getOneofUint32(), 0); - assertEquals(msg.getOneofForeignMessage(), submsg); - assertEquals(msg.getOneofString(), ''); - assertEquals(msg.getOneofBytes(), ''); + expect(msg.getOneofUint32()).toEqual(0); + expect(submsg).toEqual(msg.getOneofForeignMessage()); + expect(msg.getOneofString()).toEqual(''); + expect(msg.getOneofBytes()).toEqual(''); - assertFalse(msg.hasOneofUint32()); - assertTrue(msg.hasOneofForeignMessage()); - assertFalse(msg.hasOneofString()); - assertFalse(msg.hasOneofBytes()); + expect(msg.hasOneofUint32()).toBeFalse(); + expect(msg.hasOneofForeignMessage()).toBeTrue(); + expect(msg.hasOneofString()).toBeFalse(); + expect(msg.hasOneofBytes()).toBeFalse(); // String field. msg.setOneofString('hello'); - assertEquals(msg.getOneofUint32(), 0); - assertEquals(msg.getOneofForeignMessage(), undefined); - assertEquals(msg.getOneofString(), 'hello'); - assertEquals(msg.getOneofBytes(), ''); + expect(msg.getOneofUint32()).toEqual(0); + expect(msg.getOneofForeignMessage()).toBeUndefined(); + expect(msg.getOneofString()).toEqual('hello'); + expect(msg.getOneofBytes()).toEqual(''); - assertFalse(msg.hasOneofUint32()); - assertFalse(msg.hasOneofForeignMessage()); - assertTrue(msg.hasOneofString()); - assertFalse(msg.hasOneofBytes()); + expect(msg.hasOneofUint32()).toBeFalse(); + expect(msg.hasOneofForeignMessage()).toBeFalse(); + expect(msg.hasOneofString()).toBeTrue(); + expect(msg.hasOneofBytes()).toBeFalse(); // Bytes field. msg.setOneofBytes(goog.crypt.base64.encodeString('\u00FF\u00FF')); - assertEquals(msg.getOneofUint32(), 0); - assertEquals(msg.getOneofForeignMessage(), undefined); - assertEquals(msg.getOneofString(), ''); - assertEquals( - msg.getOneofBytes_asB64(), - goog.crypt.base64.encodeString('\u00FF\u00FF')); - - assertFalse(msg.hasOneofUint32()); - assertFalse(msg.hasOneofForeignMessage()); - assertFalse(msg.hasOneofString()); - assertTrue(msg.hasOneofBytes()); + expect(msg.getOneofUint32()).toEqual(0); + expect(msg.getOneofForeignMessage()).toBeUndefined(); + expect(msg.getOneofString()).toEqual(''); + expect(msg.getOneofBytes_asB64()) + .toEqual(goog.crypt.base64.encodeString('\u00FF\u00FF')); + + expect(msg.hasOneofUint32()).toBeFalse(); + expect(msg.hasOneofForeignMessage()).toBeFalse(); + expect(msg.hasOneofString()).toBeFalse(); + expect(msg.hasOneofBytes()).toBeTrue(); }); @@ -389,7 +386,7 @@ describe('proto3Test', function() { * Test that "default"-valued primitive fields are not emitted on the wire. */ it('testNoSerializeDefaults', function() { - var msg = new proto.jspb.test.TestProto3(); + const msg = new proto.jspb.test.TestProto3(); // Set each primitive to a non-default value, then back to its default, to // ensure that the serialization is actually checking the value and not just @@ -412,49 +409,49 @@ describe('proto3Test', function() { msg.clearOneofUint32(); - var serialized = msg.serializeBinary(); - assertEquals(0, serialized.length); + const serialized = msg.serializeBinary(); + expect(serialized.length).toEqual(0); }); /** * Test that base64 string and Uint8Array are interchangeable in bytes fields. */ it('testBytesFieldsInterop', function() { - var msg = new proto.jspb.test.TestProto3(); + let msg = new proto.jspb.test.TestProto3(); // Set as a base64 string and check all the getters work. msg.setSingularBytes(BYTES_B64); - assertTrue(bytesCompare(msg.getSingularBytes_asU8(), BYTES)); - assertTrue(bytesCompare(msg.getSingularBytes_asB64(), BYTES)); - assertTrue(bytesCompare(msg.getSingularBytes(), BYTES)); + expect(bytesCompare(msg.getSingularBytes_asU8(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getSingularBytes_asB64(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getSingularBytes(), BYTES)).toBeTrue(); // Test binary serialize round trip doesn't break it. msg = proto.jspb.test.TestProto3.deserializeBinary(msg.serializeBinary()); - assertTrue(bytesCompare(msg.getSingularBytes_asU8(), BYTES)); - assertTrue(bytesCompare(msg.getSingularBytes_asB64(), BYTES)); - assertTrue(bytesCompare(msg.getSingularBytes(), BYTES)); + expect(bytesCompare(msg.getSingularBytes_asU8(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getSingularBytes_asB64(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getSingularBytes(), BYTES)).toBeTrue(); msg = new proto.jspb.test.TestProto3(); // Set as a Uint8Array and check all the getters work. msg.setSingularBytes(BYTES); - assertTrue(bytesCompare(msg.getSingularBytes_asU8(), BYTES)); - assertTrue(bytesCompare(msg.getSingularBytes_asB64(), BYTES)); - assertTrue(bytesCompare(msg.getSingularBytes(), BYTES)); + expect(bytesCompare(msg.getSingularBytes_asU8(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getSingularBytes_asB64(), BYTES)).toBeTrue(); + expect(bytesCompare(msg.getSingularBytes(), BYTES)).toBeTrue(); }); it('testTimestampWellKnownType', function() { - var msg = new proto.google.protobuf.Timestamp(); + const msg = new proto.google.protobuf.Timestamp(); msg.fromDate(new Date(123456789)); - assertEquals(123456, msg.getSeconds()); - assertEquals(789000000, msg.getNanos()); - var date = msg.toDate(); - assertEquals(123456789, date.getTime()); - var anotherMsg = proto.google.protobuf.Timestamp.fromDate(date); - assertEquals(msg.getSeconds(), anotherMsg.getSeconds()); - assertEquals(msg.getNanos(), anotherMsg.getNanos()); + expect(msg.getSeconds()).toEqual(123456); + expect(msg.getNanos()).toEqual(789000000); + const date = msg.toDate(); + expect(date.getTime()).toEqual(123456789); + const anotherMsg = proto.google.protobuf.Timestamp.fromDate(date); + expect(anotherMsg.getSeconds()).toEqual(msg.getSeconds()); + expect(anotherMsg.getNanos()).toEqual(msg.getNanos()); }); it('testStructWellKnownType', function() { - var jsObj = { + const jsObj = { abc: 'def', number: 12345.678, nullKey: null, @@ -464,15 +461,15 @@ describe('proto3Test', function() { complicatedKey: [{xyz: {abc: [3, 4, null, false]}}, 'zzz'] }; - var struct = proto.google.protobuf.Struct.fromJavaScript(jsObj); - var jsObj2 = struct.toJavaScript(); + const struct = proto.google.protobuf.Struct.fromJavaScript(jsObj); + const jsObj2 = struct.toJavaScript(); - assertEquals('def', jsObj2.abc); - assertEquals(12345.678, jsObj2.number); - assertEquals(null, jsObj2.nullKey); - assertEquals(true, jsObj2.boolKey); - assertEquals('abc', jsObj2.listKey[4]); - assertEquals('bar', jsObj2.structKey.foo); - assertEquals(4, jsObj2.complicatedKey[0].xyz.abc[1]); + expect('def').toEqual(jsObj2.abc); + expect(12345.678).toEqual(jsObj2.number); + expect(null).toEqual(jsObj2.nullKey); + expect(true).toEqual(jsObj2.boolKey); + expect('abc').toEqual(jsObj2.listKey[4]); + expect('bar').toEqual(jsObj2.structKey.foo); + expect(4).toEqual(jsObj2.complicatedKey[0].xyz.abc[1]); }); }); diff --git a/yarn.lock b/yarn.lock index 6c24676..b1b90d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,2430 +2,2412 @@ # yarn lockfile v1 -ansi-colors@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" - integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== +"ansi-colors@^1.0.1": + "integrity" "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==" + "resolved" "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz" + "version" "1.1.0" dependencies: - ansi-wrap "^0.1.0" + "ansi-wrap" "^0.1.0" -ansi-gray@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" - integrity sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw== +"ansi-gray@^0.1.1": + "integrity" "sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw==" + "resolved" "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz" + "version" "0.1.1" dependencies: - ansi-wrap "0.1.0" + "ansi-wrap" "0.1.0" -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== +"ansi-regex@^2.0.0": + "integrity" "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "version" "2.1.1" -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" +"ansi-regex@^5.0.1": + "integrity" "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" + "version" "5.0.1" + +"ansi-styles@^3.2.1": + "integrity" "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==" + "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" + "version" "3.2.1" + dependencies: + "color-convert" "^1.9.0" -ansi-styles@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-wrap@0.1.0, ansi-wrap@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" - integrity sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw== - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -append-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" - integrity sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA== - dependencies: - buffer-equal "^1.0.0" - -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - integrity sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw== - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== - -arr-filter@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" - integrity sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA== - dependencies: - make-iterator "^1.0.0" - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-map@^2.0.0, arr-map@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" - integrity sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw== - dependencies: - make-iterator "^1.0.0" - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== - -array-each@^1.0.0, array-each@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" - integrity sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA== - -array-initial@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" - integrity sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw== - dependencies: - array-slice "^1.0.0" - is-number "^4.0.0" - -array-last@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" - integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== - dependencies: - is-number "^4.0.0" - -array-slice@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" - integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== - -array-sort@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" - integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== - dependencies: - default-compare "^1.0.0" - get-value "^2.0.6" - kind-of "^5.0.2" - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== - -async-done@^1.2.0, async-done@^1.2.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" - integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.2" - process-nextick-args "^2.0.0" - stream-exhaust "^1.0.1" - -async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -async-settle@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" - integrity sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw== - dependencies: - async-done "^1.2.2" - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -bach@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" - integrity sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg== - dependencies: - arr-filter "^1.1.1" - arr-flatten "^1.0.1" - arr-map "^2.0.0" - array-each "^1.0.0" - array-initial "^1.0.0" - array-last "^1.1.1" - async-done "^1.2.2" - async-settle "^1.0.0" - now-and-later "^2.0.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^2.3.1, braces@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -buffer-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" - integrity sha512-tcBWO2Dl4e7Asr9hTGcpVrCe+F7DubpmqWCTbj4FHLmjqO2hIaC383acQubWtRJhdceqs5uBHs6Es+Sk//RKiQ== - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - integrity sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg== - -chalk@2.x: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chokidar@^2.0.0: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" +"ansi-styles@^4.0.0": + "integrity" "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==" + "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" + "version" "4.3.0" + dependencies: + "color-convert" "^2.0.1" + +"ansi-wrap@^0.1.0", "ansi-wrap@0.1.0": + "integrity" "sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==" + "resolved" "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz" + "version" "0.1.0" + +"anymatch@^2.0.0": + "integrity" "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==" + "resolved" "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "micromatch" "^3.1.4" + "normalize-path" "^2.1.1" + +"append-buffer@^1.0.2": + "integrity" "sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA==" + "resolved" "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "buffer-equal" "^1.0.0" + +"archy@^1.0.0": + "integrity" "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==" + "resolved" "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz" + "version" "1.0.0" + +"arr-diff@^4.0.0": + "integrity" "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==" + "resolved" "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz" + "version" "4.0.0" + +"arr-filter@^1.1.1": + "integrity" "sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA==" + "resolved" "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz" + "version" "1.1.2" + dependencies: + "make-iterator" "^1.0.0" + +"arr-flatten@^1.0.1", "arr-flatten@^1.1.0": + "integrity" "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "resolved" "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz" + "version" "1.1.0" + +"arr-map@^2.0.0", "arr-map@^2.0.2": + "integrity" "sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw==" + "resolved" "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "make-iterator" "^1.0.0" + +"arr-union@^3.1.0": + "integrity" "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==" + "resolved" "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz" + "version" "3.1.0" + +"array-each@^1.0.0", "array-each@^1.0.1": + "integrity" "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==" + "resolved" "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz" + "version" "1.0.1" + +"array-initial@^1.0.0": + "integrity" "sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw==" + "resolved" "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "array-slice" "^1.0.0" + "is-number" "^4.0.0" + +"array-last@^1.1.1": + "integrity" "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==" + "resolved" "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz" + "version" "1.3.0" + dependencies: + "is-number" "^4.0.0" + +"array-slice@^1.0.0": + "integrity" "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" + "resolved" "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz" + "version" "1.1.0" + +"array-sort@^1.0.0": + "integrity" "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==" + "resolved" "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "default-compare" "^1.0.0" + "get-value" "^2.0.6" + "kind-of" "^5.0.2" + +"array-unique@^0.3.2": + "integrity" "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==" + "resolved" "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz" + "version" "0.3.2" + +"assign-symbols@^1.0.0": + "integrity" "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==" + "resolved" "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz" + "version" "1.0.0" + +"async-done@^1.2.0", "async-done@^1.2.2": + "integrity" "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==" + "resolved" "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz" + "version" "1.3.2" + dependencies: + "end-of-stream" "^1.1.0" + "once" "^1.3.2" + "process-nextick-args" "^2.0.0" + "stream-exhaust" "^1.0.1" + +"async-each@^1.0.1": + "integrity" "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" + "resolved" "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz" + "version" "1.0.3" + +"async-settle@^1.0.0": + "integrity" "sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw==" + "resolved" "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "async-done" "^1.2.2" + +"atob@^2.1.2": + "integrity" "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + "resolved" "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz" + "version" "2.1.2" + +"bach@^1.0.0": + "integrity" "sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg==" + "resolved" "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz" + "version" "1.2.0" + dependencies: + "arr-filter" "^1.1.1" + "arr-flatten" "^1.0.1" + "arr-map" "^2.0.0" + "array-each" "^1.0.0" + "array-initial" "^1.0.0" + "array-last" "^1.1.1" + "async-done" "^1.2.2" + "async-settle" "^1.0.0" + "now-and-later" "^2.0.0" + +"balanced-match@^1.0.0": + "integrity" "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "resolved" "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" + "version" "1.0.2" + +"base@^0.11.1": + "integrity" "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==" + "resolved" "https://registry.npmjs.org/base/-/base-0.11.2.tgz" + "version" "0.11.2" + dependencies: + "cache-base" "^1.0.1" + "class-utils" "^0.3.5" + "component-emitter" "^1.2.1" + "define-property" "^1.0.0" + "isobject" "^3.0.1" + "mixin-deep" "^1.2.0" + "pascalcase" "^0.1.1" + +"binary-extensions@^1.0.0": + "integrity" "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" + "resolved" "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz" + "version" "1.13.1" + +"brace-expansion@^1.1.7": + "integrity" "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==" + "resolved" "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" + "version" "1.1.11" + dependencies: + "balanced-match" "^1.0.0" + "concat-map" "0.0.1" + +"braces@^2.3.1", "braces@^2.3.2": + "integrity" "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==" + "resolved" "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz" + "version" "2.3.2" + dependencies: + "arr-flatten" "^1.1.0" + "array-unique" "^0.3.2" + "extend-shallow" "^2.0.1" + "fill-range" "^4.0.0" + "isobject" "^3.0.1" + "repeat-element" "^1.1.2" + "snapdragon" "^0.8.1" + "snapdragon-node" "^2.0.1" + "split-string" "^3.0.2" + "to-regex" "^3.0.1" + +"buffer-equal@^1.0.0": + "integrity" "sha512-tcBWO2Dl4e7Asr9hTGcpVrCe+F7DubpmqWCTbj4FHLmjqO2hIaC383acQubWtRJhdceqs5uBHs6Es+Sk//RKiQ==" + "resolved" "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz" + "version" "1.0.0" + +"buffer-from@^1.0.0": + "integrity" "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "resolved" "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" + "version" "1.1.2" + +"cache-base@^1.0.1": + "integrity" "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==" + "resolved" "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "collection-visit" "^1.0.0" + "component-emitter" "^1.2.1" + "get-value" "^2.0.6" + "has-value" "^1.0.0" + "isobject" "^3.0.1" + "set-value" "^2.0.0" + "to-object-path" "^0.3.0" + "union-value" "^1.0.0" + "unset-value" "^1.0.0" + +"call-bind@^1.0.0": + "integrity" "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==" + "resolved" "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "function-bind" "^1.1.1" + "get-intrinsic" "^1.0.2" + +"camelcase@^3.0.0": + "integrity" "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" + "resolved" "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz" + "version" "3.0.0" + +"chalk@2.x": + "integrity" "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==" + "resolved" "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + "version" "2.4.2" + dependencies: + "ansi-styles" "^3.2.1" + "escape-string-regexp" "^1.0.5" + "supports-color" "^5.3.0" + +"chokidar@^2.0.0": + "integrity" "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==" + "resolved" "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz" + "version" "2.1.8" + dependencies: + "anymatch" "^2.0.0" + "async-each" "^1.0.1" + "braces" "^2.3.2" + "glob-parent" "^3.1.0" + "inherits" "^2.0.3" + "is-binary-path" "^1.0.0" + "is-glob" "^4.0.0" + "normalize-path" "^3.0.0" + "path-is-absolute" "^1.0.0" + "readdirp" "^2.2.1" + "upath" "^1.1.1" optionalDependencies: - fsevents "^1.2.7" - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w== - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -clone-buffer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" - integrity sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g== - -clone-stats@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" - integrity sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag== - -clone@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== - -cloneable-readable@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" - integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== - dependencies: - inherits "^2.0.1" - process-nextick-args "^2.0.0" - readable-stream "^2.3.5" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== - -collection-map@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" - integrity sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA== - dependencies: - arr-map "^2.0.2" - for-own "^1.0.0" - make-iterator "^1.0.0" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-support@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -concat-stream@^1.6.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -convert-source-map@^1.5.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== - -copy-props@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.5.tgz#03cf9ae328d4ebb36f8f1d804448a6af9ee3f2d2" - integrity sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw== - dependencies: - each-props "^1.3.2" - is-plain-object "^5.0.0" - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== - -default-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" - integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== - dependencies: - kind-of "^5.0.2" - -default-resolution@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" - integrity sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ== - -define-properties@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" - integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== - dependencies: - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -detect-file@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" - integrity sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q== - -duplexify@^3.6.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" - integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== - dependencies: - end-of-stream "^1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" - -each-props@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" - integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== - dependencies: - is-plain-object "^2.0.1" - object.defaults "^1.1.0" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -end-of-stream@^1.0.0, end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -error-ex@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50: - version "0.10.62" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" - integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== - dependencies: - es6-iterator "^2.0.3" - es6-symbol "^3.1.3" - next-tick "^1.1.0" - -es6-iterator@^2.0.1, es6-iterator@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-symbol@^3.1.1, es6-symbol@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -es6-weak-map@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" - integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== - dependencies: - d "1" - es5-ext "^0.10.46" - es6-iterator "^2.0.3" - es6-symbol "^3.1.1" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-tilde@^2.0.0, expand-tilde@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" - integrity sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw== - dependencies: - homedir-polyfill "^1.0.1" - -ext@^1.1.2: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== - dependencies: - type "^2.5.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fancy-log@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" - integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== - dependencies: - ansi-gray "^0.1.1" - color-support "^1.1.3" - parse-node-version "^1.0.0" - time-stamp "^1.0.0" - -fast-levenshtein@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" - integrity sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw== - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA== - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -findup-sync@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" - integrity sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g== - dependencies: - detect-file "^1.0.0" - is-glob "^3.1.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -findup-sync@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" - integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== - dependencies: - detect-file "^1.0.0" - is-glob "^4.0.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -fined@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fined/-/fined-1.2.0.tgz#d00beccf1aa2b475d16d423b0238b713a2c4a37b" - integrity sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng== - dependencies: - expand-tilde "^2.0.2" - is-plain-object "^2.0.3" - object.defaults "^1.1.0" - object.pick "^1.2.0" - parse-filepath "^1.0.1" - -flagged-respawn@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" - integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== - -flush-write-stream@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" - integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== - dependencies: - inherits "^2.0.3" - readable-stream "^2.3.6" - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== - -for-own@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" - integrity sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg== - dependencies: - for-in "^1.0.1" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== - dependencies: - map-cache "^0.2.2" - -fs-mkdirp-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" - integrity sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ== - dependencies: - graceful-fs "^4.1.11" - through2 "^2.0.3" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -fsevents@^1.2.7: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" - integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.3" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA== - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-stream@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" - integrity sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw== - dependencies: - extend "^3.0.0" - glob "^7.1.1" - glob-parent "^3.1.0" - is-negated-glob "^1.0.0" - ordered-read-streams "^1.0.0" - pumpify "^1.3.5" - readable-stream "^2.1.5" - remove-trailing-separator "^1.0.1" - to-absolute-glob "^2.0.0" - unique-stream "^2.0.2" - -glob-watcher@^5.0.3: - version "5.0.5" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.5.tgz#aa6bce648332924d9a8489be41e3e5c52d4186dc" - integrity sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw== - dependencies: - anymatch "^2.0.0" - async-done "^1.2.0" - chokidar "^2.0.0" - is-negated-glob "^1.0.0" - just-debounce "^1.0.0" - normalize-path "^3.0.0" - object.defaults "^1.1.0" - -glob@^7.1.1, glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@~7.1.4: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global-modules@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" - integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== - dependencies: - global-prefix "^1.0.1" - is-windows "^1.0.1" - resolve-dir "^1.0.0" - -global-prefix@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" - integrity sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg== - dependencies: - expand-tilde "^2.0.2" - homedir-polyfill "^1.0.1" - ini "^1.3.4" - is-windows "^1.0.1" - which "^1.2.14" - -glogg@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.2.tgz#2d7dd702beda22eb3bffadf880696da6d846313f" - integrity sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA== - dependencies: - sparkles "^1.0.0" - -google-closure-compiler-java@^20190819.0.0: - version "20190819.0.0" - resolved "https://registry.yarnpkg.com/google-closure-compiler-java/-/google-closure-compiler-java-20190819.0.0.tgz#75d4a74a93441c44b2aecfb6e1278f5dd2e0d7d7" - integrity sha512-i8KzPJZBEF0aZWSn2vlkH0JCeQGIxBVfQaUwc2fCjPbm/v5YfpZzkj38LoMDbE95BlYsq2cPveHUNC4w85UgGw== - -google-closure-compiler-js@^20190819.0.0: - version "20190819.0.0" - resolved "https://registry.yarnpkg.com/google-closure-compiler-js/-/google-closure-compiler-js-20190819.0.0.tgz#f907a4c8e50b034e583d0269fc88e555f84b6582" - integrity sha512-c1MrCW2sBsJ5d5judH6YnBPpxbOzts6D7XYa0KN4I97S0LjXzX5cENBlMUqMGGeSdFyjGr5FP0BxGp49k5UKxQ== - -google-closure-compiler-linux@^20190819.0.0: - version "20190819.0.0" - resolved "https://registry.yarnpkg.com/google-closure-compiler-linux/-/google-closure-compiler-linux-20190819.0.0.tgz#9ad56625f84514b8f095bdabd6b6c7ebe8ae1c31" - integrity sha512-+ia89Ot4dPyRioLlxvkfYiISwJO+2NV7SY0Zp/KfTt9x+eJaGQ9GRIQage50d1mGkUyPmFfxsdPUePpT1QlpaA== - -google-closure-compiler-osx@^20190819.0.0: - version "20190819.0.0" - resolved "https://registry.yarnpkg.com/google-closure-compiler-osx/-/google-closure-compiler-osx-20190819.0.0.tgz#57046952a3f520b942a35d2edaf0379b44b0c84c" - integrity sha512-woANg+oA2zjFebtdYTA4lLtqbOVO9yE9yy8ibGjt76FNlw0bAyxTO4z2ab4CwUNNpOeRoxZyGt9CejlCmNpxJg== - -google-closure-compiler-windows@^20190819.0.0: - version "20190819.0.0" - resolved "https://registry.yarnpkg.com/google-closure-compiler-windows/-/google-closure-compiler-windows-20190819.0.0.tgz#acf1246d65aa9e55a7d449e08188458a9da89867" - integrity sha512-WglPY706c1oN03KiZF02FUWr/7M0eFoev4CQPncSihfjYXpD5E5PMKJ3ppawhzj60CQ9ceC/Omx7VN7Kp0uOQg== - -google-closure-compiler@~20190819.0.0: - version "20190819.0.0" - resolved "https://registry.yarnpkg.com/google-closure-compiler/-/google-closure-compiler-20190819.0.0.tgz#20a8e06b49d1acc83e2bc64bb0c516ca5235ad57" - integrity sha512-5cwcui89TSFrKCa+oH5zq6F0esSHkGbWt1U2LgywakFhe5F27j/0F6NR7QyFYkBf3leDt5kPBvC2Dlc3ZwuFVA== - dependencies: - chalk "2.x" - google-closure-compiler-java "^20190819.0.0" - google-closure-compiler-js "^20190819.0.0" - minimist "1.x" - vinyl "2.x" - vinyl-sourcemaps-apply "^0.2.0" + "fsevents" "^1.2.7" + +"class-utils@^0.3.5": + "integrity" "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==" + "resolved" "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz" + "version" "0.3.6" + dependencies: + "arr-union" "^3.1.0" + "define-property" "^0.2.5" + "isobject" "^3.0.0" + "static-extend" "^0.1.1" + +"cliui@^3.2.0": + "integrity" "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==" + "resolved" "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz" + "version" "3.2.0" + dependencies: + "string-width" "^1.0.1" + "strip-ansi" "^3.0.1" + "wrap-ansi" "^2.0.0" + +"cliui@^7.0.2": + "integrity" "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==" + "resolved" "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" + "version" "7.0.4" + dependencies: + "string-width" "^4.2.0" + "strip-ansi" "^6.0.0" + "wrap-ansi" "^7.0.0" + +"clone-buffer@^1.0.0": + "integrity" "sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==" + "resolved" "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz" + "version" "1.0.0" + +"clone-stats@^1.0.0": + "integrity" "sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag==" + "resolved" "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz" + "version" "1.0.0" + +"clone@^2.1.1": + "integrity" "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==" + "resolved" "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz" + "version" "2.1.2" + +"cloneable-readable@^1.0.0": + "integrity" "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==" + "resolved" "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz" + "version" "1.1.3" + dependencies: + "inherits" "^2.0.1" + "process-nextick-args" "^2.0.0" + "readable-stream" "^2.3.5" + +"code-point-at@^1.0.0": + "integrity" "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==" + "resolved" "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" + "version" "1.1.0" + +"collection-map@^1.0.0": + "integrity" "sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==" + "resolved" "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "arr-map" "^2.0.2" + "for-own" "^1.0.0" + "make-iterator" "^1.0.0" + +"collection-visit@^1.0.0": + "integrity" "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==" + "resolved" "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "map-visit" "^1.0.0" + "object-visit" "^1.0.0" + +"color-convert@^1.9.0": + "integrity" "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==" + "resolved" "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" + "version" "1.9.3" + dependencies: + "color-name" "1.1.3" + +"color-convert@^2.0.1": + "integrity" "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==" + "resolved" "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "color-name" "~1.1.4" + +"color-name@~1.1.4": + "integrity" "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "resolved" "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + "version" "1.1.4" + +"color-name@1.1.3": + "integrity" "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "resolved" "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" + "version" "1.1.3" + +"color-support@^1.1.3": + "integrity" "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + "resolved" "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz" + "version" "1.1.3" + +"component-emitter@^1.2.1": + "integrity" "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + "resolved" "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz" + "version" "1.3.0" + +"concat-map@0.0.1": + "integrity" "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "resolved" "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "version" "0.0.1" + +"concat-stream@^1.6.0": + "integrity" "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==" + "resolved" "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz" + "version" "1.6.2" + dependencies: + "buffer-from" "^1.0.0" + "inherits" "^2.0.3" + "readable-stream" "^2.2.2" + "typedarray" "^0.0.6" + +"convert-source-map@^1.5.0": + "integrity" "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==" + "resolved" "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz" + "version" "1.8.0" + dependencies: + "safe-buffer" "~5.1.1" + +"copy-descriptor@^0.1.0": + "integrity" "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==" + "resolved" "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz" + "version" "0.1.1" + +"copy-props@^2.0.1": + "integrity" "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==" + "resolved" "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz" + "version" "2.0.5" + dependencies: + "each-props" "^1.3.2" + "is-plain-object" "^5.0.0" + +"core-util-is@~1.0.0": + "integrity" "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + "resolved" "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" + "version" "1.0.3" + +"d@^1.0.1", "d@1": + "integrity" "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==" + "resolved" "https://registry.npmjs.org/d/-/d-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "es5-ext" "^0.10.50" + "type" "^1.0.1" + +"debug@^2.2.0", "debug@^2.3.3": + "integrity" "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==" + "resolved" "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" + "version" "2.6.9" + dependencies: + "ms" "2.0.0" + +"decamelize@^1.1.1": + "integrity" "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + "resolved" "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" + "version" "1.2.0" + +"decode-uri-component@^0.2.0": + "integrity" "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==" + "resolved" "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" + "version" "0.2.0" + +"default-compare@^1.0.0": + "integrity" "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==" + "resolved" "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "kind-of" "^5.0.2" + +"default-resolution@^2.0.0": + "integrity" "sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==" + "resolved" "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz" + "version" "2.0.0" + +"define-properties@^1.1.3": + "integrity" "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==" + "resolved" "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz" + "version" "1.1.4" + dependencies: + "has-property-descriptors" "^1.0.0" + "object-keys" "^1.1.1" + +"define-property@^0.2.5": + "integrity" "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==" + "resolved" "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz" + "version" "0.2.5" + dependencies: + "is-descriptor" "^0.1.0" + +"define-property@^1.0.0": + "integrity" "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==" + "resolved" "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "is-descriptor" "^1.0.0" + +"define-property@^2.0.2": + "integrity" "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==" + "resolved" "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "is-descriptor" "^1.0.2" + "isobject" "^3.0.1" + +"detect-file@^1.0.0": + "integrity" "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==" + "resolved" "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz" + "version" "1.0.0" + +"duplexify@^3.6.0": + "integrity" "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==" + "resolved" "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz" + "version" "3.7.1" + dependencies: + "end-of-stream" "^1.0.0" + "inherits" "^2.0.1" + "readable-stream" "^2.0.0" + "stream-shift" "^1.0.0" + +"each-props@^1.3.2": + "integrity" "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==" + "resolved" "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz" + "version" "1.3.2" + dependencies: + "is-plain-object" "^2.0.1" + "object.defaults" "^1.1.0" + +"emoji-regex@^8.0.0": + "integrity" "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "resolved" "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" + "version" "8.0.0" + +"end-of-stream@^1.0.0", "end-of-stream@^1.1.0": + "integrity" "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==" + "resolved" "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" + "version" "1.4.4" + dependencies: + "once" "^1.4.0" + +"error-ex@^1.2.0": + "integrity" "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==" + "resolved" "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" + "version" "1.3.2" + dependencies: + "is-arrayish" "^0.2.1" + +"es5-ext@^0.10.35", "es5-ext@^0.10.46", "es5-ext@^0.10.50": + "integrity" "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==" + "resolved" "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz" + "version" "0.10.61" + dependencies: + "es6-iterator" "^2.0.3" + "es6-symbol" "^3.1.3" + "next-tick" "^1.1.0" + +"es6-iterator@^2.0.1", "es6-iterator@^2.0.3": + "integrity" "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==" + "resolved" "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz" + "version" "2.0.3" + dependencies: + "d" "1" + "es5-ext" "^0.10.35" + "es6-symbol" "^3.1.1" + +"es6-symbol@^3.1.1", "es6-symbol@^3.1.3": + "integrity" "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==" + "resolved" "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz" + "version" "3.1.3" + dependencies: + "d" "^1.0.1" + "ext" "^1.1.2" + +"es6-weak-map@^2.0.1": + "integrity" "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==" + "resolved" "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz" + "version" "2.0.3" + dependencies: + "d" "1" + "es5-ext" "^0.10.46" + "es6-iterator" "^2.0.3" + "es6-symbol" "^3.1.1" + +"escalade@^3.1.1": + "integrity" "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "resolved" "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" + "version" "3.1.1" + +"escape-string-regexp@^1.0.5": + "integrity" "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + "resolved" "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + "version" "1.0.5" + +"expand-brackets@^2.1.4": + "integrity" "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==" + "resolved" "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz" + "version" "2.1.4" + dependencies: + "debug" "^2.3.3" + "define-property" "^0.2.5" + "extend-shallow" "^2.0.1" + "posix-character-classes" "^0.1.0" + "regex-not" "^1.0.0" + "snapdragon" "^0.8.1" + "to-regex" "^3.0.1" + +"expand-tilde@^2.0.0", "expand-tilde@^2.0.2": + "integrity" "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==" + "resolved" "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "homedir-polyfill" "^1.0.1" + +"ext@^1.1.2": + "integrity" "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==" + "resolved" "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz" + "version" "1.6.0" + dependencies: + "type" "^2.5.0" + +"extend-shallow@^2.0.1": + "integrity" "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==" + "resolved" "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "is-extendable" "^0.1.0" + +"extend-shallow@^3.0.0": + "integrity" "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==" + "resolved" "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz" + "version" "3.0.2" + dependencies: + "assign-symbols" "^1.0.0" + "is-extendable" "^1.0.1" + +"extend-shallow@^3.0.2": + "integrity" "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==" + "resolved" "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz" + "version" "3.0.2" + dependencies: + "assign-symbols" "^1.0.0" + "is-extendable" "^1.0.1" + +"extend@^3.0.0": + "integrity" "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "resolved" "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz" + "version" "3.0.2" + +"extglob@^2.0.4": + "integrity" "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==" + "resolved" "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz" + "version" "2.0.4" + dependencies: + "array-unique" "^0.3.2" + "define-property" "^1.0.0" + "expand-brackets" "^2.1.4" + "extend-shallow" "^2.0.1" + "fragment-cache" "^0.2.1" + "regex-not" "^1.0.0" + "snapdragon" "^0.8.1" + "to-regex" "^3.0.1" + +"fancy-log@^1.3.2": + "integrity" "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==" + "resolved" "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz" + "version" "1.3.3" + dependencies: + "ansi-gray" "^0.1.1" + "color-support" "^1.1.3" + "parse-node-version" "^1.0.0" + "time-stamp" "^1.0.0" + +"fast-levenshtein@^1.0.0": + "integrity" "sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw==" + "resolved" "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz" + "version" "1.1.4" + +"fill-range@^4.0.0": + "integrity" "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==" + "resolved" "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz" + "version" "4.0.0" + dependencies: + "extend-shallow" "^2.0.1" + "is-number" "^3.0.0" + "repeat-string" "^1.6.1" + "to-regex-range" "^2.1.0" + +"find-up@^1.0.0": + "integrity" "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==" + "resolved" "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" + "version" "1.1.2" + dependencies: + "path-exists" "^2.0.0" + "pinkie-promise" "^2.0.0" + +"findup-sync@^2.0.0": + "integrity" "sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g==" + "resolved" "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "detect-file" "^1.0.0" + "is-glob" "^3.1.0" + "micromatch" "^3.0.4" + "resolve-dir" "^1.0.1" + +"findup-sync@^3.0.0": + "integrity" "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==" + "resolved" "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "detect-file" "^1.0.0" + "is-glob" "^4.0.0" + "micromatch" "^3.0.4" + "resolve-dir" "^1.0.1" + +"fined@^1.0.1": + "integrity" "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==" + "resolved" "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz" + "version" "1.2.0" + dependencies: + "expand-tilde" "^2.0.2" + "is-plain-object" "^2.0.3" + "object.defaults" "^1.1.0" + "object.pick" "^1.2.0" + "parse-filepath" "^1.0.1" + +"flagged-respawn@^1.0.0": + "integrity" "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==" + "resolved" "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz" + "version" "1.0.1" + +"flush-write-stream@^1.0.2": + "integrity" "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==" + "resolved" "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz" + "version" "1.1.1" + dependencies: + "inherits" "^2.0.3" + "readable-stream" "^2.3.6" + +"for-in@^1.0.1", "for-in@^1.0.2": + "integrity" "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==" + "resolved" "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" + "version" "1.0.2" + +"for-own@^1.0.0": + "integrity" "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==" + "resolved" "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "for-in" "^1.0.1" + +"fragment-cache@^0.2.1": + "integrity" "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==" + "resolved" "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz" + "version" "0.2.1" + dependencies: + "map-cache" "^0.2.2" + +"fs-mkdirp-stream@^1.0.0": + "integrity" "sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ==" + "resolved" "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "graceful-fs" "^4.1.11" + "through2" "^2.0.3" + +"fs.realpath@^1.0.0": + "integrity" "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" + "version" "1.0.0" + +"function-bind@^1.1.1": + "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" + "version" "1.1.1" + +"get-caller-file@^1.0.1": + "integrity" "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "resolved" "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz" + "version" "1.0.3" + +"get-caller-file@^2.0.5": + "integrity" "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "resolved" "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" + "version" "2.0.5" + +"get-intrinsic@^1.0.2", "get-intrinsic@^1.1.1": + "integrity" "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==" + "resolved" "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz" + "version" "1.1.2" + dependencies: + "function-bind" "^1.1.1" + "has" "^1.0.3" + "has-symbols" "^1.0.3" + +"get-value@^2.0.3", "get-value@^2.0.6": + "integrity" "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==" + "resolved" "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz" + "version" "2.0.6" + +"glob-parent@^3.1.0": + "integrity" "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==" + "resolved" "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "is-glob" "^3.1.0" + "path-dirname" "^1.0.0" + +"glob-stream@^6.1.0": + "integrity" "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==" + "resolved" "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz" + "version" "6.1.0" + dependencies: + "extend" "^3.0.0" + "glob" "^7.1.1" + "glob-parent" "^3.1.0" + "is-negated-glob" "^1.0.0" + "ordered-read-streams" "^1.0.0" + "pumpify" "^1.3.5" + "readable-stream" "^2.1.5" + "remove-trailing-separator" "^1.0.1" + "to-absolute-glob" "^2.0.0" + "unique-stream" "^2.0.2" + +"glob-watcher@^5.0.3": + "integrity" "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==" + "resolved" "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz" + "version" "5.0.5" + dependencies: + "anymatch" "^2.0.0" + "async-done" "^1.2.0" + "chokidar" "^2.0.0" + "is-negated-glob" "^1.0.0" + "just-debounce" "^1.0.0" + "normalize-path" "^3.0.0" + "object.defaults" "^1.1.0" + +"glob@^7.1.1", "glob@^7.1.4", "glob@~7.1.4": + "integrity" "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==" + "resolved" "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz" + "version" "7.1.7" + dependencies: + "fs.realpath" "^1.0.0" + "inflight" "^1.0.4" + "inherits" "2" + "minimatch" "^3.0.4" + "once" "^1.3.0" + "path-is-absolute" "^1.0.0" + +"global-modules@^1.0.0": + "integrity" "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==" + "resolved" "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "global-prefix" "^1.0.1" + "is-windows" "^1.0.1" + "resolve-dir" "^1.0.0" + +"global-prefix@^1.0.1": + "integrity" "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==" + "resolved" "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "expand-tilde" "^2.0.2" + "homedir-polyfill" "^1.0.1" + "ini" "^1.3.4" + "is-windows" "^1.0.1" + "which" "^1.2.14" + +"glogg@^1.0.0": + "integrity" "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==" + "resolved" "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "sparkles" "^1.0.0" + +"google-closure-compiler-java@^20190819.0.0": + "integrity" "sha512-i8KzPJZBEF0aZWSn2vlkH0JCeQGIxBVfQaUwc2fCjPbm/v5YfpZzkj38LoMDbE95BlYsq2cPveHUNC4w85UgGw==" + "resolved" "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20190819.0.0.tgz" + "version" "20190819.0.0" + +"google-closure-compiler-js@^20190819.0.0": + "integrity" "sha512-c1MrCW2sBsJ5d5judH6YnBPpxbOzts6D7XYa0KN4I97S0LjXzX5cENBlMUqMGGeSdFyjGr5FP0BxGp49k5UKxQ==" + "resolved" "https://registry.npmjs.org/google-closure-compiler-js/-/google-closure-compiler-js-20190819.0.0.tgz" + "version" "20190819.0.0" + +"google-closure-compiler-linux@^20190819.0.0": + "integrity" "sha512-+ia89Ot4dPyRioLlxvkfYiISwJO+2NV7SY0Zp/KfTt9x+eJaGQ9GRIQage50d1mGkUyPmFfxsdPUePpT1QlpaA==" + "resolved" "https://registry.npmjs.org/google-closure-compiler-linux/-/google-closure-compiler-linux-20190819.0.0.tgz" + "version" "20190819.0.0" + +"google-closure-compiler@~20190819.0.0": + "integrity" "sha512-5cwcui89TSFrKCa+oH5zq6F0esSHkGbWt1U2LgywakFhe5F27j/0F6NR7QyFYkBf3leDt5kPBvC2Dlc3ZwuFVA==" + "resolved" "https://registry.npmjs.org/google-closure-compiler/-/google-closure-compiler-20190819.0.0.tgz" + "version" "20190819.0.0" + dependencies: + "chalk" "2.x" + "google-closure-compiler-java" "^20190819.0.0" + "google-closure-compiler-js" "^20190819.0.0" + "minimist" "1.x" + "vinyl" "2.x" + "vinyl-sourcemaps-apply" "^0.2.0" optionalDependencies: - google-closure-compiler-linux "^20190819.0.0" - google-closure-compiler-osx "^20190819.0.0" - google-closure-compiler-windows "^20190819.0.0" - -google-closure-deps@^20210406.0.0: - version "20210406.0.0" - resolved "https://registry.yarnpkg.com/google-closure-deps/-/google-closure-deps-20210406.0.0.tgz#971986569b39a50def18819bef98f3c2aa8ba189" - integrity sha512-4mn6qZ8u4c/9fhebKccxyN882l5/0O4nuJ+ibuxDy0y7XMgolSLNF/Gmg1HEhEgX00CF/JBKrc/rw0WVjnlSfw== - dependencies: - minimatch "^3.0.4" - yargs "^16.2.0" - -google-closure-library@~20200315.0.0: - version "20200315.0.0" - resolved "https://registry.yarnpkg.com/google-closure-library/-/google-closure-library-20200315.0.0.tgz#e20769b4e5be77da053c2d3bb21effef70146702" - integrity sha512-LdCecdztxDvA9K+8b6E9aE4Hw7ABdYokfA7d5qW1sd/iy8O1l0+eXLlddE2JtW62gf8UjcPskBua4fU4J5lmHA== - -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: - version "4.2.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== - -gulp-cli@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.3.0.tgz#ec0d380e29e52aa45e47977f0d32e18fd161122f" - integrity sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A== - dependencies: - ansi-colors "^1.0.1" - archy "^1.0.0" - array-sort "^1.0.0" - color-support "^1.1.3" - concat-stream "^1.6.0" - copy-props "^2.0.1" - fancy-log "^1.3.2" - gulplog "^1.0.0" - interpret "^1.4.0" - isobject "^3.0.1" - liftoff "^3.1.0" - matchdep "^2.0.0" - mute-stdout "^1.0.0" - pretty-hrtime "^1.0.0" - replace-homedir "^1.0.0" - semver-greatest-satisfied-range "^1.1.0" - v8flags "^3.2.0" - yargs "^7.1.0" - -gulp@~4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" - integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== - dependencies: - glob-watcher "^5.0.3" - gulp-cli "^2.2.0" - undertaker "^1.2.1" - vinyl-fs "^3.0.0" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - integrity sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw== - dependencies: - glogg "^1.0.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-property-descriptors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" - integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== - dependencies: - get-intrinsic "^1.1.1" - -has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -homedir-polyfill@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" - integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== - dependencies: - parse-passwd "^1.0.0" - -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ini@^1.3.4: - version "1.3.8" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -interpret@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ== - -is-absolute@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" - integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== - dependencies: - is-relative "^1.0.0" - is-windows "^1.0.1" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== - dependencies: - kind-of "^3.0.2" + "google-closure-compiler-linux" "^20190819.0.0" + "google-closure-compiler-osx" "^20190819.0.0" + "google-closure-compiler-windows" "^20190819.0.0" + +"google-closure-deps@^20210406.0.0": + "integrity" "sha512-4mn6qZ8u4c/9fhebKccxyN882l5/0O4nuJ+ibuxDy0y7XMgolSLNF/Gmg1HEhEgX00CF/JBKrc/rw0WVjnlSfw==" + "resolved" "https://registry.npmjs.org/google-closure-deps/-/google-closure-deps-20210406.0.0.tgz" + "version" "20210406.0.0" + dependencies: + "minimatch" "^3.0.4" + "yargs" "^16.2.0" + +"google-closure-library@~20200315.0.0": + "integrity" "sha512-LdCecdztxDvA9K+8b6E9aE4Hw7ABdYokfA7d5qW1sd/iy8O1l0+eXLlddE2JtW62gf8UjcPskBua4fU4J5lmHA==" + "resolved" "https://registry.npmjs.org/google-closure-library/-/google-closure-library-20200315.0.0.tgz" + "version" "20200315.0.0" + +"graceful-fs@^4.0.0", "graceful-fs@^4.1.11", "graceful-fs@^4.1.2", "graceful-fs@^4.1.6": + "integrity" "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + "resolved" "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" + "version" "4.2.10" + +"gulp-cli@^2.2.0": + "integrity" "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==" + "resolved" "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz" + "version" "2.3.0" + dependencies: + "ansi-colors" "^1.0.1" + "archy" "^1.0.0" + "array-sort" "^1.0.0" + "color-support" "^1.1.3" + "concat-stream" "^1.6.0" + "copy-props" "^2.0.1" + "fancy-log" "^1.3.2" + "gulplog" "^1.0.0" + "interpret" "^1.4.0" + "isobject" "^3.0.1" + "liftoff" "^3.1.0" + "matchdep" "^2.0.0" + "mute-stdout" "^1.0.0" + "pretty-hrtime" "^1.0.0" + "replace-homedir" "^1.0.0" + "semver-greatest-satisfied-range" "^1.1.0" + "v8flags" "^3.2.0" + "yargs" "^7.1.0" + +"gulp@~4.0.2": + "integrity" "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==" + "resolved" "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz" + "version" "4.0.2" + dependencies: + "glob-watcher" "^5.0.3" + "gulp-cli" "^2.2.0" + "undertaker" "^1.2.1" + "vinyl-fs" "^3.0.0" + +"gulplog@^1.0.0": + "integrity" "sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==" + "resolved" "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "glogg" "^1.0.0" + +"has-flag@^3.0.0": + "integrity" "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + "resolved" "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" + "version" "3.0.0" + +"has-property-descriptors@^1.0.0": + "integrity" "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==" + "resolved" "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "get-intrinsic" "^1.1.1" + +"has-symbols@^1.0.1", "has-symbols@^1.0.3": + "integrity" "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "resolved" "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" + "version" "1.0.3" + +"has-value@^0.3.1": + "integrity" "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==" + "resolved" "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz" + "version" "0.3.1" + dependencies: + "get-value" "^2.0.3" + "has-values" "^0.1.4" + "isobject" "^2.0.0" + +"has-value@^1.0.0": + "integrity" "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==" + "resolved" "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "get-value" "^2.0.6" + "has-values" "^1.0.0" + "isobject" "^3.0.0" + +"has-values@^0.1.4": + "integrity" "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==" + "resolved" "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz" + "version" "0.1.4" + +"has-values@^1.0.0": + "integrity" "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==" + "resolved" "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "is-number" "^3.0.0" + "kind-of" "^4.0.0" + +"has@^1.0.3": + "integrity" "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==" + "resolved" "https://registry.npmjs.org/has/-/has-1.0.3.tgz" + "version" "1.0.3" + dependencies: + "function-bind" "^1.1.1" + +"homedir-polyfill@^1.0.1": + "integrity" "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==" + "resolved" "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz" + "version" "1.0.3" + dependencies: + "parse-passwd" "^1.0.0" + +"hosted-git-info@^2.1.4": + "integrity" "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + "resolved" "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz" + "version" "2.8.9" + +"inflight@^1.0.4": + "integrity" "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==" + "resolved" "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" + "version" "1.0.6" + dependencies: + "once" "^1.3.0" + "wrappy" "1" + +"inherits@^2.0.1", "inherits@^2.0.3", "inherits@~2.0.3", "inherits@2": + "integrity" "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" + "version" "2.0.4" + +"ini@^1.3.4": + "integrity" "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "resolved" "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" + "version" "1.3.8" + +"interpret@^1.4.0": + "integrity" "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + "resolved" "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" + "version" "1.4.0" + +"invert-kv@^1.0.0": + "integrity" "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==" + "resolved" "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" + "version" "1.0.0" + +"is-absolute@^1.0.0": + "integrity" "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==" + "resolved" "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "is-relative" "^1.0.0" + "is-windows" "^1.0.1" + +"is-accessor-descriptor@^0.1.6": + "integrity" "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==" + "resolved" "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz" + "version" "0.1.6" + dependencies: + "kind-of" "^3.0.2" -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" +"is-accessor-descriptor@^1.0.0": + "integrity" "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==" + "resolved" "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "kind-of" "^6.0.0" -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== +"is-arrayish@^0.2.1": + "integrity" "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + "resolved" "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + "version" "0.2.1" -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q== - dependencies: - binary-extensions "^1.0.0" +"is-binary-path@^1.0.0": + "integrity" "sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==" + "resolved" "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "binary-extensions" "^1.0.0" -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +"is-buffer@^1.1.5": + "integrity" "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "resolved" "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz" + "version" "1.1.6" -is-core-module@^2.9.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" - integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== +"is-core-module@^2.9.0": + "integrity" "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==" + "resolved" "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz" + "version" "2.9.0" dependencies: - has "^1.0.3" + "has" "^1.0.3" -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== +"is-data-descriptor@^0.1.4": + "integrity" "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==" + "resolved" "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz" + "version" "0.1.4" dependencies: - kind-of "^3.0.2" + "kind-of" "^3.0.2" -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== +"is-data-descriptor@^1.0.0": + "integrity" "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==" + "resolved" "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz" + "version" "1.0.0" dependencies: - kind-of "^6.0.0" + "kind-of" "^6.0.0" -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== +"is-descriptor@^0.1.0": + "integrity" "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==" + "resolved" "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz" + "version" "0.1.6" dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" + "is-accessor-descriptor" "^0.1.6" + "is-data-descriptor" "^0.1.4" + "kind-of" "^5.0.0" -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== +"is-descriptor@^1.0.0", "is-descriptor@^1.0.2": + "integrity" "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==" + "resolved" "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz" + "version" "1.0.2" dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" + "is-accessor-descriptor" "^1.0.0" + "is-data-descriptor" "^1.0.0" + "kind-of" "^6.0.2" -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== +"is-extendable@^0.1.0", "is-extendable@^0.1.1": + "integrity" "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==" + "resolved" "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + "version" "0.1.1" -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== +"is-extendable@^1.0.1": + "integrity" "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==" + "resolved" "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz" + "version" "1.0.1" dependencies: - number-is-nan "^1.0.0" + "is-plain-object" "^2.0.4" -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +"is-extglob@^2.1.0", "is-extglob@^2.1.1": + "integrity" "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + "resolved" "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" + "version" "2.1.1" -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw== +"is-fullwidth-code-point@^1.0.0": + "integrity" "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==" + "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + "version" "1.0.0" dependencies: - is-extglob "^2.1.0" + "number-is-nan" "^1.0.0" -is-glob@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== +"is-fullwidth-code-point@^3.0.0": + "integrity" "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" + "version" "3.0.0" + +"is-glob@^3.1.0": + "integrity" "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==" + "resolved" "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "is-extglob" "^2.1.0" + +"is-glob@^4.0.0": + "integrity" "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==" + "resolved" "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" + "version" "4.0.3" + dependencies: + "is-extglob" "^2.1.1" + +"is-negated-glob@^1.0.0": + "integrity" "sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==" + "resolved" "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz" + "version" "1.0.0" + +"is-number@^3.0.0": + "integrity" "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==" + "resolved" "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz" + "version" "3.0.0" dependencies: - is-extglob "^2.1.1" - -is-negated-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" - integrity sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug== - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== + "kind-of" "^3.0.2" + +"is-number@^4.0.0": + "integrity" "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + "resolved" "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz" + "version" "4.0.0" + +"is-plain-object@^2.0.1": + "integrity" "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==" + "resolved" "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" + "version" "2.0.4" + dependencies: + "isobject" "^3.0.1" + +"is-plain-object@^2.0.3": + "integrity" "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==" + "resolved" "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" + "version" "2.0.4" dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + "isobject" "^3.0.1" -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== +"is-plain-object@^2.0.4": + "integrity" "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==" + "resolved" "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" + "version" "2.0.4" dependencies: - isobject "^3.0.1" - -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - -is-relative@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" - integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== - dependencies: - is-unc-path "^1.0.0" - -is-unc-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" - integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== - dependencies: - unc-path-regex "^0.1.2" - -is-utf8@^0.2.0, is-utf8@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q== - -is-valid-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" - integrity sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA== - -is-windows@^1.0.1, is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== - -jasmine-core@~3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.4.0.tgz#2a74618e966026530c3518f03e9f845d26473ce3" - integrity sha512-HU/YxV4i6GcmiH4duATwAbJQMlE0MsDIR5XmSVxURxKHn3aGAdbY1/ZJFmVRbKtnLwIxxMJD7gYaPsypcbYimg== - -jasmine@~3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.4.0.tgz#0fa68903ff0c9697459cd044b44f4dcef5ec8bdc" - integrity sha512-sR9b4n+fnBFDEd7VS2el2DeHgKcPiMVn44rtKFumq9q7P/t8WrxsVIZPob4UDdgcDNCwyDqwxCt4k9TDRmjPoQ== - dependencies: - glob "^7.1.3" - jasmine-core "~3.4.0" - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== - -just-debounce@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.1.0.tgz#2f81a3ad4121a76bc7cb45dbf704c0d76a8e5ddf" - integrity sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ== - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0, kind-of@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -last-run@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" - integrity sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ== - dependencies: - default-resolution "^2.0.0" - es6-weak-map "^2.0.1" - -lazystream@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.1.tgz#494c831062f1f9408251ec44db1cba29242a2638" - integrity sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw== - dependencies: - readable-stream "^2.0.5" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw== - dependencies: - invert-kv "^1.0.0" - -lead@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" - integrity sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow== - dependencies: - flush-write-stream "^1.0.2" - -liftoff@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" - integrity sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog== - dependencies: - extend "^3.0.0" - findup-sync "^3.0.0" - fined "^1.0.1" - flagged-respawn "^1.0.0" - is-plain-object "^2.0.4" - object.map "^1.0.0" - rechoir "^0.6.2" - resolve "^1.1.7" - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - integrity sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A== - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -make-iterator@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" - integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== - dependencies: - kind-of "^6.0.2" - -map-cache@^0.2.0, map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== - dependencies: - object-visit "^1.0.0" - -matchdep@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" - integrity sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA== - dependencies: - findup-sync "^2.0.0" - micromatch "^3.0.4" - resolve "^1.4.0" - stack-trace "0.0.10" - -micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -minimatch@^3.0.4, minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimist@1.x: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== - -mute-stdout@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" - integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== - -nan@^2.12.1: - version "2.16.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" - integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -next-tick@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" - integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== - -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -now-and-later@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" - integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== - dependencies: - once "^1.3.2" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== - dependencies: - isobject "^3.0.0" - -object.assign@^4.0.4, object.assign@^4.1.0: - version "4.1.4" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" - integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - has-symbols "^1.0.3" - object-keys "^1.1.1" - -object.defaults@^1.0.0, object.defaults@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" - integrity sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA== - dependencies: - array-each "^1.0.1" - array-slice "^1.0.0" - for-own "^1.0.0" - isobject "^3.0.0" - -object.map@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" - integrity sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w== - dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" - -object.pick@^1.2.0, object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== - dependencies: - isobject "^3.0.1" - -object.reduce@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" - integrity sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw== - dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" - -once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -ordered-read-streams@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" - integrity sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw== - dependencies: - readable-stream "^2.0.1" - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g== - dependencies: - lcid "^1.0.0" - -parse-filepath@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" - integrity sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q== - dependencies: - is-absolute "^1.0.0" - map-cache "^0.2.0" - path-root "^0.1.1" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ== - dependencies: - error-ex "^1.2.0" - -parse-node-version@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" - integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== - -parse-passwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" - integrity sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q== - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ== - dependencies: - pinkie-promise "^2.0.0" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-root-regex@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" - integrity sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ== - -path-root@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" - integrity sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg== - dependencies: - path-root-regex "^0.1.0" - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - integrity sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg== - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw== - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg== - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== - -pretty-hrtime@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" - integrity sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A== - -process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -pump@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" - integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pumpify@^1.3.5: - version "1.5.1" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" - integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== - dependencies: - duplexify "^3.6.0" - inherits "^2.0.3" - pump "^2.0.0" - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - integrity sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A== - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - integrity sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ== - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== - dependencies: - resolve "^1.1.6" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-bom-buffer@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" - integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== - dependencies: - is-buffer "^1.1.5" - is-utf8 "^0.2.1" - -remove-bom-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" - integrity sha512-wigO8/O08XHb8YPzpDDT+QmRANfW6vLqxfaXm1YXhnFf3AkSLyjfG3GEFg4McZkmgL7KvCj5u2KczkvSP6NfHA== - dependencies: - remove-bom-buffer "^3.0.0" - safe-buffer "^5.1.0" - through2 "^2.0.3" - -remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== - -replace-ext@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" - integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== - -replace-homedir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" - integrity sha512-CHPV/GAglbIB1tnQgaiysb8H2yCy8WQ7lcEwQ/eT+kLj0QHV8LnJW0zpqpE7RSkrMSRoa+EBoag86clf7WAgSg== - dependencies: - homedir-polyfill "^1.0.1" - is-absolute "^1.0.0" - remove-trailing-separator "^1.1.0" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug== - -resolve-dir@^1.0.0, resolve-dir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" - integrity sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg== - dependencies: - expand-tilde "^2.0.0" - global-modules "^1.0.0" - -resolve-options@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" - integrity sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A== - dependencies: - value-or-function "^3.0.0" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== - -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.4.0: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== - dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -safe-buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== - dependencies: - ret "~0.1.10" - -semver-greatest-satisfied-range@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" - integrity sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ== - dependencies: - sver-compat "^1.5.0" + "isobject" "^3.0.1" + +"is-plain-object@^5.0.0": + "integrity" "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + "resolved" "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz" + "version" "5.0.0" + +"is-relative@^1.0.0": + "integrity" "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==" + "resolved" "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "is-unc-path" "^1.0.0" + +"is-unc-path@^1.0.0": + "integrity" "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==" + "resolved" "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "unc-path-regex" "^0.1.2" + +"is-utf8@^0.2.0", "is-utf8@^0.2.1": + "integrity" "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==" + "resolved" "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz" + "version" "0.2.1" + +"is-valid-glob@^1.0.0": + "integrity" "sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA==" + "resolved" "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz" + "version" "1.0.0" + +"is-windows@^1.0.1", "is-windows@^1.0.2": + "integrity" "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + "resolved" "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" + "version" "1.0.2" + +"isarray@~1.0.0", "isarray@1.0.0": + "integrity" "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + "resolved" "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "version" "1.0.0" + +"isexe@^2.0.0": + "integrity" "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "resolved" "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" + "version" "2.0.0" + +"isobject@^2.0.0": + "integrity" "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==" + "resolved" "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "isarray" "1.0.0" + +"isobject@^3.0.0", "isobject@^3.0.1": + "integrity" "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==" + "resolved" "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" + "version" "3.0.1" + +"jasmine-core@~3.5.0": + "integrity" "sha512-nCeAiw37MIMA9w9IXso7bRaLl+c/ef3wnxsoSAlYrzS+Ot0zTG6nU8G/cIfGkqpkjX2wNaIW9RFG0TwIFnG6bA==" + "resolved" "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.5.0.tgz" + "version" "3.5.0" + +"jasmine@~3.5.0": + "integrity" "sha512-DYypSryORqzsGoMazemIHUfMkXM7I7easFaxAvNM3Mr6Xz3Fy36TupTrAOxZWN8MVKEU5xECv22J4tUQf3uBzQ==" + "resolved" "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz" + "version" "3.5.0" + dependencies: + "glob" "^7.1.4" + "jasmine-core" "~3.5.0" + +"json-stable-stringify-without-jsonify@^1.0.1": + "integrity" "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" + "resolved" "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" + "version" "1.0.1" + +"just-debounce@^1.0.0": + "integrity" "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==" + "resolved" "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz" + "version" "1.1.0" + +"kind-of@^3.0.2", "kind-of@^3.0.3": + "integrity" "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" + "version" "3.2.2" + dependencies: + "is-buffer" "^1.1.5" + +"kind-of@^3.2.0": + "integrity" "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" + "version" "3.2.2" + dependencies: + "is-buffer" "^1.1.5" + +"kind-of@^4.0.0": + "integrity" "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz" + "version" "4.0.0" + dependencies: + "is-buffer" "^1.1.5" + +"kind-of@^5.0.0", "kind-of@^5.0.2": + "integrity" "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz" + "version" "5.1.0" + +"kind-of@^6.0.0": + "integrity" "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + "version" "6.0.3" + +"kind-of@^6.0.2": + "integrity" "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + "version" "6.0.3" + +"last-run@^1.1.0": + "integrity" "sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ==" + "resolved" "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz" + "version" "1.1.1" + dependencies: + "default-resolution" "^2.0.0" + "es6-weak-map" "^2.0.1" + +"lazystream@^1.0.0": + "integrity" "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==" + "resolved" "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "readable-stream" "^2.0.5" + +"lcid@^1.0.0": + "integrity" "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==" + "resolved" "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "invert-kv" "^1.0.0" + +"lead@^1.0.0": + "integrity" "sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow==" + "resolved" "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "flush-write-stream" "^1.0.2" + +"liftoff@^3.1.0": + "integrity" "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==" + "resolved" "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "extend" "^3.0.0" + "findup-sync" "^3.0.0" + "fined" "^1.0.1" + "flagged-respawn" "^1.0.0" + "is-plain-object" "^2.0.4" + "object.map" "^1.0.0" + "rechoir" "^0.6.2" + "resolve" "^1.1.7" + +"load-json-file@^1.0.0": + "integrity" "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==" + "resolved" "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "graceful-fs" "^4.1.2" + "parse-json" "^2.2.0" + "pify" "^2.0.0" + "pinkie-promise" "^2.0.0" + "strip-bom" "^2.0.0" + +"make-iterator@^1.0.0": + "integrity" "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==" + "resolved" "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "kind-of" "^6.0.2" + +"map-cache@^0.2.0", "map-cache@^0.2.2": + "integrity" "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==" + "resolved" "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz" + "version" "0.2.2" + +"map-visit@^1.0.0": + "integrity" "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==" + "resolved" "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "object-visit" "^1.0.0" + +"matchdep@^2.0.0": + "integrity" "sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA==" + "resolved" "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "findup-sync" "^2.0.0" + "micromatch" "^3.0.4" + "resolve" "^1.4.0" + "stack-trace" "0.0.10" + +"micromatch@^3.0.4", "micromatch@^3.1.10", "micromatch@^3.1.4": + "integrity" "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==" + "resolved" "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz" + "version" "3.1.10" + dependencies: + "arr-diff" "^4.0.0" + "array-unique" "^0.3.2" + "braces" "^2.3.1" + "define-property" "^2.0.2" + "extend-shallow" "^3.0.2" + "extglob" "^2.0.4" + "fragment-cache" "^0.2.1" + "kind-of" "^6.0.2" + "nanomatch" "^1.2.9" + "object.pick" "^1.3.0" + "regex-not" "^1.0.0" + "snapdragon" "^0.8.1" + "to-regex" "^3.0.2" + +"minimatch@^3.0.4": + "integrity" "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==" + "resolved" "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" + "version" "3.1.2" + dependencies: + "brace-expansion" "^1.1.7" + +"minimist@1.x": + "integrity" "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "resolved" "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz" + "version" "1.2.6" + +"mixin-deep@^1.2.0": + "integrity" "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==" + "resolved" "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz" + "version" "1.3.2" + dependencies: + "for-in" "^1.0.2" + "is-extendable" "^1.0.1" + +"ms@2.0.0": + "integrity" "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "resolved" "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + "version" "2.0.0" + +"mute-stdout@^1.0.0": + "integrity" "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==" + "resolved" "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz" + "version" "1.0.1" + +"nanomatch@^1.2.9": + "integrity" "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==" + "resolved" "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz" + "version" "1.2.13" + dependencies: + "arr-diff" "^4.0.0" + "array-unique" "^0.3.2" + "define-property" "^2.0.2" + "extend-shallow" "^3.0.2" + "fragment-cache" "^0.2.1" + "is-windows" "^1.0.2" + "kind-of" "^6.0.2" + "object.pick" "^1.3.0" + "regex-not" "^1.0.0" + "snapdragon" "^0.8.1" + "to-regex" "^3.0.1" + +"next-tick@^1.1.0": + "integrity" "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + "resolved" "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz" + "version" "1.1.0" + +"normalize-package-data@^2.3.2": + "integrity" "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==" + "resolved" "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" + "version" "2.5.0" + dependencies: + "hosted-git-info" "^2.1.4" + "resolve" "^1.10.0" + "semver" "2 || 3 || 4 || 5" + "validate-npm-package-license" "^3.0.1" + +"normalize-path@^2.1.1": + "integrity" "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==" + "resolved" "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz" + "version" "2.1.1" + dependencies: + "remove-trailing-separator" "^1.0.1" + +"normalize-path@^3.0.0": + "integrity" "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + "resolved" "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" + "version" "3.0.0" + +"now-and-later@^2.0.0": + "integrity" "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==" + "resolved" "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "once" "^1.3.2" + +"number-is-nan@^1.0.0": + "integrity" "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==" + "resolved" "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + "version" "1.0.1" + +"object-copy@^0.1.0": + "integrity" "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==" + "resolved" "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz" + "version" "0.1.0" + dependencies: + "copy-descriptor" "^0.1.0" + "define-property" "^0.2.5" + "kind-of" "^3.0.3" + +"object-keys@^1.1.1": + "integrity" "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "resolved" "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" + "version" "1.1.1" + +"object-visit@^1.0.0": + "integrity" "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==" + "resolved" "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "isobject" "^3.0.0" + +"object.assign@^4.0.4", "object.assign@^4.1.0": + "integrity" "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==" + "resolved" "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz" + "version" "4.1.2" + dependencies: + "call-bind" "^1.0.0" + "define-properties" "^1.1.3" + "has-symbols" "^1.0.1" + "object-keys" "^1.1.1" + +"object.defaults@^1.0.0", "object.defaults@^1.1.0": + "integrity" "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==" + "resolved" "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "array-each" "^1.0.1" + "array-slice" "^1.0.0" + "for-own" "^1.0.0" + "isobject" "^3.0.0" + +"object.map@^1.0.0": + "integrity" "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==" + "resolved" "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "for-own" "^1.0.0" + "make-iterator" "^1.0.0" + +"object.pick@^1.2.0", "object.pick@^1.3.0": + "integrity" "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==" + "resolved" "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz" + "version" "1.3.0" + dependencies: + "isobject" "^3.0.1" + +"object.reduce@^1.0.0": + "integrity" "sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw==" + "resolved" "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "for-own" "^1.0.0" + "make-iterator" "^1.0.0" + +"once@^1.3.0", "once@^1.3.1", "once@^1.3.2", "once@^1.4.0": + "integrity" "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==" + "resolved" "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + "version" "1.4.0" + dependencies: + "wrappy" "1" + +"ordered-read-streams@^1.0.0": + "integrity" "sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw==" + "resolved" "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "readable-stream" "^2.0.1" + +"os-locale@^1.4.0": + "integrity" "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==" + "resolved" "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz" + "version" "1.4.0" + dependencies: + "lcid" "^1.0.0" + +"parse-filepath@^1.0.1": + "integrity" "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==" + "resolved" "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "is-absolute" "^1.0.0" + "map-cache" "^0.2.0" + "path-root" "^0.1.1" + +"parse-json@^2.2.0": + "integrity" "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==" + "resolved" "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz" + "version" "2.2.0" + dependencies: + "error-ex" "^1.2.0" + +"parse-node-version@^1.0.0": + "integrity" "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==" + "resolved" "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz" + "version" "1.0.1" + +"parse-passwd@^1.0.0": + "integrity" "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==" + "resolved" "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz" + "version" "1.0.0" + +"pascalcase@^0.1.1": + "integrity" "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==" + "resolved" "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz" + "version" "0.1.1" + +"path-dirname@^1.0.0": + "integrity" "sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==" + "resolved" "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz" + "version" "1.0.2" + +"path-exists@^2.0.0": + "integrity" "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==" + "resolved" "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "pinkie-promise" "^2.0.0" + +"path-is-absolute@^1.0.0": + "integrity" "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + "resolved" "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "version" "1.0.1" + +"path-parse@^1.0.7": + "integrity" "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "resolved" "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" + "version" "1.0.7" + +"path-root-regex@^0.1.0": + "integrity" "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==" + "resolved" "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz" + "version" "0.1.2" + +"path-root@^0.1.1": + "integrity" "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==" + "resolved" "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz" + "version" "0.1.1" + dependencies: + "path-root-regex" "^0.1.0" + +"path-type@^1.0.0": + "integrity" "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==" + "resolved" "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "graceful-fs" "^4.1.2" + "pify" "^2.0.0" + "pinkie-promise" "^2.0.0" + +"pify@^2.0.0": + "integrity" "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" + "resolved" "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" + "version" "2.3.0" + +"pinkie-promise@^2.0.0": + "integrity" "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==" + "resolved" "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "pinkie" "^2.0.0" + +"pinkie@^2.0.0": + "integrity" "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==" + "resolved" "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + "version" "2.0.4" + +"posix-character-classes@^0.1.0": + "integrity" "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==" + "resolved" "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz" + "version" "0.1.1" + +"pretty-hrtime@^1.0.0": + "integrity" "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==" + "resolved" "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz" + "version" "1.0.3" + +"process-nextick-args@^2.0.0", "process-nextick-args@~2.0.0": + "integrity" "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "resolved" "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" + "version" "2.0.1" + +"pump@^2.0.0": + "integrity" "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==" + "resolved" "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "end-of-stream" "^1.1.0" + "once" "^1.3.1" + +"pumpify@^1.3.5": + "integrity" "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==" + "resolved" "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz" + "version" "1.5.1" + dependencies: + "duplexify" "^3.6.0" + "inherits" "^2.0.3" + "pump" "^2.0.0" + +"read-pkg-up@^1.0.1": + "integrity" "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==" + "resolved" "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "find-up" "^1.0.0" + "read-pkg" "^1.0.0" + +"read-pkg@^1.0.0": + "integrity" "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==" + "resolved" "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "load-json-file" "^1.0.0" + "normalize-package-data" "^2.3.2" + "path-type" "^1.0.0" + +"readable-stream@^2.0.0", "readable-stream@^2.0.1", "readable-stream@^2.0.2", "readable-stream@^2.0.5", "readable-stream@^2.1.5", "readable-stream@^2.2.2", "readable-stream@^2.3.3", "readable-stream@^2.3.5", "readable-stream@^2.3.6", "readable-stream@~2.3.6": + "integrity" "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==" + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" + "version" "2.3.7" + dependencies: + "core-util-is" "~1.0.0" + "inherits" "~2.0.3" + "isarray" "~1.0.0" + "process-nextick-args" "~2.0.0" + "safe-buffer" "~5.1.1" + "string_decoder" "~1.1.1" + "util-deprecate" "~1.0.1" + +"readdirp@^2.2.1": + "integrity" "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==" + "resolved" "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz" + "version" "2.2.1" + dependencies: + "graceful-fs" "^4.1.11" + "micromatch" "^3.1.10" + "readable-stream" "^2.0.2" + +"rechoir@^0.6.2": + "integrity" "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==" + "resolved" "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" + "version" "0.6.2" + dependencies: + "resolve" "^1.1.6" + +"regex-not@^1.0.0", "regex-not@^1.0.2": + "integrity" "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==" + "resolved" "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "extend-shallow" "^3.0.2" + "safe-regex" "^1.1.0" + +"remove-bom-buffer@^3.0.0": + "integrity" "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==" + "resolved" "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "is-buffer" "^1.1.5" + "is-utf8" "^0.2.1" + +"remove-bom-stream@^1.2.0": + "integrity" "sha512-wigO8/O08XHb8YPzpDDT+QmRANfW6vLqxfaXm1YXhnFf3AkSLyjfG3GEFg4McZkmgL7KvCj5u2KczkvSP6NfHA==" + "resolved" "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz" + "version" "1.2.0" + dependencies: + "remove-bom-buffer" "^3.0.0" + "safe-buffer" "^5.1.0" + "through2" "^2.0.3" + +"remove-trailing-separator@^1.0.1", "remove-trailing-separator@^1.1.0": + "integrity" "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==" + "resolved" "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz" + "version" "1.1.0" + +"repeat-element@^1.1.2": + "integrity" "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==" + "resolved" "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz" + "version" "1.1.4" + +"repeat-string@^1.6.1": + "integrity" "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==" + "resolved" "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" + "version" "1.6.1" + +"replace-ext@^1.0.0": + "integrity" "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==" + "resolved" "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz" + "version" "1.0.1" + +"replace-homedir@^1.0.0": + "integrity" "sha512-CHPV/GAglbIB1tnQgaiysb8H2yCy8WQ7lcEwQ/eT+kLj0QHV8LnJW0zpqpE7RSkrMSRoa+EBoag86clf7WAgSg==" + "resolved" "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "homedir-polyfill" "^1.0.1" + "is-absolute" "^1.0.0" + "remove-trailing-separator" "^1.1.0" + +"require-directory@^2.1.1": + "integrity" "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + "resolved" "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" + "version" "2.1.1" + +"require-main-filename@^1.0.1": + "integrity" "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" + "resolved" "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz" + "version" "1.0.1" + +"resolve-dir@^1.0.0", "resolve-dir@^1.0.1": + "integrity" "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==" + "resolved" "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "expand-tilde" "^2.0.0" + "global-modules" "^1.0.0" + +"resolve-options@^1.1.0": + "integrity" "sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A==" + "resolved" "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "value-or-function" "^3.0.0" + +"resolve-url@^0.2.1": + "integrity" "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==" + "resolved" "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz" + "version" "0.2.1" + +"resolve@^1.1.6", "resolve@^1.1.7", "resolve@^1.10.0", "resolve@^1.4.0": + "integrity" "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==" + "resolved" "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" + "version" "1.22.1" + dependencies: + "is-core-module" "^2.9.0" + "path-parse" "^1.0.7" + "supports-preserve-symlinks-flag" "^1.0.0" + +"ret@~0.1.10": + "integrity" "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + "resolved" "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" + "version" "0.1.15" + +"safe-buffer@^5.1.0", "safe-buffer@~5.1.0", "safe-buffer@~5.1.1": + "integrity" "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" + "version" "5.1.2" + +"safe-regex@^1.1.0": + "integrity" "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==" + "resolved" "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "ret" "~0.1.10" + +"semver-greatest-satisfied-range@^1.1.0": + "integrity" "sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ==" + "resolved" "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "sver-compat" "^1.5.0" "semver@2 || 3 || 4 || 5": - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.1, source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== - -sparkles@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c" - integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.12" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz#69077835abe2710b65f03969898b6637b505a779" - integrity sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -stack-trace@0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg== - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -stream-exhaust@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" - integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== - -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== - -string-width@^1.0.1, string-width@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g== - dependencies: - is-utf8 "^0.2.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -sver-compat@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" - integrity sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg== - dependencies: - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - -through2-filter@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" - integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA== - dependencies: - through2 "~2.0.0" - xtend "~4.0.0" - -through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -time-stamp@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" - integrity sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw== - -to-absolute-glob@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" - integrity sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA== - dependencies: - is-absolute "^1.0.0" - is-negated-glob "^1.0.0" - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -to-through@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" - integrity sha512-+QIz37Ly7acM4EMdw2PRN389OneM5+d844tirkGp4dPKzI5OE72V9OsbFp+CIYJDahZ41ZV05hNtcPAQUAm9/Q== - dependencies: - through2 "^2.0.3" - -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.5.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" - integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== - -unc-path-regex@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" - integrity sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg== - -undertaker-registry@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" - integrity sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw== - -undertaker@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.3.0.tgz#363a6e541f27954d5791d6fa3c1d321666f86d18" - integrity sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg== - dependencies: - arr-flatten "^1.0.1" - arr-map "^2.0.0" - bach "^1.0.0" - collection-map "^1.0.0" - es6-weak-map "^2.0.1" - fast-levenshtein "^1.0.0" - last-run "^1.1.0" - object.defaults "^1.0.0" - object.reduce "^1.0.0" - undertaker-registry "^1.0.0" - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -unique-stream@^2.0.2: - version "2.3.1" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac" - integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A== - dependencies: - json-stable-stringify-without-jsonify "^1.0.1" - through2-filter "^3.0.0" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -v8flags@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656" - integrity sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg== - dependencies: - homedir-polyfill "^1.0.1" - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -value-or-function@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" - integrity sha512-jdBB2FrWvQC/pnPtIqcLsMaQgjhdb6B7tk1MMyTKapox+tQZbdRP4uLxu/JY0t7fbfDCUMnuelzEYv5GsxHhdg== - -vinyl-fs@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" - integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== - dependencies: - fs-mkdirp-stream "^1.0.0" - glob-stream "^6.1.0" - graceful-fs "^4.0.0" - is-valid-glob "^1.0.0" - lazystream "^1.0.0" - lead "^1.0.0" - object.assign "^4.0.4" - pumpify "^1.3.5" - readable-stream "^2.3.3" - remove-bom-buffer "^3.0.0" - remove-bom-stream "^1.2.0" - resolve-options "^1.1.0" - through2 "^2.0.0" - to-through "^2.0.0" - value-or-function "^3.0.0" - vinyl "^2.0.0" - vinyl-sourcemap "^1.1.0" - -vinyl-sourcemap@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" - integrity sha512-NiibMgt6VJGJmyw7vtzhctDcfKch4e4n9TBeoWlirb7FMg9/1Ov9k+A5ZRAtywBpRPiyECvQRQllYM8dECegVA== - dependencies: - append-buffer "^1.0.2" - convert-source-map "^1.5.0" - graceful-fs "^4.1.6" - normalize-path "^2.1.1" - now-and-later "^2.0.0" - remove-bom-buffer "^3.0.0" - vinyl "^2.0.0" - -vinyl-sourcemaps-apply@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz#ab6549d61d172c2b1b87be5c508d239c8ef87705" - integrity sha512-+oDh3KYZBoZC8hfocrbrxbLUeaYtQK7J5WU5Br9VqWqmCll3tFJqKp97GC9GmMsVIL0qnx2DgEDVxdo5EZ5sSw== - dependencies: - source-map "^0.5.1" - -vinyl@2.x, vinyl@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974" - integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw== - dependencies: - clone "^2.1.1" - clone-buffer "^1.0.0" - clone-stats "^1.0.0" - cloneable-readable "^1.0.0" - remove-trailing-separator "^1.0.1" - replace-ext "^1.0.0" - -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - integrity sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ== - -which@^1.2.14: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw== - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -xtend@~4.0.0, xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^3.2.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" - integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-parser@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.1.tgz#7ede329c1d8cdbbe209bd25cdb990e9b1ebbb394" - integrity sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA== - dependencies: - camelcase "^3.0.0" - object.assign "^4.1.0" - -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yargs@^7.1.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.2.tgz#63a0a5d42143879fdbb30370741374e0641d55db" - integrity sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA== - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - y18n "^3.2.1" - yargs-parser "^5.0.1" + "integrity" "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "resolved" "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" + "version" "5.7.1" + +"set-blocking@^2.0.0": + "integrity" "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + "resolved" "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + "version" "2.0.0" + +"set-value@^2.0.0", "set-value@^2.0.1": + "integrity" "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==" + "resolved" "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "extend-shallow" "^2.0.1" + "is-extendable" "^0.1.1" + "is-plain-object" "^2.0.3" + "split-string" "^3.0.1" + +"snapdragon-node@^2.0.1": + "integrity" "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==" + "resolved" "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz" + "version" "2.1.1" + dependencies: + "define-property" "^1.0.0" + "isobject" "^3.0.0" + "snapdragon-util" "^3.0.1" + +"snapdragon-util@^3.0.1": + "integrity" "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==" + "resolved" "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz" + "version" "3.0.1" + dependencies: + "kind-of" "^3.2.0" + +"snapdragon@^0.8.1": + "integrity" "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==" + "resolved" "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz" + "version" "0.8.2" + dependencies: + "base" "^0.11.1" + "debug" "^2.2.0" + "define-property" "^0.2.5" + "extend-shallow" "^2.0.1" + "map-cache" "^0.2.2" + "source-map" "^0.5.6" + "source-map-resolve" "^0.5.0" + "use" "^3.1.0" + +"source-map-resolve@^0.5.0": + "integrity" "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==" + "resolved" "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz" + "version" "0.5.3" + dependencies: + "atob" "^2.1.2" + "decode-uri-component" "^0.2.0" + "resolve-url" "^0.2.1" + "source-map-url" "^0.4.0" + "urix" "^0.1.0" + +"source-map-url@^0.4.0": + "integrity" "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==" + "resolved" "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz" + "version" "0.4.1" + +"source-map@^0.5.1", "source-map@^0.5.6": + "integrity" "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==" + "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" + "version" "0.5.7" + +"sparkles@^1.0.0": + "integrity" "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==" + "resolved" "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz" + "version" "1.0.1" + +"spdx-correct@^3.0.0": + "integrity" "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==" + "resolved" "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz" + "version" "3.1.1" + dependencies: + "spdx-expression-parse" "^3.0.0" + "spdx-license-ids" "^3.0.0" + +"spdx-exceptions@^2.1.0": + "integrity" "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + "resolved" "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" + "version" "2.3.0" + +"spdx-expression-parse@^3.0.0": + "integrity" "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==" + "resolved" "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" + "version" "3.0.1" + dependencies: + "spdx-exceptions" "^2.1.0" + "spdx-license-ids" "^3.0.0" + +"spdx-license-ids@^3.0.0": + "integrity" "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" + "resolved" "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz" + "version" "3.0.11" + +"split-string@^3.0.1", "split-string@^3.0.2": + "integrity" "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==" + "resolved" "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "extend-shallow" "^3.0.0" + +"stack-trace@0.0.10": + "integrity" "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==" + "resolved" "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz" + "version" "0.0.10" + +"static-extend@^0.1.1": + "integrity" "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==" + "resolved" "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz" + "version" "0.1.2" + dependencies: + "define-property" "^0.2.5" + "object-copy" "^0.1.0" + +"stream-exhaust@^1.0.1": + "integrity" "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==" + "resolved" "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz" + "version" "1.0.2" + +"stream-shift@^1.0.0": + "integrity" "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + "resolved" "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz" + "version" "1.0.1" + +"string_decoder@~1.1.1": + "integrity" "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==" + "resolved" "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + "version" "1.1.1" + dependencies: + "safe-buffer" "~5.1.0" + +"string-width@^1.0.1", "string-width@^1.0.2": + "integrity" "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==" + "resolved" "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "code-point-at" "^1.0.0" + "is-fullwidth-code-point" "^1.0.0" + "strip-ansi" "^3.0.0" + +"string-width@^4.1.0", "string-width@^4.2.0": + "integrity" "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==" + "resolved" "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + "version" "4.2.3" + dependencies: + "emoji-regex" "^8.0.0" + "is-fullwidth-code-point" "^3.0.0" + "strip-ansi" "^6.0.1" + +"strip-ansi@^3.0.0", "strip-ansi@^3.0.1": + "integrity" "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==" + "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "version" "3.0.1" + dependencies: + "ansi-regex" "^2.0.0" + +"strip-ansi@^6.0.0", "strip-ansi@^6.0.1": + "integrity" "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==" + "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + "version" "6.0.1" + dependencies: + "ansi-regex" "^5.0.1" + +"strip-bom@^2.0.0": + "integrity" "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==" + "resolved" "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "is-utf8" "^0.2.0" + +"supports-color@^5.3.0": + "integrity" "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==" + "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" + "version" "5.5.0" + dependencies: + "has-flag" "^3.0.0" + +"supports-preserve-symlinks-flag@^1.0.0": + "integrity" "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + "resolved" "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" + "version" "1.0.0" + +"sver-compat@^1.5.0": + "integrity" "sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg==" + "resolved" "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz" + "version" "1.5.0" + dependencies: + "es6-iterator" "^2.0.1" + "es6-symbol" "^3.1.1" + +"through2-filter@^3.0.0": + "integrity" "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==" + "resolved" "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "through2" "~2.0.0" + "xtend" "~4.0.0" + +"through2@^2.0.0", "through2@^2.0.3", "through2@~2.0.0": + "integrity" "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==" + "resolved" "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" + "version" "2.0.5" + dependencies: + "readable-stream" "~2.3.6" + "xtend" "~4.0.1" + +"time-stamp@^1.0.0": + "integrity" "sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==" + "resolved" "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz" + "version" "1.1.0" + +"to-absolute-glob@^2.0.0": + "integrity" "sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA==" + "resolved" "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "is-absolute" "^1.0.0" + "is-negated-glob" "^1.0.0" + +"to-object-path@^0.3.0": + "integrity" "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==" + "resolved" "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz" + "version" "0.3.0" + dependencies: + "kind-of" "^3.0.2" + +"to-regex-range@^2.1.0": + "integrity" "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==" + "resolved" "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz" + "version" "2.1.1" + dependencies: + "is-number" "^3.0.0" + "repeat-string" "^1.6.1" + +"to-regex@^3.0.1", "to-regex@^3.0.2": + "integrity" "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==" + "resolved" "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz" + "version" "3.0.2" + dependencies: + "define-property" "^2.0.2" + "extend-shallow" "^3.0.2" + "regex-not" "^1.0.2" + "safe-regex" "^1.1.0" + +"to-through@^2.0.0": + "integrity" "sha512-+QIz37Ly7acM4EMdw2PRN389OneM5+d844tirkGp4dPKzI5OE72V9OsbFp+CIYJDahZ41ZV05hNtcPAQUAm9/Q==" + "resolved" "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "through2" "^2.0.3" + +"type@^1.0.1": + "integrity" "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + "resolved" "https://registry.npmjs.org/type/-/type-1.2.0.tgz" + "version" "1.2.0" + +"type@^2.5.0": + "integrity" "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" + "resolved" "https://registry.npmjs.org/type/-/type-2.6.0.tgz" + "version" "2.6.0" + +"typedarray@^0.0.6": + "integrity" "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + "resolved" "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" + "version" "0.0.6" + +"unc-path-regex@^0.1.2": + "integrity" "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==" + "resolved" "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz" + "version" "0.1.2" + +"undertaker-registry@^1.0.0": + "integrity" "sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==" + "resolved" "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz" + "version" "1.0.1" + +"undertaker@^1.2.1": + "integrity" "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==" + "resolved" "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz" + "version" "1.3.0" + dependencies: + "arr-flatten" "^1.0.1" + "arr-map" "^2.0.0" + "bach" "^1.0.0" + "collection-map" "^1.0.0" + "es6-weak-map" "^2.0.1" + "fast-levenshtein" "^1.0.0" + "last-run" "^1.1.0" + "object.defaults" "^1.0.0" + "object.reduce" "^1.0.0" + "undertaker-registry" "^1.0.0" + +"union-value@^1.0.0": + "integrity" "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==" + "resolved" "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "arr-union" "^3.1.0" + "get-value" "^2.0.6" + "is-extendable" "^0.1.1" + "set-value" "^2.0.1" + +"unique-stream@^2.0.2": + "integrity" "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==" + "resolved" "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz" + "version" "2.3.1" + dependencies: + "json-stable-stringify-without-jsonify" "^1.0.1" + "through2-filter" "^3.0.0" + +"unset-value@^1.0.0": + "integrity" "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==" + "resolved" "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "has-value" "^0.3.1" + "isobject" "^3.0.0" + +"upath@^1.1.1": + "integrity" "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==" + "resolved" "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz" + "version" "1.2.0" + +"urix@^0.1.0": + "integrity" "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==" + "resolved" "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" + "version" "0.1.0" + +"use@^3.1.0": + "integrity" "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + "resolved" "https://registry.npmjs.org/use/-/use-3.1.1.tgz" + "version" "3.1.1" + +"util-deprecate@~1.0.1": + "integrity" "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "resolved" "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "version" "1.0.2" + +"v8flags@^3.2.0": + "integrity" "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==" + "resolved" "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz" + "version" "3.2.0" + dependencies: + "homedir-polyfill" "^1.0.1" + +"validate-npm-package-license@^3.0.1": + "integrity" "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==" + "resolved" "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" + "version" "3.0.4" + dependencies: + "spdx-correct" "^3.0.0" + "spdx-expression-parse" "^3.0.0" + +"value-or-function@^3.0.0": + "integrity" "sha512-jdBB2FrWvQC/pnPtIqcLsMaQgjhdb6B7tk1MMyTKapox+tQZbdRP4uLxu/JY0t7fbfDCUMnuelzEYv5GsxHhdg==" + "resolved" "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz" + "version" "3.0.0" + +"vinyl-fs@^3.0.0": + "integrity" "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==" + "resolved" "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz" + "version" "3.0.3" + dependencies: + "fs-mkdirp-stream" "^1.0.0" + "glob-stream" "^6.1.0" + "graceful-fs" "^4.0.0" + "is-valid-glob" "^1.0.0" + "lazystream" "^1.0.0" + "lead" "^1.0.0" + "object.assign" "^4.0.4" + "pumpify" "^1.3.5" + "readable-stream" "^2.3.3" + "remove-bom-buffer" "^3.0.0" + "remove-bom-stream" "^1.2.0" + "resolve-options" "^1.1.0" + "through2" "^2.0.0" + "to-through" "^2.0.0" + "value-or-function" "^3.0.0" + "vinyl" "^2.0.0" + "vinyl-sourcemap" "^1.1.0" + +"vinyl-sourcemap@^1.1.0": + "integrity" "sha512-NiibMgt6VJGJmyw7vtzhctDcfKch4e4n9TBeoWlirb7FMg9/1Ov9k+A5ZRAtywBpRPiyECvQRQllYM8dECegVA==" + "resolved" "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "append-buffer" "^1.0.2" + "convert-source-map" "^1.5.0" + "graceful-fs" "^4.1.6" + "normalize-path" "^2.1.1" + "now-and-later" "^2.0.0" + "remove-bom-buffer" "^3.0.0" + "vinyl" "^2.0.0" + +"vinyl-sourcemaps-apply@^0.2.0": + "integrity" "sha512-+oDh3KYZBoZC8hfocrbrxbLUeaYtQK7J5WU5Br9VqWqmCll3tFJqKp97GC9GmMsVIL0qnx2DgEDVxdo5EZ5sSw==" + "resolved" "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz" + "version" "0.2.1" + dependencies: + "source-map" "^0.5.1" + +"vinyl@^2.0.0", "vinyl@2.x": + "integrity" "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==" + "resolved" "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz" + "version" "2.2.1" + dependencies: + "clone" "^2.1.1" + "clone-buffer" "^1.0.0" + "clone-stats" "^1.0.0" + "cloneable-readable" "^1.0.0" + "remove-trailing-separator" "^1.0.1" + "replace-ext" "^1.0.0" + +"which-module@^1.0.0": + "integrity" "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==" + "resolved" "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz" + "version" "1.0.0" + +"which@^1.2.14": + "integrity" "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==" + "resolved" "https://registry.npmjs.org/which/-/which-1.3.1.tgz" + "version" "1.3.1" + dependencies: + "isexe" "^2.0.0" + +"wrap-ansi@^2.0.0": + "integrity" "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==" + "resolved" "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "string-width" "^1.0.1" + "strip-ansi" "^3.0.1" + +"wrap-ansi@^7.0.0": + "integrity" "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==" + "resolved" "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + "version" "7.0.0" + dependencies: + "ansi-styles" "^4.0.0" + "string-width" "^4.1.0" + "strip-ansi" "^6.0.0" + +"wrappy@1": + "integrity" "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "resolved" "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "version" "1.0.2" + +"xtend@~4.0.0", "xtend@~4.0.1": + "integrity" "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "resolved" "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" + "version" "4.0.2" + +"y18n@^3.2.1": + "integrity" "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" + "resolved" "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz" + "version" "3.2.2" + +"y18n@^5.0.5": + "integrity" "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + "resolved" "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" + "version" "5.0.8" + +"yargs-parser@^20.2.2": + "integrity" "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" + "resolved" "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + "version" "20.2.9" + +"yargs-parser@^5.0.1": + "integrity" "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==" + "resolved" "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz" + "version" "5.0.1" + dependencies: + "camelcase" "^3.0.0" + "object.assign" "^4.1.0" + +"yargs@^16.2.0": + "integrity" "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==" + "resolved" "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + "version" "16.2.0" + dependencies: + "cliui" "^7.0.2" + "escalade" "^3.1.1" + "get-caller-file" "^2.0.5" + "require-directory" "^2.1.1" + "string-width" "^4.2.0" + "y18n" "^5.0.5" + "yargs-parser" "^20.2.2" + +"yargs@^7.1.0": + "integrity" "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==" + "resolved" "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz" + "version" "7.1.2" + dependencies: + "camelcase" "^3.0.0" + "cliui" "^3.2.0" + "decamelize" "^1.1.1" + "get-caller-file" "^1.0.1" + "os-locale" "^1.4.0" + "read-pkg-up" "^1.0.1" + "require-directory" "^2.1.1" + "require-main-filename" "^1.0.1" + "set-blocking" "^2.0.0" + "string-width" "^1.0.2" + "which-module" "^1.0.0" + "y18n" "^3.2.1" + "yargs-parser" "^5.0.1" From b449db4f9bf7bff2f6f9e4d6808616347798ffb3 Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Tue, 4 Oct 2022 20:33:42 -0700 Subject: [PATCH 2/9] Revert formatting of load bearing comment Add a clang format guard to a particularly long, load bearing, comment we use to guide rewriting common js deps. --- binary/proto_test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binary/proto_test.js b/binary/proto_test.js index 80d4345..ed49090 100644 --- a/binary/proto_test.js +++ b/binary/proto_test.js @@ -88,8 +88,8 @@ goog.require('proto.jspb.test.extendRepeatedStringList'); goog.require('proto.jspb.test.extendRepeatedUint32List'); goog.require('proto.jspb.test.extendRepeatedUint64List'); -// CommonJS-LoadFromFile: ../node_modules/google-protobuf/google/protobuf/any_pb -// proto.google.protobuf +// clang-format off +// CommonJS-LoadFromFile: ../node_modules/google-protobuf/google/protobuf/any_pb proto.google.protobuf goog.require('proto.google.protobuf.Any'); From cf834e5eb1fe54f2bd8c534c19281c9b064e7075 Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Tue, 4 Oct 2022 21:09:55 -0700 Subject: [PATCH 3/9] Fix up commonjs import tests These were revealed to be broken by the clean test build environment. Need to remove more closure asserts. --- commonjs/import_test.js | 13 +++++-------- commonjs/strict_test.js | 28 ++++++++++++---------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/commonjs/import_test.js b/commonjs/import_test.js index ffa34fe..ef06d50 100644 --- a/commonjs/import_test.js +++ b/commonjs/import_test.js @@ -32,12 +32,9 @@ -var googleProtobuf = require('google-protobuf'); -var asserts = require('closure_asserts_commonjs'); -var global = Function('return this')(); +const googleProtobuf = require('google-protobuf'); +const global = Function('return this')(); -// Bring asserts into the global namespace. -googleProtobuf.object.extend(global, asserts); googleProtobuf.exportSymbol('jspb.Message', googleProtobuf.Message, global); var test7_pb = require('./test7/test7_pb'); @@ -45,8 +42,8 @@ googleProtobuf.exportSymbol('proto.jspb.test.framing.FramingMessage', test7_pb.F describe('Import test suite', function() { it('testImportedMessage', function() { - var framing1 = new proto.jspb.test.framing.FramingMessage([]); - var framing2 = new proto.jspb.test.framing.FramingMessage([]); - assertObjectEquals(framing1.toObject(), framing2.toObject()); + const framing1 = new proto.jspb.test.framing.FramingMessage([]); + const framing2 = new proto.jspb.test.framing.FramingMessage([]); + expect(framing1.toObject()).toEqual(framing2.toObject()); }); }); diff --git a/commonjs/strict_test.js b/commonjs/strict_test.js index 58c8fce..6f429dc 100644 --- a/commonjs/strict_test.js +++ b/commonjs/strict_test.js @@ -32,36 +32,32 @@ -var googleProtobuf = require('google-protobuf'); -var asserts = require('closure_asserts_commonjs'); -var global = Function('return this')(); +const googleProtobuf = require('google-protobuf'); +const global = Function('return this')(); -// Bring asserts into the global namespace. -googleProtobuf.object.extend(global, asserts); - -var test9_pb = require('./protos/test9_pb'); -var test10_pb = require('./protos/test10_pb'); +const test9_pb = require('./protos/test9_pb'); +const test10_pb = require('./protos/test10_pb'); describe('Strict test suite', function() { it('testImportedMessage', function() { - var simple1 = new test9_pb.jspb.exttest.strict.nine.Simple9() - var simple2 = new test9_pb.jspb.exttest.strict.nine.Simple9() - assertObjectEquals(simple1.toObject(), simple2.toObject()); + const simple1 = new test9_pb.jspb.exttest.strict.nine.Simple9() + const simple2 = new test9_pb.jspb.exttest.strict.nine.Simple9() + expect(simple1.toObject()).toEqual(simple2.toObject()); }); it('testGlobalScopePollution', function() { - assertObjectEquals(global.jspb.exttest, undefined); + expect(global.jspb.exttest).toBeUndefined(); }); describe('with imports', function() { it('testImportedMessage', function() { - var simple1 = new test10_pb.jspb.exttest.strict.ten.Simple10() - var simple2 = new test10_pb.jspb.exttest.strict.ten.Simple10() - assertObjectEquals(simple1.toObject(), simple2.toObject()); + const simple1 = new test10_pb.jspb.exttest.strict.ten.Simple10() + const simple2 = new test10_pb.jspb.exttest.strict.ten.Simple10() + expect(simple1.toObject()).toEqual(simple2.toObject()); }); it('testGlobalScopePollution', function() { - assertObjectEquals(global.jspb.exttest, undefined); + expect(global.jspb.exttest).toBeUndefined(); }); }); }); From b4da468e2bb608a52cca0b5988c392ca27989e20 Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Tue, 4 Oct 2022 21:30:29 -0700 Subject: [PATCH 4/9] re-export closure's COMPILED global Despite the comments, we do in fact rely on closure's COMPILED global in CommonJS tests. This variable signals some tests to skip checking data that has likely been optimized away and is used by things like debug_test.js that do name checking. Previously, this was exported by the (now dead) closure testing asserts export for CommonJS. It has now been re-homed to the testdeps. --- commonjs/export_testdeps.js | 6 ++++++ commonjs/rewrite_tests_for_commonjs.js | 1 + 2 files changed, 7 insertions(+) diff --git a/commonjs/export_testdeps.js b/commonjs/export_testdeps.js index bb48627..18f72ce 100644 --- a/commonjs/export_testdeps.js +++ b/commonjs/export_testdeps.js @@ -13,3 +13,9 @@ goog.require('goog.crypt.base64'); goog.require('goog.testing.PropertyReplacer'); exports.goog = goog; + +// The COMPILED variable is set by Closure compiler to "true" when it compiles +// JavaScript, so in practice this is equivalent to "exports.COMPILED = true". +// This will disable some debugging functionality in debug.js, such as +// attempting to check names that have been optimized away. +exports.COMPILED = COMPILED diff --git a/commonjs/rewrite_tests_for_commonjs.js b/commonjs/rewrite_tests_for_commonjs.js index a2b60da..53bc0bc 100644 --- a/commonjs/rewrite_tests_for_commonjs.js +++ b/commonjs/rewrite_tests_for_commonjs.js @@ -66,6 +66,7 @@ var pkg = null; console.log("var global = Function('return this')();"); console.log("var googleProtobuf = require('google-protobuf');"); console.log("var testdeps = require('testdeps_commonjs');"); +console.log("global.COMPILED = testdeps.COMPILED;"); console.log("global.goog = testdeps.goog;"); console.log("global.jspb = googleProtobuf;"); console.log(""); From 58b85335cc67055b10b6b0d3bee2f809f403462a Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Wed, 5 Oct 2022 16:58:48 -0700 Subject: [PATCH 5/9] Remove "jspb" prefix from assert function names The jspb.asserts namespace should be sufficient to prevent closure from pruning the asserts, so remove the redundant prefix from the function names. --- asserts.js | 104 ++++++++++----------------------------------- binary/decoder.js | 34 +++++++-------- binary/encoder.js | 88 +++++++++++++++++++------------------- binary/reader.js | 102 ++++++++++++++++++++++---------------------- binary/utils.js | 10 ++--- binary/writer.js | 48 ++++++++++----------- commonjs/export.js | 2 +- debug.js | 8 ++-- map.js | 8 ++-- message.js | 38 ++++++++--------- message_test.js | 3 +- 11 files changed, 193 insertions(+), 252 deletions(-) diff --git a/asserts.js b/asserts.js index 5a5e7fb..2d70da5 100644 --- a/asserts.js +++ b/asserts.js @@ -11,50 +11,6 @@ goog.provide('jspb.asserts'); -/** - * Error object for failed assertions. - * - * @extends {Error} - * @final - */ - -class JspbAssertionError extends Error { - /** - * @param {string} messagePattern The pattern that was used to form message. - * @param {!Array<*>} messageArgs The items to substitute into the pattern. - */ - constructor(messagePattern, messageArgs) { - super(subs(messagePattern, messageArgs)); - - /** - * The message pattern used to format the error message. Error handlers can - * use this to uniquely identify the assertion. - * @type {string} - */ - this.messagePattern = messagePattern; - } -} - -jspb.asserts.JspbAssertionError = JspbAssertionError; - -/** - * The default error handler. - * @param {!JspbAssertionError} e The exception to be handled. - * @return {void} - */ -jspb.asserts.JSPB_DEFAULT_ERROR_HANDLER = function(e) { - throw e; -} - - - -/** - * The handler responsible for throwing or logging assertion errors. - * @type {function(!JspbAssertionError)} - */ -let errorHandler_ = jspb.asserts.JSPB_DEFAULT_ERROR_HANDLER; - - /** * Does simple python-style string substitution. * subs("foo%s hot%s", "bar", "dog") becomes "foobar hotdog". @@ -85,7 +41,7 @@ function subs(pattern, subs) { * @param {?Array<*>} defaultArgs The substitution arguments for defaultMessage. * @param {string|undefined} givenMessage Message supplied by the caller. * @param {!Array<*>} givenArgs The substitution arguments for givenMessage. - * @throws {JspbAssertionError} When the value is not a number. + * @throws {Error} When the value is not a number. */ function doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) { let message = 'Assertion failed'; @@ -101,36 +57,22 @@ function doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) { // a stack trace is added to var message above. With this, a stack trace is // not added until this line (it causes the extra garbage to be added after // the assertion message instead of in the middle of it). - const e = new JspbAssertionError('' + message, args || []); - errorHandler_(e); + throw new Error('' + message, args || []); } -/** - * Sets a custom error handler that can be used to customize the behavior of - * assertion failures, for example by turning all assertion failures into log - * messages. - * @param {function(!JspbAssertionError)} errorHandler - * @return {void} - */ -jspb.asserts.setJspbErrorHandler = function(errorHandler) { - errorHandler_ = errorHandler; -}; - - /** * Checks if the condition evaluates to true. * @template T * @param {T} condition The condition to check. * @param {string=} opt_message Error message in case of failure. - * @param {...*} var_args The items to substitute into the failure message. + * @param {...*} args The items to substitute into the failure message. * @return {T} The value of the condition. - * @throws {JspbAssertionError} When the condition evaluates to false. + * @throws {Error} When the condition evaluates to false. */ -jspb.asserts.jspbAssert = function(condition, opt_message, var_args) { +jspb.asserts.assert = function(condition, opt_message, ...args) { if (!condition) { - doAssertFailure( - '', null, opt_message, Array.prototype.slice.call(arguments, 2)); + doAssertFailure('', null, opt_message, args); } return condition; }; @@ -140,15 +82,15 @@ jspb.asserts.jspbAssert = function(condition, opt_message, var_args) { * Checks if the value is a string. * @param {*} value The value to check. * @param {string=} opt_message Error message in case of failure. - * @param {...*} var_args The items to substitute into the failure message. + * @param {...*} args The items to substitute into the failure message. * @return {string} The value, guaranteed to be a string when asserts enabled. - * @throws {JspbAssertionError} When the value is not a string. + * @throws {Error} When the value is not a string. */ -jspb.asserts.jspbAssertString = function(value, opt_message, var_args) { +jspb.asserts.assertString = function(value, opt_message, ...args) { if (typeof value !== 'string') { doAssertFailure( 'Expected string but got %s: %s.', [goog.typeOf(value), value], - opt_message, Array.prototype.slice.call(arguments, 2)); + opt_message, args); } return /** @type {string} */ (value); }; @@ -158,15 +100,15 @@ jspb.asserts.jspbAssertString = function(value, opt_message, var_args) { * Checks if the value is an Array. * @param {*} value The value to check. * @param {string=} opt_message Error message in case of failure. - * @param {...*} var_args The items to substitute into the failure message. + * @param {...*} args The items to substitute into the failure message. * @return {!Array} The value, guaranteed to be a non-null array. - * @throws {JspbAssertionError} When the value is not an array. + * @throws {Error} When the value is not an array. */ -jspb.asserts.jspbAssertArray = function(value, opt_message, var_args) { +jspb.asserts.assertArray = function(value, opt_message, ...args) { if (!Array.isArray(value)) { doAssertFailure( 'Expected array but got %s: %s.', [goog.typeOf(value), value], - opt_message, Array.prototype.slice.call(arguments, 2)); + opt_message, args); } return /** @type {!Array} */ (value); }; @@ -185,14 +127,14 @@ jspb.asserts.jspbAssertArray = function(value, opt_message, var_args) { * * * @param {string=} opt_message Error message in case of failure. - * @param {...*} var_args The items to substitute into the failure message. + * @param {...*} args The items to substitute into the failure message. * @return {void} - * @throws {JspbAssertionError} Failure. + * @throws {Error} Failure. */ -jspb.asserts.jspbFail = function(opt_message, var_args) { - errorHandler_(new JspbAssertionError( +jspb.asserts.fail = function(opt_message, ...args) { + throw new Error( 'Failure' + (opt_message ? ': ' + opt_message : ''), - Array.prototype.slice.call(arguments, 1))); + args); }; /** @@ -205,17 +147,17 @@ jspb.asserts.jspbFail = function(opt_message, var_args) { * @param {?} value The value to check. * @param {function(new: T, ...)} type A user-defined constructor. * @param {string=} opt_message Error message in case of failure. - * @param {...*} var_args The items to substitute into the failure message. - * @throws {JspbAssertionError} When the value is not an instance of + * @param {...*} args The items to substitute into the failure message. + * @throws {Error} When the value is not an instance of * type. * @return {T} * @template T */ -jspb.asserts.jspbAssertInstanceof = function(value, type, opt_message, var_args) { +jspb.asserts.assertInstanceof = function(value, type, opt_message, ...args) { if (!(value instanceof type)) { doAssertFailure( 'Expected instanceof %s but got %s.', [getType(type), getType(value)], - opt_message, Array.prototype.slice.call(arguments, 3)); + opt_message, args); } return value; }; diff --git a/binary/decoder.js b/binary/decoder.js index 5c802d2..eaa0082 100644 --- a/binary/decoder.js +++ b/binary/decoder.js @@ -235,7 +235,7 @@ jspb.BinaryDecoder.prototype.setCursor = function(cursor) { */ jspb.BinaryDecoder.prototype.advance = function(count) { this.cursor_ += count; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); }; @@ -316,7 +316,7 @@ jspb.BinaryDecoder.prototype.readSplitVarint64 = function(convert) { } // If we did not see the terminator, the encoding was invalid. - jspb.asserts.jspbFail('Failed to read varint, encoding is invalid.'); + jspb.asserts.fail('Failed to read varint, encoding is invalid.'); this.error_ = true; }; @@ -422,7 +422,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { var x = (temp & 0x7F); if (temp < 128) { this.cursor_ += 1; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return x; } @@ -430,7 +430,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { x |= (temp & 0x7F) << 7; if (temp < 128) { this.cursor_ += 2; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return x; } @@ -438,7 +438,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { x |= (temp & 0x7F) << 14; if (temp < 128) { this.cursor_ += 3; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return x; } @@ -446,7 +446,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { x |= (temp & 0x7F) << 21; if (temp < 128) { this.cursor_ += 4; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return x; } @@ -456,7 +456,7 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { // We're reading the high bits of an unsigned varint. The byte we just read // also contains bits 33 through 35, which we're going to discard. this.cursor_ += 5; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return x >>> 0; } @@ -467,10 +467,10 @@ jspb.BinaryDecoder.prototype.readUnsignedVarint32 = function() { bytes[this.cursor_++] >= 128 && bytes[this.cursor_++] >= 128 && bytes[this.cursor_++] >= 128) { // If we get here, the varint is too long. - jspb.asserts.jspbAssert(false); + jspb.asserts.assert(false); } - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return x; }; @@ -638,7 +638,7 @@ jspb.BinaryDecoder.prototype.readZigzagVarint64String = function() { jspb.BinaryDecoder.prototype.readUint8 = function() { var a = this.bytes_[this.cursor_ + 0]; this.cursor_ += 1; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return a; }; @@ -652,7 +652,7 @@ jspb.BinaryDecoder.prototype.readUint16 = function() { var a = this.bytes_[this.cursor_ + 0]; var b = this.bytes_[this.cursor_ + 1]; this.cursor_ += 2; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return (a << 0) | (b << 8); }; @@ -668,7 +668,7 @@ jspb.BinaryDecoder.prototype.readUint32 = function() { var c = this.bytes_[this.cursor_ + 2]; var d = this.bytes_[this.cursor_ + 3]; this.cursor_ += 4; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return ((a << 0) | (b << 8) | (c << 16) | (d << 24)) >>> 0; }; @@ -710,7 +710,7 @@ jspb.BinaryDecoder.prototype.readUint64String = function() { jspb.BinaryDecoder.prototype.readInt8 = function() { var a = this.bytes_[this.cursor_ + 0]; this.cursor_ += 1; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return (a << 24) >> 24; }; @@ -724,7 +724,7 @@ jspb.BinaryDecoder.prototype.readInt16 = function() { var a = this.bytes_[this.cursor_ + 0]; var b = this.bytes_[this.cursor_ + 1]; this.cursor_ += 2; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return (((a << 0) | (b << 8)) << 16) >> 16; }; @@ -740,7 +740,7 @@ jspb.BinaryDecoder.prototype.readInt32 = function() { var c = this.bytes_[this.cursor_ + 2]; var d = this.bytes_[this.cursor_ + 3]; this.cursor_ += 4; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return (a << 0) | (b << 8) | (c << 16) | (d << 24); }; @@ -902,14 +902,14 @@ jspb.BinaryDecoder.prototype.readStringWithLength = function() { jspb.BinaryDecoder.prototype.readBytes = function(length) { if (length < 0 || this.cursor_ + length > this.bytes_.length) { this.error_ = true; - jspb.asserts.jspbFail('Invalid byte length!'); + jspb.asserts.fail('Invalid byte length!'); return new Uint8Array(0); } var result = this.bytes_.subarray(this.cursor_, this.cursor_ + length); this.cursor_ += length; - jspb.asserts.jspbAssert(this.cursor_ <= this.end_); + jspb.asserts.assert(this.cursor_ <= this.end_); return result; }; diff --git a/binary/encoder.js b/binary/encoder.js index 7822db2..6a47e24 100644 --- a/binary/encoder.js +++ b/binary/encoder.js @@ -81,11 +81,11 @@ jspb.BinaryEncoder.prototype.end = function() { * @param {number} highBits The high 32 bits of the int. */ jspb.BinaryEncoder.prototype.writeSplitVarint64 = function(lowBits, highBits) { - jspb.asserts.jspbAssert(lowBits == Math.floor(lowBits)); - jspb.asserts.jspbAssert(highBits == Math.floor(highBits)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(lowBits == Math.floor(lowBits)); + jspb.asserts.assert(highBits == Math.floor(highBits)); + jspb.asserts.assert( (lowBits >= 0) && (lowBits < jspb.BinaryConstants.TWO_TO_32)); - jspb.asserts.jspbAssert( + jspb.asserts.assert( (highBits >= 0) && (highBits < jspb.BinaryConstants.TWO_TO_32)); // Break the binary representation into chunks of 7 bits, set the 8th bit @@ -106,11 +106,11 @@ jspb.BinaryEncoder.prototype.writeSplitVarint64 = function(lowBits, highBits) { * @param {number} highBits The high 32 bits of the int. */ jspb.BinaryEncoder.prototype.writeSplitFixed64 = function(lowBits, highBits) { - jspb.asserts.jspbAssert(lowBits == Math.floor(lowBits)); - jspb.asserts.jspbAssert(highBits == Math.floor(highBits)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(lowBits == Math.floor(lowBits)); + jspb.asserts.assert(highBits == Math.floor(highBits)); + jspb.asserts.assert( (lowBits >= 0) && (lowBits < jspb.BinaryConstants.TWO_TO_32)); - jspb.asserts.jspbAssert( + jspb.asserts.assert( (highBits >= 0) && (highBits < jspb.BinaryConstants.TWO_TO_32)); this.writeUint32(lowBits); this.writeUint32(highBits); @@ -123,8 +123,8 @@ jspb.BinaryEncoder.prototype.writeSplitFixed64 = function(lowBits, highBits) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeUnsignedVarint32 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_32)); while (value > 127) { @@ -142,8 +142,8 @@ jspb.BinaryEncoder.prototype.writeUnsignedVarint32 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeSignedVarint32 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_31) && (value < jspb.BinaryConstants.TWO_TO_31)); @@ -172,8 +172,8 @@ jspb.BinaryEncoder.prototype.writeSignedVarint32 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeUnsignedVarint64 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_64)); jspb.utils.splitInt64(value); this.writeSplitVarint64(jspb.utils.split64Low, jspb.utils.split64High); @@ -187,8 +187,8 @@ jspb.BinaryEncoder.prototype.writeUnsignedVarint64 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeSignedVarint64 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_63) && (value < jspb.BinaryConstants.TWO_TO_63)); jspb.utils.splitInt64(value); @@ -202,8 +202,8 @@ jspb.BinaryEncoder.prototype.writeSignedVarint64 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeZigzagVarint32 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_31) && (value < jspb.BinaryConstants.TWO_TO_31)); this.writeUnsignedVarint32(((value << 1) ^ (value >> 31)) >>> 0); @@ -217,8 +217,8 @@ jspb.BinaryEncoder.prototype.writeZigzagVarint32 = function(value) { * @param {number} value The integer to convert. */ jspb.BinaryEncoder.prototype.writeZigzagVarint64 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_63) && (value < jspb.BinaryConstants.TWO_TO_63)); jspb.utils.splitZigzag64(value); @@ -258,8 +258,8 @@ jspb.BinaryEncoder.prototype.writeZigzagVarintHash64 = function(hash) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeUint8 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert((value >= 0) && (value < 256)); + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert((value >= 0) && (value < 256)); this.buffer_.push((value >>> 0) & 0xFF); }; @@ -270,8 +270,8 @@ jspb.BinaryEncoder.prototype.writeUint8 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeUint16 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert((value >= 0) && (value < 65536)); + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert((value >= 0) && (value < 65536)); this.buffer_.push((value >>> 0) & 0xFF); this.buffer_.push((value >>> 8) & 0xFF); }; @@ -283,8 +283,8 @@ jspb.BinaryEncoder.prototype.writeUint16 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeUint32 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_32)); this.buffer_.push((value >>> 0) & 0xFF); this.buffer_.push((value >>> 8) & 0xFF); @@ -299,8 +299,8 @@ jspb.BinaryEncoder.prototype.writeUint32 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeUint64 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_64)); jspb.utils.splitUint64(value); this.writeUint32(jspb.utils.split64Low); @@ -314,8 +314,8 @@ jspb.BinaryEncoder.prototype.writeUint64 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt8 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert((value >= -128) && (value < 128)); + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert((value >= -128) && (value < 128)); this.buffer_.push((value >>> 0) & 0xFF); }; @@ -326,8 +326,8 @@ jspb.BinaryEncoder.prototype.writeInt8 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt16 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert((value >= -32768) && (value < 32768)); + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert((value >= -32768) && (value < 32768)); this.buffer_.push((value >>> 0) & 0xFF); this.buffer_.push((value >>> 8) & 0xFF); }; @@ -339,8 +339,8 @@ jspb.BinaryEncoder.prototype.writeInt16 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt32 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_31) && (value < jspb.BinaryConstants.TWO_TO_31)); this.buffer_.push((value >>> 0) & 0xFF); @@ -356,8 +356,8 @@ jspb.BinaryEncoder.prototype.writeInt32 = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt64 = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_63) && (value < jspb.BinaryConstants.TWO_TO_63)); jspb.utils.splitInt64(value); @@ -371,8 +371,8 @@ jspb.BinaryEncoder.prototype.writeInt64 = function(value) { * @param {string} value The value to write. */ jspb.BinaryEncoder.prototype.writeInt64String = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (+value >= -jspb.BinaryConstants.TWO_TO_63) && (+value < jspb.BinaryConstants.TWO_TO_63)); jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(value)); @@ -386,7 +386,7 @@ jspb.BinaryEncoder.prototype.writeInt64String = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeFloat = function(value) { - jspb.asserts.jspbAssert( + jspb.asserts.assert( value === Infinity || value === -Infinity || isNaN(value) || ((value >= -jspb.BinaryConstants.FLOAT32_MAX) && (value <= jspb.BinaryConstants.FLOAT32_MAX))); @@ -401,7 +401,7 @@ jspb.BinaryEncoder.prototype.writeFloat = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeDouble = function(value) { - jspb.asserts.jspbAssert( + jspb.asserts.assert( value === Infinity || value === -Infinity || isNaN(value) || ((value >= -jspb.BinaryConstants.FLOAT64_MAX) && (value <= jspb.BinaryConstants.FLOAT64_MAX))); @@ -418,7 +418,7 @@ jspb.BinaryEncoder.prototype.writeDouble = function(value) { * @param {boolean|number} value The value to write. */ jspb.BinaryEncoder.prototype.writeBool = function(value) { - jspb.asserts.jspbAssert( + jspb.asserts.assert( typeof value === 'boolean' || typeof value === 'number'); this.buffer_.push(value ? 1 : 0); }; @@ -429,8 +429,8 @@ jspb.BinaryEncoder.prototype.writeBool = function(value) { * @param {number} value The value to write. */ jspb.BinaryEncoder.prototype.writeEnum = function(value) { - jspb.asserts.jspbAssert(value == Math.floor(value)); - jspb.asserts.jspbAssert( + jspb.asserts.assert(value == Math.floor(value)); + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_31) && (value < jspb.BinaryConstants.TWO_TO_31)); this.writeSignedVarint32(value); @@ -479,7 +479,7 @@ jspb.BinaryEncoder.prototype.writeString = function(value) { var oldLength = this.buffer_.length; // Protect against non-string values being silently ignored. - jspb.asserts.jspbAssertString(value); + jspb.asserts.assertString(value); for (var i = 0; i < value.length; i++) { var c = value.charCodeAt(i); diff --git a/binary/reader.js b/binary/reader.js index 69d57dc..f21b058 100644 --- a/binary/reader.js +++ b/binary/reader.js @@ -285,7 +285,7 @@ jspb.BinaryReader.prototype.nextField = function() { // If we hit an error decoding the previous field, stop now before we // try to decode anything else if (this.getError()) { - jspb.asserts.jspbFail('Decoder hit an error'); + jspb.asserts.fail('Decoder hit an error'); return false; } @@ -304,7 +304,7 @@ jspb.BinaryReader.prototype.nextField = function() { nextWireType != jspb.BinaryConstants.WireType.DELIMITED && nextWireType != jspb.BinaryConstants.WireType.START_GROUP && nextWireType != jspb.BinaryConstants.WireType.END_GROUP) { - jspb.asserts.jspbFail( + jspb.asserts.fail( 'Invalid wire type: %s (at position %s)', nextWireType, this.fieldCursor_); this.error_ = true; @@ -348,7 +348,7 @@ jspb.BinaryReader.prototype.skipMatchingFields = function() { */ jspb.BinaryReader.prototype.skipVarintField = function() { if (this.nextWireType_ != jspb.BinaryConstants.WireType.VARINT) { - jspb.asserts.jspbFail('Invalid wire type for skipVarintField'); + jspb.asserts.fail('Invalid wire type for skipVarintField'); this.skipField(); return; } @@ -362,7 +362,7 @@ jspb.BinaryReader.prototype.skipVarintField = function() { */ jspb.BinaryReader.prototype.skipDelimitedField = function() { if (this.nextWireType_ != jspb.BinaryConstants.WireType.DELIMITED) { - jspb.asserts.jspbFail('Invalid wire type for skipDelimitedField'); + jspb.asserts.fail('Invalid wire type for skipDelimitedField'); this.skipField(); return; } @@ -377,7 +377,7 @@ jspb.BinaryReader.prototype.skipDelimitedField = function() { */ jspb.BinaryReader.prototype.skipFixed32Field = function() { if (this.nextWireType_ != jspb.BinaryConstants.WireType.FIXED32) { - jspb.asserts.jspbFail('Invalid wire type for skipFixed32Field'); + jspb.asserts.fail('Invalid wire type for skipFixed32Field'); this.skipField(); return; } @@ -391,7 +391,7 @@ jspb.BinaryReader.prototype.skipFixed32Field = function() { */ jspb.BinaryReader.prototype.skipFixed64Field = function() { if (this.nextWireType_ != jspb.BinaryConstants.WireType.FIXED64) { - jspb.asserts.jspbFail('Invalid wire type for skipFixed64Field'); + jspb.asserts.fail('Invalid wire type for skipFixed64Field'); this.skipField(); return; } @@ -407,14 +407,14 @@ jspb.BinaryReader.prototype.skipGroup = function() { var previousField = this.nextField_; do { if (!this.nextField()) { - jspb.asserts.jspbFail('Unmatched start-group tag: stream EOF'); + jspb.asserts.fail('Unmatched start-group tag: stream EOF'); this.error_ = true; return; } if (this.nextWireType_ == jspb.BinaryConstants.WireType.END_GROUP) { // Group end: check that it matches top-of-stack. if (this.nextField_ != previousField) { - jspb.asserts.jspbFail('Unmatched end-group tag'); + jspb.asserts.fail('Unmatched end-group tag'); this.error_ = true; return; } @@ -447,7 +447,7 @@ jspb.BinaryReader.prototype.skipField = function() { this.skipGroup(); break; default: - jspb.asserts.jspbFail('Invalid wire encoding for field.'); + jspb.asserts.fail('Invalid wire encoding for field.'); } }; @@ -462,7 +462,7 @@ jspb.BinaryReader.prototype.registerReadCallback = function( if (this.readCallbacks_ === null) { this.readCallbacks_ = {}; } - jspb.asserts.jspbAssert(!this.readCallbacks_[callbackName]); + jspb.asserts.assert(!this.readCallbacks_[callbackName]); this.readCallbacks_[callbackName] = callback; }; @@ -473,9 +473,9 @@ jspb.BinaryReader.prototype.registerReadCallback = function( * @return {*} The value returned by the callback. */ jspb.BinaryReader.prototype.runReadCallback = function(callbackName) { - jspb.asserts.jspbAssert(this.readCallbacks_ !== null); + jspb.asserts.assert(this.readCallbacks_ !== null); var callback = this.readCallbacks_[callbackName]; - jspb.asserts.jspbAssert(callback); + jspb.asserts.assert(callback); return callback(this); }; @@ -508,9 +508,9 @@ jspb.BinaryReader.prototype.readAny = function(fieldType) { case fieldTypes.STRING: return this.readString(); case fieldTypes.GROUP: - jspb.asserts.jspbFail('Group field type not supported in readAny()'); + jspb.asserts.fail('Group field type not supported in readAny()'); case fieldTypes.MESSAGE: - jspb.asserts.jspbFail('Message field type not supported in readAny()'); + jspb.asserts.fail('Message field type not supported in readAny()'); case fieldTypes.BYTES: return this.readBytes(); case fieldTypes.UINT32: @@ -530,7 +530,7 @@ jspb.BinaryReader.prototype.readAny = function(fieldType) { case fieldTypes.VHASH64: return this.readVarintHash64(); default: - jspb.asserts.jspbFail('Invalid field type in readAny()'); + jspb.asserts.fail('Invalid field type in readAny()'); } return 0; }; @@ -546,7 +546,7 @@ jspb.BinaryReader.prototype.readAny = function(fieldType) { * @export */ jspb.BinaryReader.prototype.readMessage = function(message, reader) { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); // Save the current endpoint of the decoder and move it to the end of the @@ -577,17 +577,17 @@ jspb.BinaryReader.prototype.readMessage = function(message, reader) { */ jspb.BinaryReader.prototype.readGroup = function(field, message, reader) { // Ensure that the wire type is correct. - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.START_GROUP); // Ensure that the field number is correct. - jspb.asserts.jspbAssert(this.nextField_ == field); + jspb.asserts.assert(this.nextField_ == field); // Deserialize the message. The deserialization will stop at an END_GROUP tag. reader(message, this); if (!this.error_ && this.nextWireType_ != jspb.BinaryConstants.WireType.END_GROUP) { - jspb.asserts.jspbFail('Group submessage did not end with an END_GROUP tag'); + jspb.asserts.fail('Group submessage did not end with an END_GROUP tag'); this.error_ = true; } }; @@ -598,7 +598,7 @@ jspb.BinaryReader.prototype.readGroup = function(field, message, reader) { * @return {!jspb.BinaryDecoder} */ jspb.BinaryReader.prototype.getFieldDecoder = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); var length = this.decoder_.readUnsignedVarint32(); @@ -620,7 +620,7 @@ jspb.BinaryReader.prototype.getFieldDecoder = function() { * @export */ jspb.BinaryReader.prototype.readInt32 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint32(); }; @@ -636,7 +636,7 @@ jspb.BinaryReader.prototype.readInt32 = function() { * string. */ jspb.BinaryReader.prototype.readInt32String = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint32String(); }; @@ -650,7 +650,7 @@ jspb.BinaryReader.prototype.readInt32String = function() { * @export */ jspb.BinaryReader.prototype.readInt64 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint64(); }; @@ -666,7 +666,7 @@ jspb.BinaryReader.prototype.readInt64 = function() { * string. */ jspb.BinaryReader.prototype.readInt64String = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint64String(); }; @@ -680,7 +680,7 @@ jspb.BinaryReader.prototype.readInt64String = function() { * @export */ jspb.BinaryReader.prototype.readUint32 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readUnsignedVarint32(); }; @@ -696,7 +696,7 @@ jspb.BinaryReader.prototype.readUint32 = function() { * string. */ jspb.BinaryReader.prototype.readUint32String = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readUnsignedVarint32String(); }; @@ -710,7 +710,7 @@ jspb.BinaryReader.prototype.readUint32String = function() { * @export */ jspb.BinaryReader.prototype.readUint64 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readUnsignedVarint64(); }; @@ -726,7 +726,7 @@ jspb.BinaryReader.prototype.readUint64 = function() { * string. */ jspb.BinaryReader.prototype.readUint64String = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readUnsignedVarint64String(); }; @@ -741,7 +741,7 @@ jspb.BinaryReader.prototype.readUint64String = function() { * @export */ jspb.BinaryReader.prototype.readSint32 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readZigzagVarint32(); }; @@ -756,7 +756,7 @@ jspb.BinaryReader.prototype.readSint32 = function() { * @export */ jspb.BinaryReader.prototype.readSint64 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readZigzagVarint64(); }; @@ -771,7 +771,7 @@ jspb.BinaryReader.prototype.readSint64 = function() { * string. */ jspb.BinaryReader.prototype.readSint64String = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readZigzagVarint64String(); }; @@ -786,7 +786,7 @@ jspb.BinaryReader.prototype.readSint64String = function() { * @export */ jspb.BinaryReader.prototype.readFixed32 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32); return this.decoder_.readUint32(); }; @@ -801,7 +801,7 @@ jspb.BinaryReader.prototype.readFixed32 = function() { * @export */ jspb.BinaryReader.prototype.readFixed64 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readUint64(); }; @@ -818,7 +818,7 @@ jspb.BinaryReader.prototype.readFixed64 = function() { * string. */ jspb.BinaryReader.prototype.readFixed64String = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readUint64String(); }; @@ -833,7 +833,7 @@ jspb.BinaryReader.prototype.readFixed64String = function() { * @export */ jspb.BinaryReader.prototype.readSfixed32 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32); return this.decoder_.readInt32(); }; @@ -848,7 +848,7 @@ jspb.BinaryReader.prototype.readSfixed32 = function() { * string. */ jspb.BinaryReader.prototype.readSfixed32String = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32); return this.decoder_.readInt32().toString(); }; @@ -863,7 +863,7 @@ jspb.BinaryReader.prototype.readSfixed32String = function() { * @export */ jspb.BinaryReader.prototype.readSfixed64 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readInt64(); }; @@ -879,7 +879,7 @@ jspb.BinaryReader.prototype.readSfixed64 = function() { * @return {string} The value of the sfixed64 field as a decimal string. */ jspb.BinaryReader.prototype.readSfixed64String = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readInt64String(); }; @@ -893,7 +893,7 @@ jspb.BinaryReader.prototype.readSfixed64String = function() { * @export */ jspb.BinaryReader.prototype.readFloat = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32); return this.decoder_.readFloat(); }; @@ -907,7 +907,7 @@ jspb.BinaryReader.prototype.readFloat = function() { * @export */ jspb.BinaryReader.prototype.readDouble = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readDouble(); }; @@ -921,7 +921,7 @@ jspb.BinaryReader.prototype.readDouble = function() { * @export */ jspb.BinaryReader.prototype.readBool = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return !!this.decoder_.readUnsignedVarint32(); }; @@ -935,7 +935,7 @@ jspb.BinaryReader.prototype.readBool = function() { * @export */ jspb.BinaryReader.prototype.readEnum = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSignedVarint64(); }; @@ -949,7 +949,7 @@ jspb.BinaryReader.prototype.readEnum = function() { * @export */ jspb.BinaryReader.prototype.readString = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); var length = this.decoder_.readUnsignedVarint32(); return this.decoder_.readString(length); @@ -964,7 +964,7 @@ jspb.BinaryReader.prototype.readString = function() { * @export */ jspb.BinaryReader.prototype.readBytes = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); var length = this.decoder_.readUnsignedVarint32(); return this.decoder_.readBytes(length); @@ -979,7 +979,7 @@ jspb.BinaryReader.prototype.readBytes = function() { * @return {string} The hash value. */ jspb.BinaryReader.prototype.readVarintHash64 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readVarintHash64(); }; @@ -993,7 +993,7 @@ jspb.BinaryReader.prototype.readVarintHash64 = function() { * @return {string} The hash value. */ jspb.BinaryReader.prototype.readSintHash64 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readZigzagVarintHash64(); }; @@ -1010,7 +1010,7 @@ jspb.BinaryReader.prototype.readSintHash64 = function() { * @template T */ jspb.BinaryReader.prototype.readSplitVarint64 = function(convert) { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSplitVarint64(convert); }; @@ -1027,7 +1027,7 @@ jspb.BinaryReader.prototype.readSplitVarint64 = function(convert) { * @template T */ jspb.BinaryReader.prototype.readSplitZigzagVarint64 = function(convert) { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT); return this.decoder_.readSplitVarint64(function(lowBits, highBits) { return jspb.utils.fromZigzag64(lowBits, highBits, convert); @@ -1043,7 +1043,7 @@ jspb.BinaryReader.prototype.readSplitZigzagVarint64 = function(convert) { * @return {string} The hash value. */ jspb.BinaryReader.prototype.readFixedHash64 = function() { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readFixedHash64(); }; @@ -1060,7 +1060,7 @@ jspb.BinaryReader.prototype.readFixedHash64 = function() { * @template T */ jspb.BinaryReader.prototype.readSplitFixed64 = function(convert) { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64); return this.decoder_.readSplitFixed64(convert); }; @@ -1073,7 +1073,7 @@ jspb.BinaryReader.prototype.readSplitFixed64 = function(convert) { * @private */ jspb.BinaryReader.prototype.readPackedField_ = function(decodeMethod) { - jspb.asserts.jspbAssert( + jspb.asserts.assert( this.nextWireType_ == jspb.BinaryConstants.WireType.DELIMITED); var length = this.decoder_.readUnsignedVarint32(); var end = this.decoder_.getCursor() + length; diff --git a/binary/utils.js b/binary/utils.js index 5509d07..ed60fed 100644 --- a/binary/utils.js +++ b/binary/utils.js @@ -630,7 +630,7 @@ jspb.utils.hash64ArrayToDecimalStrings = function(hashes, signed) { * @return {string} */ jspb.utils.decimalStringToHash64 = function(dec) { - jspb.asserts.jspbAssert(dec.length > 0); + jspb.asserts.assert(dec.length > 0); // Check for minus sign. var minus = false; @@ -733,9 +733,9 @@ jspb.utils.hash64ToHexString = function(hash) { */ jspb.utils.hexStringToHash64 = function(hex) { hex = hex.toLowerCase(); - jspb.asserts.jspbAssert(hex.length == 18); - jspb.asserts.jspbAssert(hex[0] == '0'); - jspb.asserts.jspbAssert(hex[1] == 'x'); + jspb.asserts.assert(hex.length == 18); + jspb.asserts.assert(hex[0] == '0'); + jspb.asserts.assert(hex[1] == 'x'); var result = ''; for (var i = 0; i < 8; i++) { @@ -1066,6 +1066,6 @@ jspb.utils.byteSourceToUint8Array = function(data) { new Uint8Array(data.buffer, data.byteOffset, data.byteLength)); } - jspb.asserts.jspbFail('Type not convertible to Uint8Array.'); + jspb.asserts.fail('Type not convertible to Uint8Array.'); return /** @type {!Uint8Array} */ (new Uint8Array(0)); }; diff --git a/binary/writer.js b/binary/writer.js index b4d2407..4938aa4 100644 --- a/binary/writer.js +++ b/binary/writer.js @@ -151,7 +151,7 @@ jspb.BinaryWriter.prototype.beginDelimited_ = function(field) { jspb.BinaryWriter.prototype.endDelimited_ = function(bookmark) { var oldLength = bookmark.pop(); var messageLength = this.totalLength_ + this.encoder_.length() - oldLength; - jspb.asserts.jspbAssert(messageLength >= 0); + jspb.asserts.assert(messageLength >= 0); while (messageLength > 127) { bookmark.push((messageLength & 0x7f) | 0x80); @@ -208,7 +208,7 @@ jspb.BinaryWriter.prototype.reset = function() { * @export */ jspb.BinaryWriter.prototype.getResultBuffer = function() { - jspb.asserts.jspbAssert(this.bookmarks_.length == 0); + jspb.asserts.assert(this.bookmarks_.length == 0); var flat = new Uint8Array(this.totalLength_ + this.encoder_.length()); @@ -227,7 +227,7 @@ jspb.BinaryWriter.prototype.getResultBuffer = function() { offset += tail.length; // Post condition: `flattened` must have had every byte written. - jspb.asserts.jspbAssert(offset == flat.length); + jspb.asserts.assert(offset == flat.length); // Replace our block list with the flattened block, which lets GC reclaim // the temp blocks sooner. @@ -263,7 +263,7 @@ jspb.BinaryWriter.prototype.beginSubMessage = function(field) { * TODO(aappleby): Deprecated. Move callers to writeMessage(). */ jspb.BinaryWriter.prototype.endSubMessage = function() { - jspb.asserts.jspbAssert(this.bookmarks_.length >= 0); + jspb.asserts.assert(this.bookmarks_.length >= 0); this.endDelimited_(this.bookmarks_.pop()); }; @@ -277,7 +277,7 @@ jspb.BinaryWriter.prototype.endSubMessage = function() { * @private */ jspb.BinaryWriter.prototype.writeFieldHeader_ = function(field, wireType) { - jspb.asserts.jspbAssert(field >= 1 && field == Math.floor(field)); + jspb.asserts.assert(field >= 1 && field == Math.floor(field)); var x = field * 8 + wireType; this.encoder_.writeUnsignedVarint32(x); }; @@ -320,10 +320,10 @@ jspb.BinaryWriter.prototype.writeAny = function(fieldType, field, value) { this.writeString(field, /** @type {string} */ (value)); return; case fieldTypes.GROUP: - jspb.asserts.jspbFail('Group field type not supported in writeAny()'); + jspb.asserts.fail('Group field type not supported in writeAny()'); return; case fieldTypes.MESSAGE: - jspb.asserts.jspbFail('Message field type not supported in writeAny()'); + jspb.asserts.fail('Message field type not supported in writeAny()'); return; case fieldTypes.BYTES: this.writeBytes(field, /** @type {?Uint8Array} */ (value)); @@ -353,7 +353,7 @@ jspb.BinaryWriter.prototype.writeAny = function(fieldType, field, value) { this.writeVarintHash64(field, /** @type {string} */ (value)); return; default: - jspb.asserts.jspbFail('Invalid field type in writeAny()'); + jspb.asserts.fail('Invalid field type in writeAny()'); return; } }; @@ -473,7 +473,7 @@ jspb.BinaryWriter.prototype.writeZigzagVarintHash64_ = function(field, value) { */ jspb.BinaryWriter.prototype.writeInt32 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_31) && (value < jspb.BinaryConstants.TWO_TO_31)); this.writeSignedVarint32_(field, value); @@ -489,7 +489,7 @@ jspb.BinaryWriter.prototype.writeInt32 = function(field, value) { jspb.BinaryWriter.prototype.writeInt32String = function(field, value) { if (value == null) return; var intValue = /** {number} */ parseInt(value, 10); - jspb.asserts.jspbAssert( + jspb.asserts.assert( (intValue >= -jspb.BinaryConstants.TWO_TO_31) && (intValue < jspb.BinaryConstants.TWO_TO_31)); this.writeSignedVarint32_(field, intValue); @@ -505,7 +505,7 @@ jspb.BinaryWriter.prototype.writeInt32String = function(field, value) { */ jspb.BinaryWriter.prototype.writeInt64 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_63) && (value < jspb.BinaryConstants.TWO_TO_63)); this.writeSignedVarint64_(field, value); @@ -534,7 +534,7 @@ jspb.BinaryWriter.prototype.writeInt64String = function(field, value) { */ jspb.BinaryWriter.prototype.writeUint32 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_32)); this.writeUnsignedVarint32_(field, value); }; @@ -549,7 +549,7 @@ jspb.BinaryWriter.prototype.writeUint32 = function(field, value) { jspb.BinaryWriter.prototype.writeUint32String = function(field, value) { if (value == null) return; var intValue = /** {number} */ parseInt(value, 10); - jspb.asserts.jspbAssert( + jspb.asserts.assert( (intValue >= 0) && (intValue < jspb.BinaryConstants.TWO_TO_32)); this.writeUnsignedVarint32_(field, intValue); }; @@ -564,7 +564,7 @@ jspb.BinaryWriter.prototype.writeUint32String = function(field, value) { */ jspb.BinaryWriter.prototype.writeUint64 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_64)); this.writeUnsignedVarint64_(field, value); }; @@ -592,7 +592,7 @@ jspb.BinaryWriter.prototype.writeUint64String = function(field, value) { */ jspb.BinaryWriter.prototype.writeSint32 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_31) && (value < jspb.BinaryConstants.TWO_TO_31)); this.writeZigzagVarint32_(field, value); @@ -608,7 +608,7 @@ jspb.BinaryWriter.prototype.writeSint32 = function(field, value) { */ jspb.BinaryWriter.prototype.writeSint64 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_63) && (value < jspb.BinaryConstants.TWO_TO_63)); this.writeZigzagVarint64_(field, value); @@ -648,7 +648,7 @@ jspb.BinaryWriter.prototype.writeSint64String = function(field, value) { */ jspb.BinaryWriter.prototype.writeFixed32 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_32)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED32); this.encoder_.writeUint32(value); @@ -664,7 +664,7 @@ jspb.BinaryWriter.prototype.writeFixed32 = function(field, value) { */ jspb.BinaryWriter.prototype.writeFixed64 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= 0) && (value < jspb.BinaryConstants.TWO_TO_64)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED64); this.encoder_.writeUint64(value); @@ -693,7 +693,7 @@ jspb.BinaryWriter.prototype.writeFixed64String = function(field, value) { */ jspb.BinaryWriter.prototype.writeSfixed32 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_31) && (value < jspb.BinaryConstants.TWO_TO_31)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED32); @@ -710,7 +710,7 @@ jspb.BinaryWriter.prototype.writeSfixed32 = function(field, value) { */ jspb.BinaryWriter.prototype.writeSfixed64 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_63) && (value < jspb.BinaryConstants.TWO_TO_63)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED64); @@ -770,7 +770,7 @@ jspb.BinaryWriter.prototype.writeDouble = function(field, value) { */ jspb.BinaryWriter.prototype.writeBool = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( typeof value === 'boolean' || typeof value === 'number'); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.VARINT); this.encoder_.writeBool(value); @@ -785,7 +785,7 @@ jspb.BinaryWriter.prototype.writeBool = function(field, value) { */ jspb.BinaryWriter.prototype.writeEnum = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert( + jspb.asserts.assert( (value >= -jspb.BinaryConstants.TWO_TO_31) && (value < jspb.BinaryConstants.TWO_TO_31)); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.VARINT); @@ -917,7 +917,7 @@ jspb.BinaryWriter.prototype.writeGroup = function( */ jspb.BinaryWriter.prototype.writeFixedHash64 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert(value.length == 8); + jspb.asserts.assert(value.length == 8); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.FIXED64); this.encoder_.writeFixedHash64(value); }; @@ -931,7 +931,7 @@ jspb.BinaryWriter.prototype.writeFixedHash64 = function(field, value) { */ jspb.BinaryWriter.prototype.writeVarintHash64 = function(field, value) { if (value == null) return; - jspb.asserts.jspbAssert(value.length == 8); + jspb.asserts.assert(value.length == 8); this.writeFieldHeader_(field, jspb.BinaryConstants.WireType.VARINT); this.encoder_.writeVarintHash64(value); }; diff --git a/commonjs/export.js b/commonjs/export.js index 724a152..97de6a2 100644 --- a/commonjs/export.js +++ b/commonjs/export.js @@ -23,7 +23,7 @@ if (typeof exports === 'object') { exports['BinaryWriter'] = jspb.BinaryWriter; exports['ExtensionFieldInfo'] = jspb.ExtensionFieldInfo; exports['ExtensionFieldBinaryInfo'] = jspb.ExtensionFieldBinaryInfo; - exports['asserts'] = {'JspbAssertionError': jspb.asserts.JspbAssertionError}; + exports['asserts'] = jspb.asserts; // These are used by generated code but should not be used directly by clients. exports['exportSymbol'] = goog.exportSymbol; diff --git a/debug.js b/debug.js index 62a65ce..25fec76 100644 --- a/debug.js +++ b/debug.js @@ -56,11 +56,11 @@ jspb.debug.dump = function(message) { if (!goog.DEBUG) { return null; } - jspb.asserts.jspbAssert(message instanceof jspb.Message, + jspb.asserts.assert(message instanceof jspb.Message, 'jspb.Message instance expected'); /** @type {Object} */ var object = message; - jspb.asserts.jspbAssert(object['getExtension'], + jspb.asserts.assert(object['getExtension'], 'Only unobfuscated and unoptimized compilation modes supported.'); return /** @type {Object} */ (jspb.debug.dump_(message)); }; @@ -89,7 +89,7 @@ jspb.debug.dump_ = function(thing) { } if (type == 'array') { - jspb.asserts.jspbAssertArray(thing); + jspb.asserts.assertArray(thing); return goog.array.map(thing, jspb.debug.dump_); } @@ -102,7 +102,7 @@ jspb.debug.dump_ = function(thing) { return mapObject; } - jspb.asserts.jspbAssert(message instanceof jspb.Message, + jspb.asserts.assert(message instanceof jspb.Message, 'Only messages expected: ' + thing); var ctor = message.constructor; var messageName = ctor.name || ctor.displayName; diff --git a/map.js b/map.js index b485d32..7031cb3 100644 --- a/map.js +++ b/map.js @@ -157,7 +157,7 @@ jspb.Map.prototype.toObject = function(includeInstance, valueToObject) { this.wrapEntry_(entry); var valueWrapper = /** @type {V|undefined} */ (entry.valueWrapper); if (valueWrapper) { - jspb.asserts.jspbAssert(valueToObject); + jspb.asserts.assert(valueToObject); entries.push([entry.key, valueToObject(includeInstance, valueWrapper)]); } else { entries.push([entry.key, entry.value]); @@ -512,7 +512,7 @@ jspb.Map.deserializeBinary = function(map, reader, keyReaderFn, valueReaderFn, } else if (field == 2) { // Value. if (map.valueCtor_) { - jspb.asserts.jspbAssert(opt_valueReaderCallback); + jspb.asserts.assert(opt_valueReaderCallback); if (!value) { // Old generator still doesn't provide default value message. // Need this for backward compatibility. @@ -527,8 +527,8 @@ jspb.Map.deserializeBinary = function(map, reader, keyReaderFn, valueReaderFn, } } - jspb.asserts.jspbAssert(key != undefined); - jspb.asserts.jspbAssert(value != undefined); + jspb.asserts.assert(key != undefined); + jspb.asserts.assert(value != undefined); map.set(key, value); }; diff --git a/message.js b/message.js index 47c2b8c..02e92a1 100644 --- a/message.js +++ b/message.js @@ -802,7 +802,7 @@ jspb.Message.bytesAsB64 = function(value) { if (jspb.Message.SUPPORTS_UINT8ARRAY_ && value instanceof Uint8Array) { return goog.crypt.base64.encodeByteArray(value); } - jspb.asserts.jspbFail('Cannot coerce to b64 string: ' + goog.typeOf(value)); + jspb.asserts.fail('Cannot coerce to b64 string: ' + goog.typeOf(value)); return null; }; @@ -822,7 +822,7 @@ jspb.Message.bytesAsU8 = function(value) { if (typeof value === 'string') { return goog.crypt.base64.decodeStringToUint8Array(value); } - jspb.asserts.jspbFail('Cannot coerce to Uint8Array: ' + goog.typeOf(value)); + jspb.asserts.fail('Cannot coerce to Uint8Array: ' + goog.typeOf(value)); return null; }; @@ -871,7 +871,7 @@ jspb.Message.assertConsistentTypes_ = function(array) { var expected = goog.typeOf(array[0]); goog.array.forEach(array, function(e) { if (goog.typeOf(e) != expected) { - jspb.asserts.jspbFail( + jspb.asserts.fail( 'Inconsistent type in JSPB repeated field array. ' + 'Got ' + goog.typeOf(e) + ' expected ' + expected); } @@ -1006,7 +1006,7 @@ jspb.Message.getMapField = function( */ jspb.Message.setField = function(msg, fieldNumber, value) { // TODO(b/35241823): replace this with a bounded generic when available - jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); + jspb.asserts.assertInstanceof(msg, jspb.Message); if (fieldNumber < msg.pivot_) { msg.array[jspb.Message.getIndex_(msg, fieldNumber)] = value; } else { @@ -1130,7 +1130,7 @@ jspb.Message.setProto3StringIntField = function(msg, fieldNumber, value) { jspb.Message.setFieldIgnoringDefault_ = function( msg, fieldNumber, value, defaultValue) { // TODO(b/35241823): replace this with a bounded generic when available - jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); + jspb.asserts.assertInstanceof(msg, jspb.Message); if (value !== defaultValue) { jspb.Message.setField(msg, fieldNumber, value); } else if (fieldNumber < msg.pivot_) { @@ -1155,7 +1155,7 @@ jspb.Message.setFieldIgnoringDefault_ = function( */ jspb.Message.addToRepeatedField = function(msg, fieldNumber, value, opt_index) { // TODO(b/35241823): replace this with a bounded generic when available - jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); + jspb.asserts.assertInstanceof(msg, jspb.Message); var arr = jspb.Message.getRepeatedField(msg, fieldNumber); if (opt_index != undefined) { arr.splice(opt_index, 0, value); @@ -1179,7 +1179,7 @@ jspb.Message.addToRepeatedField = function(msg, fieldNumber, value, opt_index) { */ jspb.Message.setOneofField = function(msg, fieldNumber, oneof, value) { // TODO(b/35241823): replace this with a bounded generic when available - jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); + jspb.asserts.assertInstanceof(msg, jspb.Message); var currentCase = jspb.Message.computeOneofCase(msg, oneof); if (currentCase && currentCase !== fieldNumber && value !== undefined) { if (msg.wrappers_ && currentCase in msg.wrappers_) { @@ -1311,7 +1311,7 @@ jspb.Message.wrapRepeatedField_ = function(msg, ctor, fieldNumber) { */ jspb.Message.setWrapperField = function(msg, fieldNumber, value) { // TODO(b/35241823): replace this with a bounded generic when available - jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); + jspb.asserts.assertInstanceof(msg, jspb.Message); if (!msg.wrappers_) { msg.wrappers_ = {}; } @@ -1334,7 +1334,7 @@ jspb.Message.setWrapperField = function(msg, fieldNumber, value) { */ jspb.Message.setOneofWrapperField = function(msg, fieldNumber, oneof, value) { // TODO(b/35241823): replace this with a bounded generic when available - jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); + jspb.asserts.assertInstanceof(msg, jspb.Message); if (!msg.wrappers_) { msg.wrappers_ = {}; } @@ -1355,7 +1355,7 @@ jspb.Message.setOneofWrapperField = function(msg, fieldNumber, oneof, value) { */ jspb.Message.setRepeatedWrapperField = function(msg, fieldNumber, value) { // TODO(b/35241823): replace this with a bounded generic when available - jspb.asserts.jspbAssertInstanceof(msg, jspb.Message); + jspb.asserts.assertInstanceof(msg, jspb.Message); if (!msg.wrappers_) { msg.wrappers_ = {}; } @@ -1727,15 +1727,15 @@ jspb.Message.compareFields = function(field1, field2) { var val2 = typedField2[i]; if (val1 && (val1.constructor == Object)) { - jspb.asserts.jspbAssert(extension1 === undefined); - jspb.asserts.jspbAssert(i === typedField1.length - 1); + jspb.asserts.assert(extension1 === undefined); + jspb.asserts.assert(i === typedField1.length - 1); extension1 = val1; val1 = undefined; } if (val2 && (val2.constructor == Object)) { - jspb.asserts.jspbAssert(extension2 === undefined); - jspb.asserts.jspbAssert(i === typedField2.length - 1); + jspb.asserts.assert(extension2 === undefined); + jspb.asserts.assert(i === typedField2.length - 1); extension2 = val2; val2 = undefined; } @@ -1826,9 +1826,9 @@ jspb.Message.cloneMessage = function(msg) { * @export */ jspb.Message.copyInto = function(fromMessage, toMessage) { - jspb.asserts.jspbAssertInstanceof(fromMessage, jspb.Message); - jspb.asserts.jspbAssertInstanceof(toMessage, jspb.Message); - jspb.asserts.jspbAssert( + jspb.asserts.assertInstanceof(fromMessage, jspb.Message); + jspb.asserts.assertInstanceof(toMessage, jspb.Message); + jspb.asserts.assert( fromMessage.constructor == toMessage.constructor, 'Copy source and target message should have the same type.'); @@ -1869,7 +1869,7 @@ jspb.Message.clone_ = function(obj) { // NOTE:redundant null check existing for NTI compatibility. // see b/70515949 clonedArray[i] = (typeof o == 'object') ? - jspb.Message.clone_(jspb.asserts.jspbAssert(o)) : + jspb.Message.clone_(jspb.asserts.assert(o)) : o; } } @@ -1885,7 +1885,7 @@ jspb.Message.clone_ = function(obj) { // NOTE:redundant null check existing for NTI compatibility. // see b/70515949 clone[key] = (typeof o == 'object') ? - jspb.Message.clone_(jspb.asserts.jspbAssert(o)) : + jspb.Message.clone_(jspb.asserts.assert(o)) : o; } } diff --git a/message_test.js b/message_test.js index a5bb0c9..b71f8b1 100644 --- a/message_test.js +++ b/message_test.js @@ -565,8 +565,7 @@ describe('Message test suite', function() { const b = new proto.jspb.test.Simple1(['str', ['s1', 's2']]); expect(() => {jspb.Message.copyInto(a, b)}) - .toThrowError( - jspb.asserts.JspbAssertionError, /should have the same type/); + .toThrowError(Error, /should have the same type/); }); it('testExtensions', function() { From bc27e85f447754a1b4ad5cb5aa7b2e38d30516de Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Wed, 5 Oct 2022 17:21:12 -0700 Subject: [PATCH 6/9] Misc style and export cleanups * swap assert(foo instanceof bar) to assertInstanceof * swap many anonymous functions in tests to arrow functions * drop asserts export to commonjs since they're not needed in tests anymore * remove remaining goog.testing.TestCase require --- binary/decoder_test.js | 56 ++++----- binary/message_test.js | 4 +- binary/reader_test.js | 250 ++++++++++++++++++++--------------------- binary/utils_test.js | 36 +++--- commonjs/export.js | 2 - debug.js | 4 +- maps_test.js | 17 ++- proto3_test.js | 22 ++-- 8 files changed, 194 insertions(+), 197 deletions(-) diff --git a/binary/decoder_test.js b/binary/decoder_test.js index e00ffe1..20766b2 100644 --- a/binary/decoder_test.js +++ b/binary/decoder_test.js @@ -84,10 +84,10 @@ function doTestUnsignedValue( } // Encoding values outside the valid range should assert. - expect(function() { + expect(() => { writeValue.call(encoder, -1); }).toThrow(); - expect(function() { + expect(() => { writeValue.call(encoder, upperLimit * 1.1); }).toThrow(); } @@ -155,11 +155,11 @@ function doTestSignedValue( } } -describe('binaryDecoderTest', function() { +describe('binaryDecoderTest', () => { /** * Tests the decoder instance cache. */ - it('testInstanceCache', /** @suppress {visibility} */ function() { + it('testInstanceCache', /** @suppress {visibility} */ () => { // Empty the instance caches. jspb.BinaryDecoder.instanceCache_ = []; @@ -183,7 +183,7 @@ describe('binaryDecoderTest', function() { }); - describe('varint64', function() { + describe('varint64', () => { let /** !jspb.BinaryEncoder */ encoder; let /** !jspb.BinaryDecoder */ decoder; @@ -195,7 +195,7 @@ describe('binaryDecoderTest', function() { String.fromCharCode(0x12, 0x34, 0x56, 0x78, 0x87, 0x65, 0x43, 0x21); const hashD = String.fromCharCode(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); - beforeEach(function() { + beforeEach(() => { encoder = new jspb.BinaryEncoder(); encoder.writeVarintHash64(hashA); @@ -211,7 +211,7 @@ describe('binaryDecoderTest', function() { decoder = jspb.BinaryDecoder.alloc(encoder.end()); }); - it('reads 64-bit integers as hash strings', function() { + it('reads 64-bit integers as hash strings', () => { expect(hashA).toEqual(decoder.readVarintHash64()); expect(hashB).toEqual(decoder.readVarintHash64()); expect(hashC).toEqual(decoder.readVarintHash64()); @@ -223,7 +223,7 @@ describe('binaryDecoderTest', function() { expect(hashD).toEqual(decoder.readFixedHash64()); }); - it('reads split 64 bit integers', function() { + it('reads split 64 bit integers', () => { function hexJoin(bitsLow, bitsHigh) { return `0x${(bitsHigh >>> 0).toString(16)}:0x${ (bitsLow >>> 0).toString(16)}`; @@ -245,7 +245,7 @@ describe('binaryDecoderTest', function() { }); }); - describe('sint64', function() { + describe('sint64', () => { let /** !jspb.BinaryDecoder */ decoder; const hashA = @@ -256,7 +256,7 @@ describe('binaryDecoderTest', function() { String.fromCharCode(0x12, 0x34, 0x56, 0x78, 0x87, 0x65, 0x43, 0x21); const hashD = String.fromCharCode(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); - beforeEach(function() { + beforeEach(() => { const encoder = new jspb.BinaryEncoder(); encoder.writeZigzagVarintHash64(hashA); @@ -267,7 +267,7 @@ describe('binaryDecoderTest', function() { decoder = jspb.BinaryDecoder.alloc(encoder.end()); }); - it('reads 64-bit integers as decimal strings', function() { + it('reads 64-bit integers as decimal strings', () => { const signed = true; expect(decoder.readZigzagVarint64String()) .toEqual(jspb.utils.hash64ToDecimalString(hashA, signed)); @@ -279,14 +279,14 @@ describe('binaryDecoderTest', function() { .toEqual(jspb.utils.hash64ToDecimalString(hashD, signed)); }); - it('reads 64-bit integers as hash strings', function() { + it('reads 64-bit integers as hash strings', () => { expect(decoder.readZigzagVarintHash64()).toEqual(hashA); expect(decoder.readZigzagVarintHash64()).toEqual(hashB); expect(decoder.readZigzagVarintHash64()).toEqual(hashC); expect(decoder.readZigzagVarintHash64()).toEqual(hashD); }); - it('reads split 64 bit zigzag integers', function() { + it('reads split 64 bit zigzag integers', () => { function hexJoin(bitsLow, bitsHigh) { return `0x${(bitsHigh >>> 0).toString(16)}:0x${ (bitsLow >>> 0).toString(16)}`; @@ -306,7 +306,7 @@ describe('binaryDecoderTest', function() { .toEqual(hexJoinHash(hashD)); }); - it('does zigzag encoding properly', function() { + it('does zigzag encoding properly', () => { // Test cases directly from the protobuf dev guide. // https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types const testCases = [ @@ -340,7 +340,7 @@ describe('binaryDecoderTest', function() { /** * Tests reading and writing large strings */ - it('testLargeStrings', function() { + it('testLargeStrings', () => { const encoder = new jspb.BinaryEncoder(); const len = 150000; @@ -359,7 +359,7 @@ describe('binaryDecoderTest', function() { /** * Test encoding and decoding utf-8. */ - it('testUtf8', function() { + it('testUtf8', () => { const encoder = new jspb.BinaryEncoder(); const ascii = 'ASCII should work in 3, 2, 1...'; @@ -384,13 +384,13 @@ describe('binaryDecoderTest', function() { /** * Verifies that passing a non-string to writeString raises an error. */ - it('testBadString', function() { + it('testBadString', () => { const encoder = new jspb.BinaryEncoder(); - expect(function() { + expect(() => { encoder.writeString(42) }).toThrow(); - expect(function() { + expect(() => { encoder.writeString(null) }).toThrow(); }); @@ -398,29 +398,29 @@ describe('binaryDecoderTest', function() { /** * Verifies that misuse of the decoder class triggers assertions. */ - it('testDecodeErrors', function() { + it('testDecodeErrors', () => { // Reading a value past the end of the stream should trigger an assertion. const decoder = jspb.BinaryDecoder.alloc([0, 1, 2]); - expect(function() { + expect(() => { decoder.readUint64() }).toThrow(); // Overlong varints should trigger assertions. decoder.setBlock( [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0]); - expect(function() { + expect(() => { decoder.readUnsignedVarint64() }).toThrow(); decoder.reset(); - expect(function() { + expect(() => { decoder.readSignedVarint64() }).toThrow(); decoder.reset(); - expect(function() { + expect(() => { decoder.readZigzagVarint64() }).toThrow(); decoder.reset(); - expect(function() { + expect(() => { decoder.readUnsignedVarint32() }).toThrow(); }); @@ -429,7 +429,7 @@ describe('binaryDecoderTest', function() { /** * Tests encoding and decoding of unsigned integers. */ - it('testUnsignedIntegers', function() { + it('testUnsignedIntegers', () => { doTestUnsignedValue( jspb.BinaryDecoder.prototype.readUint8, jspb.BinaryEncoder.prototype.writeUint8, 1, 0xFF, Math.round); @@ -462,7 +462,7 @@ describe('binaryDecoderTest', function() { /** * Tests encoding and decoding of signed integers. */ - it('testSignedIntegers', function() { + it('testSignedIntegers', () => { doTestSignedValue( jspb.BinaryDecoder.prototype.readInt8, jspb.BinaryEncoder.prototype.writeInt8, 1, -0x80, 0x7F, Math.round); @@ -497,7 +497,7 @@ describe('binaryDecoderTest', function() { /** * Tests encoding and decoding of floats. */ - it('testFloats', function() { + it('testFloats', () => { /** * @param {number} x * @return {number} diff --git a/binary/message_test.js b/binary/message_test.js index 5489dd7..807a0b7 100644 --- a/binary/message_test.js +++ b/binary/message_test.js @@ -38,10 +38,10 @@ goog.require('proto.jspb.test.Deeply.Nested.Message'); // CommonJS-LoadFromFile: test2_pb proto.jspb.test goog.require('proto.jspb.test.ForeignNestedFieldMessage'); -describe('Message test suite', function() { +describe('Message test suite', () => { // Verify that we can successfully use a field referring to a nested message // from a different .proto file. - it('testForeignNestedMessage', function() { + it('testForeignNestedMessage', () => { const msg = new proto.jspb.test.ForeignNestedFieldMessage(); const nested = new proto.jspb.test.Deeply.Nested.Message(); nested.setCount(5); diff --git a/binary/reader_test.js b/binary/reader_test.js index a4b4058..dbbbb71 100644 --- a/binary/reader_test.js +++ b/binary/reader_test.js @@ -50,11 +50,11 @@ goog.require('jspb.utils'); goog.requireType('jspb.BinaryMessage'); -describe('binaryReaderTest', function() { +describe('binaryReaderTest', () => { /** * Tests the reader instance cache. */ - it('testInstanceCaches', /** @suppress {visibility} */ function() { + it('testInstanceCaches', /** @suppress {visibility} */ () => { const writer = new jspb.BinaryWriter(); const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); writer.writeMessage(1, dummyMessage, () => {}); @@ -95,15 +95,15 @@ describe('binaryReaderTest', function() { // Processing the message reuses the current reader. reader.nextField(); expect(reader.getFieldNumber()).toEqual(1); - reader.readMessage(dummyMessage, function() { - expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); - }); + reader.readMessage(dummyMessage, () => { + expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); + }); reader.nextField(); expect(reader.getFieldNumber()).toEqual(2); - reader.readMessage(dummyMessage, function() { - expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); - }); + reader.readMessage(dummyMessage, () => { + expect(jspb.BinaryReader.instanceCache_.length).toEqual(0); + }); expect(reader.nextField()).toEqual(false); @@ -132,105 +132,105 @@ describe('binaryReaderTest', function() { /** * Verifies that misuse of the reader class triggers assertions. */ - it('testReadErrors', /** @suppress {checkTypes|visibility} */ function() { - // Calling readMessage on a non-delimited field should trigger an - // assertion. - let reader = jspb.BinaryReader.alloc([8, 1]); - const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); - reader.nextField(); - expect(function() { - reader.readMessage(dummyMessage, () => {}); - }).toThrow(); + it('testReadErrors', /** @suppress {checkTypes|visibility} */ () => { + // Calling readMessage on a non-delimited field should trigger an + // assertion. + let reader = jspb.BinaryReader.alloc([8, 1]); + const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); + reader.nextField(); + expect(() => { + reader.readMessage(dummyMessage, () => { }); + }).toThrow(); - // Reading past the end of the stream should trigger an assertion. - reader = jspb.BinaryReader.alloc([9, 1]); - reader.nextField(); - expect(function() { - reader.readFixed64() - }).toThrow(); + // Reading past the end of the stream should trigger an assertion. + reader = jspb.BinaryReader.alloc([9, 1]); + reader.nextField(); + expect(() => { + reader.readFixed64(); + }).toThrow(); - // Reading past the end of a submessage should trigger an assertion. - reader = jspb.BinaryReader.alloc([10, 4, 13, 1, 1, 1]); - reader.nextField(); - reader.readMessage(dummyMessage, function() { + // Reading past the end of a submessage should trigger an assertion. + reader = jspb.BinaryReader.alloc([10, 4, 13, 1, 1, 1]); reader.nextField(); - expect(function() { - reader.readFixed32() + reader.readMessage(dummyMessage, () => { + reader.nextField(); + expect(() => { + reader.readFixed32(); + }).toThrow(); + }); + + // Skipping an invalid field should trigger an assertion. + reader = jspb.BinaryReader.alloc([12, 1]); + reader.nextWireType_ = 1000; + expect(() => { + reader.skipField(); }).toThrow(); - }); - // Skipping an invalid field should trigger an assertion. - reader = jspb.BinaryReader.alloc([12, 1]); - reader.nextWireType_ = 1000; - expect(function() { - reader.skipField() - }).toThrow(); - - // Reading fields with the wrong wire type should assert. - reader = jspb.BinaryReader.alloc([9, 0, 0, 0, 0, 0, 0, 0, 0]); - reader.nextField(); - expect(function() { - reader.readInt32() - }).toThrow(); - expect(function() { - reader.readInt32String() - }).toThrow(); - expect(function() { - reader.readInt64() - }).toThrow(); - expect(function() { - reader.readInt64String() - }).toThrow(); - expect(function() { - reader.readUint32() - }).toThrow(); - expect(function() { - reader.readUint32String() - }).toThrow(); - expect(function() { - reader.readUint64() - }).toThrow(); - expect(function() { - reader.readUint64String() - }).toThrow(); - expect(function() { - reader.readSint32() - }).toThrow(); - expect(function() { - reader.readBool() - }).toThrow(); - expect(function() { - reader.readEnum() - }).toThrow(); - - reader = jspb.BinaryReader.alloc([8, 1]); - reader.nextField(); - expect(function() { - reader.readFixed32() - }).toThrow(); - expect(function() { - reader.readFixed64() - }).toThrow(); - expect(function() { - reader.readSfixed32() - }).toThrow(); - expect(function() { - reader.readSfixed64() - }).toThrow(); - expect(function() { - reader.readFloat() - }).toThrow(); - expect(function() { - reader.readDouble() - }).toThrow(); - - expect(function() { - reader.readString() - }).toThrow(); - expect(function() { - reader.readBytes() - }).toThrow(); - }); + // Reading fields with the wrong wire type should assert. + reader = jspb.BinaryReader.alloc([9, 0, 0, 0, 0, 0, 0, 0, 0]); + reader.nextField(); + expect(() => { + reader.readInt32(); + }).toThrow(); + expect(function () { + reader.readInt32String(); + }).toThrow(); + expect(function () { + reader.readInt64(); + }).toThrow(); + expect(function () { + reader.readInt64String(); + }).toThrow(); + expect(function () { + reader.readUint32(); + }).toThrow(); + expect(function () { + reader.readUint32String(); + }).toThrow(); + expect(function () { + reader.readUint64(); + }).toThrow(); + expect(function () { + reader.readUint64String(); + }).toThrow(); + expect(function () { + reader.readSint32(); + }).toThrow(); + expect(function () { + reader.readBool(); + }).toThrow(); + expect(function () { + reader.readEnum(); + }).toThrow(); + + reader = jspb.BinaryReader.alloc([8, 1]); + reader.nextField(); + expect(function () { + reader.readFixed32(); + }).toThrow(); + expect(function () { + reader.readFixed64(); + }).toThrow(); + expect(function () { + reader.readSfixed32(); + }).toThrow(); + expect(function () { + reader.readSfixed64(); + }).toThrow(); + expect(function () { + reader.readFloat(); + }).toThrow(); + expect(function () { + reader.readDouble(); + }).toThrow(); + + expect(function () { + reader.readString(); + }).toThrow(); + expect(function () { + reader.readBytes(); + }).toThrow(); + }); /** @@ -357,7 +357,7 @@ describe('binaryReaderTest', function() { /** * Tests fields that use varint encoding. */ - it('testVarintFields', function() { + it('testVarintFields', () => { expect(jspb.BinaryReader.prototype.readUint32).not.toBeUndefined(); expect(jspb.BinaryWriter.prototype.writeUint32).not.toBeUndefined(); expect(jspb.BinaryReader.prototype.readUint64).not.toBeUndefined(); @@ -418,7 +418,7 @@ describe('binaryReaderTest', function() { /** * Tests non-canonical redundant varint decoding. */ - it('testRedundantVarintFields', function() { + it('testRedundantVarintFields', () => { expect(jspb.BinaryReader.prototype.readUint32).not.toBeNull(); expect(jspb.BinaryReader.prototype.readUint64).not.toBeNull(); expect(jspb.BinaryReader.prototype.readSint32).not.toBeNull(); @@ -448,7 +448,7 @@ describe('binaryReaderTest', function() { /** * Tests reading 64-bit integers as split values. */ - it('handles split 64 fields', function() { + it('handles split 64 fields', () => { const writer = new jspb.BinaryWriter(); writer.writeInt64String(1, '4294967296'); writer.writeSfixed64String(2, '4294967298'); @@ -474,7 +474,7 @@ describe('binaryReaderTest', function() { /** * Tests 64-bit fields that are handled as strings. */ - it('testStringInt64Fields', function() { + it('testStringInt64Fields', () => { const writer = new jspb.BinaryWriter(); const testSignedData = [ @@ -511,7 +511,7 @@ describe('binaryReaderTest', function() { /** * Tests fields that use zigzag encoding. */ - it('testZigzagFields', function() { + it('testZigzagFields', () => { doTestSignedField_( jspb.BinaryReader.prototype.readSint32, jspb.BinaryWriter.prototype.writeSint32, 1, -Math.pow(2, 31), @@ -532,7 +532,7 @@ describe('binaryReaderTest', function() { /** * Tests fields that use fixed-length encoding. */ - it('testFixedFields', function() { + it('testFixedFields', () => { doTestUnsignedField_( jspb.BinaryReader.prototype.readFixed32, jspb.BinaryWriter.prototype.writeFixed32, 1, Math.pow(2, 32) - 1, @@ -558,7 +558,7 @@ describe('binaryReaderTest', function() { /** * Tests floating point fields. */ - it('testFloatFields', function() { + it('testFloatFields', () => { doTestSignedField_( jspb.BinaryReader.prototype.readFloat, jspb.BinaryWriter.prototype.writeFloat, @@ -579,7 +579,7 @@ describe('binaryReaderTest', function() { /** * Tests length-delimited string fields. */ - it('testStringFields', function() { + it('testStringFields', () => { const s1 = 'The quick brown fox jumps over the lazy dog.'; const s2 = '人人生而自由,在尊嚴和權利上一律平等。'; @@ -603,7 +603,7 @@ describe('binaryReaderTest', function() { /** * Tests length-delimited byte fields. */ - it('testByteFields', function() { + it('testByteFields', () => { const message = []; const lowerLimit = 1; const upperLimit = 256; @@ -637,14 +637,14 @@ describe('binaryReaderTest', function() { /** * Tests nested messages. */ - it('testNesting', function() { + it('testNesting', () => { const writer = new jspb.BinaryWriter(); const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); writer.writeInt32(1, 100); // Add one message with 3 int fields. - writer.writeMessage(2, dummyMessage, function() { + writer.writeMessage(2, dummyMessage, () => { writer.writeInt32(3, 300); writer.writeInt32(4, 400); writer.writeInt32(5, 500); @@ -665,7 +665,7 @@ describe('binaryReaderTest', function() { reader.nextField(); expect(reader.getFieldNumber()).toEqual(2); - reader.readMessage(dummyMessage, function() { + reader.readMessage(dummyMessage, () => { // Validate embedded message 1. reader.nextField(); expect(reader.getFieldNumber()).toEqual(3); @@ -684,7 +684,7 @@ describe('binaryReaderTest', function() { reader.nextField(); expect(reader.getFieldNumber()).toEqual(6); - reader.readMessage(dummyMessage, function() { + reader.readMessage(dummyMessage, () => { // Validate embedded message 2. expect(reader.nextField()).toEqual(false); @@ -701,7 +701,7 @@ describe('binaryReaderTest', function() { * Tests skipping fields of each type by interleaving them with sentinel * values and skipping everything that's not a sentinel. */ - it('testSkipField', function() { + it('testSkipField', () => { const writer = new jspb.BinaryWriter(); const sentinel = 123456789; @@ -733,7 +733,7 @@ describe('binaryReaderTest', function() { // Write a group with a nested group inside. writer.writeInt32(5, sentinel); const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); - writer.writeGroup(5, dummyMessage, function() { + writer.writeGroup(5, dummyMessage, () => { // Previously the skipGroup implementation was wrong, which only consume // the decoder by nextField. This case is for making the previous // implementation failed in skipGroup by an early end group tag. @@ -747,7 +747,7 @@ describe('binaryReaderTest', function() { // varint. The bytes have at least 9 consecutive minus byte, which will // fail in this.nextField for previous implementation. writer.writeBytes(43, [255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); - writer.writeGroup(6, dummyMessage, function() { + writer.writeGroup(6, dummyMessage, () => { writer.writeInt64(84, 42); writer.writeInt64(84, 44); writer.writeBytes( @@ -802,7 +802,7 @@ describe('binaryReaderTest', function() { /** * Tests packed fields. */ - it('testPackedFields', function() { + it('testPackedFields', () => { const writer = new jspb.BinaryWriter(); const sentinel = 123456789; @@ -893,7 +893,7 @@ describe('binaryReaderTest', function() { * relative to the start of the outermost blob, not the start of their parent * blob. */ - it('testNestedBlobs', function() { + it('testNestedBlobs', () => { // Create a proto consisting of two nested messages, with the inner one // containing a blob of bytes. @@ -902,8 +902,8 @@ describe('binaryReaderTest', function() { const writer = new jspb.BinaryWriter(); const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); - writer.writeMessage(1, dummyMessage, function() { - writer.writeMessage(1, dummyMessage, function() { + writer.writeMessage(1, dummyMessage, () => { + writer.writeMessage(1, dummyMessage, () => { writer.writeBytes(1, blob); }); }); @@ -932,14 +932,14 @@ describe('binaryReaderTest', function() { /** * Tests read callbacks. */ - it('testReadCallbacks', function() { + it('testReadCallbacks', () => { const writer = new jspb.BinaryWriter(); const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); // Add an int, a submessage, and another int. writer.writeInt32(1, 100); - writer.writeMessage(2, dummyMessage, function() { + writer.writeMessage(2, dummyMessage, () => { writer.writeInt32(3, 300); writer.writeInt32(4, 400); writer.writeInt32(5, 500); @@ -979,7 +979,7 @@ describe('binaryReaderTest', function() { reader.nextField(); expect(reader.getFieldNumber()).toEqual(2); - reader.readMessage(dummyMessage, function() { + reader.readMessage(dummyMessage, () => { // Decode the embedded message using the registered callback. reader.runReadCallback('readCallback'); }); diff --git a/binary/utils_test.js b/binary/utils_test.js index 3bafa42..2788c9a 100644 --- a/binary/utils_test.js +++ b/binary/utils_test.js @@ -69,11 +69,11 @@ function toHashString(bitsLow, bitsHigh) { } -describe('binaryUtilsTest', function() { +describe('binaryUtilsTest', () => { /** * Tests lossless binary-to-decimal conversion. */ - it('testDecimalConversion', function() { + it('testDecimalConversion', () => { // Check some magic numbers. let result = jspb.utils.joinUnsignedDecimalString(0x89e80001, 0x8ac72304); expect(result).toEqual('10000000000000000001'); @@ -153,7 +153,7 @@ describe('binaryUtilsTest', function() { /** * Going from hash strings to decimal strings should also be lossless. */ - it('testHashToDecimalConversion', function() { + it('testHashToDecimalConversion', () => { let result; const convert = jspb.utils.hash64ToDecimalString; @@ -198,7 +198,7 @@ describe('binaryUtilsTest', function() { /* * Going from decimal strings to hash strings should be lossless. */ - it('testDecimalToHashConversion', function() { + it('testDecimalToHashConversion', () => { let result; const convert = jspb.utils.decimalStringToHash64; @@ -234,7 +234,7 @@ describe('binaryUtilsTest', function() { /** * Going from hash strings to hex strings should be lossless. */ - it('testHashToHexConversion', function() { + it('testHashToHexConversion', () => { let result; const convert = jspb.utils.hash64ToHexString; @@ -252,7 +252,7 @@ describe('binaryUtilsTest', function() { /** * Going from hex strings to hash strings should be lossless. */ - it('testHexToHashConversion', function() { + it('testHexToHashConversion', () => { let result; const convert = jspb.utils.hexStringToHash64; @@ -280,7 +280,7 @@ describe('binaryUtilsTest', function() { * Going from numbers to hash strings should be lossless for up to 53 bits of * precision. */ - it('testNumberToHashConversion', function() { + it('testNumberToHashConversion', () => { let result; const convert = jspb.utils.numberToHash64; @@ -311,7 +311,7 @@ describe('binaryUtilsTest', function() { * Sanity check the behavior of Javascript's strings when doing funny things * with unicode characters. */ - it('sanityCheckUnicodeStrings', function() { + it('sanityCheckUnicodeStrings', () => { const strings = new Array(65536); // All possible unsigned 16-bit values should be storable in a string, they @@ -335,7 +335,7 @@ describe('binaryUtilsTest', function() { /** * Tests conversion from 32-bit floating point numbers to split64 numbers. */ - it('testFloat32ToSplit64', function() { + it('testFloat32ToSplit64', () => { const f32_eps = jspb.BinaryConstants.FLOAT32_EPS; const f32_min = jspb.BinaryConstants.FLOAT32_MIN; const f32_max = jspb.BinaryConstants.FLOAT32_MAX; @@ -413,7 +413,7 @@ describe('binaryUtilsTest', function() { /** * Tests conversion from 64-bit floating point numbers to split64 numbers. */ - it('testFloat64ToSplit64', function() { + it('testFloat64ToSplit64', () => { const f64_eps = jspb.BinaryConstants.FLOAT64_EPS; const f64_min = jspb.BinaryConstants.FLOAT64_MIN; const f64_max = jspb.BinaryConstants.FLOAT64_MAX; @@ -498,7 +498,7 @@ describe('binaryUtilsTest', function() { /** * Tests zigzag conversions. */ - it('can encode and decode zigzag 64', function() { + it('can encode and decode zigzag 64', () => { function stringToHiLoPair(str) { jspb.utils.splitDecimalString(str); return { @@ -546,7 +546,7 @@ describe('binaryUtilsTest', function() { /** * Tests counting packed varints. */ - it('testCountVarints', function() { + it('testCountVarints', () => { const values = []; for (let i = 1; i < 1000000000; i *= 1.1) { values.push(Math.floor(i)); @@ -567,7 +567,7 @@ describe('binaryUtilsTest', function() { /** * Tests counting matching varint fields. */ - it('testCountVarintFields', function() { + it('testCountVarintFields', () => { let writer = new jspb.BinaryWriter(); let count = 0; @@ -599,7 +599,7 @@ describe('binaryUtilsTest', function() { /** * Tests counting matching fixed32 fields. */ - it('testCountFixed32Fields', function() { + it('testCountFixed32Fields', () => { let writer = new jspb.BinaryWriter(); let count = 0; @@ -631,7 +631,7 @@ describe('binaryUtilsTest', function() { /** * Tests counting matching fixed64 fields. */ - it('testCountFixed64Fields', function() { + it('testCountFixed64Fields', () => { let writer = new jspb.BinaryWriter(); let count = 0; @@ -663,7 +663,7 @@ describe('binaryUtilsTest', function() { /** * Tests counting matching delimited fields. */ - it('testCountDelimitedFields', function() { + it('testCountDelimitedFields', () => { let writer = new jspb.BinaryWriter(); let count = 0; @@ -695,7 +695,7 @@ describe('binaryUtilsTest', function() { /** * Tests byte format for debug strings. */ - it('testDebugBytesToTextFormat', function() { + it('testDebugBytesToTextFormat', () => { expect(jspb.utils.debugBytesToTextFormat(null)).toEqual('""'); expect(jspb.utils.debugBytesToTextFormat([ 0, 16, 255 @@ -706,7 +706,7 @@ describe('binaryUtilsTest', function() { /** * Tests converting byte blob sources into byte blobs. */ - it('testByteSourceToUint8Array', function() { + it('testByteSourceToUint8Array', () => { const convert = jspb.utils.byteSourceToUint8Array; const sourceData = []; diff --git a/commonjs/export.js b/commonjs/export.js index 97de6a2..72788f4 100644 --- a/commonjs/export.js +++ b/commonjs/export.js @@ -8,7 +8,6 @@ goog.provide('jspb.Export'); goog.require('goog.object'); -goog.require('jspb.asserts'); goog.require('jspb.BinaryReader'); goog.require('jspb.BinaryWriter'); goog.require('jspb.ExtensionFieldBinaryInfo'); @@ -23,7 +22,6 @@ if (typeof exports === 'object') { exports['BinaryWriter'] = jspb.BinaryWriter; exports['ExtensionFieldInfo'] = jspb.ExtensionFieldInfo; exports['ExtensionFieldBinaryInfo'] = jspb.ExtensionFieldBinaryInfo; - exports['asserts'] = jspb.asserts; // These are used by generated code but should not be used directly by clients. exports['exportSymbol'] = goog.exportSymbol; diff --git a/debug.js b/debug.js index 25fec76..ed16a3f 100644 --- a/debug.js +++ b/debug.js @@ -56,7 +56,7 @@ jspb.debug.dump = function(message) { if (!goog.DEBUG) { return null; } - jspb.asserts.assert(message instanceof jspb.Message, + jspb.asserts.assertInstanceof(message, jspb.Message, 'jspb.Message instance expected'); /** @type {Object} */ var object = message; @@ -102,7 +102,7 @@ jspb.debug.dump_ = function(thing) { return mapObject; } - jspb.asserts.assert(message instanceof jspb.Message, + jspb.asserts.assertInstanceof(message, jspb.Message, 'Only messages expected: ' + thing); var ctor = message.constructor; var messageName = ctor.name || ctor.displayName; diff --git a/maps_test.js b/maps_test.js index 5c701ff..fd1ba19 100644 --- a/maps_test.js +++ b/maps_test.js @@ -28,7 +28,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -goog.require('goog.testing.TestCase'); goog.require('goog.userAgent'); // CommonJS-LoadFromFile: protos/testbinary_pb proto.jspb.test @@ -166,7 +165,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { }); }; - it('testMapStringStringField' + suffix, function () { + it('testMapStringStringField' + suffix, () => { let msg = new msgInfo.constructor(); expect(msg.getMapStringStringMap().getLength()).toEqual(0); expect(msg.getMapStringInt32Map().getLength()).toEqual(0); @@ -221,7 +220,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { /** * Tests operations on maps with all key and value types. */ - it('testAllMapTypes' + suffix, function () { + it('testAllMapTypes' + suffix, () => { const msg = new msgInfo.constructor(); fillMapFields(msg); checkMapFields(msg); @@ -232,7 +231,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { /** * Tests serialization and deserialization in binary format. */ - it('testBinaryFormat' + suffix, function () { + it('testBinaryFormat' + suffix, () => { if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(10)) { // IE8/9 currently doesn't support binary format because they lack // TypedArray. @@ -267,7 +266,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { * Tests deserialization of undefined map keys go to default values in * binary format. */ - it('testMapDeserializationForUndefinedKeys', function () { + it('testMapDeserializationForUndefinedKeys', () => { const testMessageOptionalKeys = new proto.jspb.test.TestMapFieldsOptionalKeys(); const mapEntryStringKey = @@ -295,7 +294,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { * Tests deserialization of undefined map values go to default values in * binary format. */ - it('testMapDeserializationForUndefinedValues', function () { + it('testMapDeserializationForUndefinedValues', () => { const testMessageOptionalValues = new proto.jspb.test.TestMapFieldsOptionalValues(); const mapEntryStringValue = @@ -342,7 +341,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { /** * Exercises the lazy map<->underlying array sync. */ - it('testLazyMapSync' + suffix, function () { + it('testLazyMapSync' + suffix, () => { // Start with a JSPB array containing a few map entries. const entries = [['a', 'entry 1'], ['c', 'entry 2'], ['b', 'entry 3']]; const msg = new msgInfo.constructor([entries]); @@ -364,7 +363,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { /** * Returns IteratorIterables for entries(), keys() and values(). */ - it('testIteratorIterables' + suffix, function () { + it('testIteratorIterables' + suffix, () => { const msg = new msgInfo.constructor(); const m = msg.getMapStringStringMap(); m.set('key1', 'value1'); @@ -424,7 +423,7 @@ function makeTests(msgInfo, submessageCtor, suffix) { }); } -describe('mapsTest', function () { +describe('mapsTest', () => { makeTests( { constructor: proto.jspb.test.TestMapFields, diff --git a/proto3_test.js b/proto3_test.js index 575df65..f463a8e 100644 --- a/proto3_test.js +++ b/proto3_test.js @@ -68,11 +68,11 @@ function bytesCompare(arr, expected) { } -describe('proto3Test', function() { +describe('proto3Test', () => { /** * Test default values don't affect equality test. */ - it('testEqualsProto3', function() { + it('testEqualsProto3', () => { const msg1 = new proto.jspb.test.TestProto3(); const msg2 = new proto.jspb.test.TestProto3(); msg2.setSingularString(''); @@ -84,7 +84,7 @@ describe('proto3Test', function() { /** * Test setting when a field has default semantics. */ - it('testSetProto3ToValueAndBackToDefault', function() { + it('testSetProto3ToValueAndBackToDefault', () => { const msg = new proto.jspb.test.TestProto3(); // Setting should work normally. @@ -103,7 +103,7 @@ describe('proto3Test', function() { /** * Test defaults for proto3 message fields. */ - it('testProto3FieldDefaults', function() { + it('testProto3FieldDefaults', () => { const msg = new proto.jspb.test.TestProto3(); expect(msg.getSingularInt32()).toEqual(0); @@ -154,7 +154,7 @@ describe('proto3Test', function() { /** * Test presence for proto3 optional fields. */ - it('testProto3Optional', function() { + it('testProto3Optional', () => { const msg = new proto.jspb.test.TestProto3(); expect(msg.getOptionalInt32()).toEqual(0); @@ -221,7 +221,7 @@ describe('proto3Test', function() { /** * Test that all fields can be set ,and read via a serialization roundtrip. */ - it('testProto3FieldSetGet', function() { + it('testProto3FieldSetGet', () => { let msg = new proto.jspb.test.TestProto3(); msg.setSingularInt32(-42); @@ -317,7 +317,7 @@ describe('proto3Test', function() { /** * Test that oneofs continue to have a notion of field presence. */ - it('testOneofs', function() { + it('testOneofs', () => { // Default instance. const msg = new proto.jspb.test.TestProto3(); expect(msg.getOneofUint32()).toEqual(0); @@ -385,7 +385,7 @@ describe('proto3Test', function() { /** * Test that "default"-valued primitive fields are not emitted on the wire. */ - it('testNoSerializeDefaults', function() { + it('testNoSerializeDefaults', () => { const msg = new proto.jspb.test.TestProto3(); // Set each primitive to a non-default value, then back to its default, to @@ -416,7 +416,7 @@ describe('proto3Test', function() { /** * Test that base64 string and Uint8Array are interchangeable in bytes fields. */ - it('testBytesFieldsInterop', function() { + it('testBytesFieldsInterop', () => { let msg = new proto.jspb.test.TestProto3(); // Set as a base64 string and check all the getters work. msg.setSingularBytes(BYTES_B64); @@ -438,7 +438,7 @@ describe('proto3Test', function() { expect(bytesCompare(msg.getSingularBytes(), BYTES)).toBeTrue(); }); - it('testTimestampWellKnownType', function() { + it('testTimestampWellKnownType', () => { const msg = new proto.google.protobuf.Timestamp(); msg.fromDate(new Date(123456789)); expect(msg.getSeconds()).toEqual(123456); @@ -450,7 +450,7 @@ describe('proto3Test', function() { expect(anotherMsg.getNanos()).toEqual(msg.getNanos()); }); - it('testStructWellKnownType', function() { + it('testStructWellKnownType', () => { const jsObj = { abc: 'def', number: 12345.678, From e2a06518e14bc60a51e1dc46b4aaff3fb0dc9781 Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Wed, 5 Oct 2022 18:48:12 -0700 Subject: [PATCH 7/9] Straggler style fix up --- binary/proto_test.js | 16 +++---- binary/writer_test.js | 60 +++++++++++------------ commonjs/import_test.js | 4 +- commonjs/strict_test.js | 12 ++--- message_test.js | 104 ++++++++++++++++++++-------------------- 5 files changed, 98 insertions(+), 98 deletions(-) diff --git a/binary/proto_test.js b/binary/proto_test.js index ed49090..689498c 100644 --- a/binary/proto_test.js +++ b/binary/proto_test.js @@ -396,12 +396,12 @@ function checkExtensions(msg) { } -describe('protoBinaryTest', function() { +describe('protoBinaryTest', () => { /** * Tests a basic serialization-deserializaton round-trip with all supported * field types (on the TestAllTypes message type). */ - it('testRoundTrip', function() { + it('testRoundTrip', () => { const msg = new proto.jspb.test.TestAllTypes(); fillAllFields(msg); const encoded = msg.serializeBinary(); @@ -412,7 +412,7 @@ describe('protoBinaryTest', function() { /** * Test that base64 string and Uint8Array are interchangeable in bytes fields. */ - it('testBytesFieldsGettersInterop', function() { + it('testBytesFieldsGettersInterop', () => { let msg = new proto.jspb.test.TestAllTypes(); // Set from a base64 string and check all the getters work. msg.setOptionalBytes(BYTES_B64); @@ -437,7 +437,7 @@ describe('protoBinaryTest', function() { /** * Test that bytes setters will receive result of any of the getters. */ - it('testBytesFieldsSettersInterop', function() { + it('testBytesFieldsSettersInterop', () => { const msg = new proto.jspb.test.TestAllTypes(); msg.setOptionalBytes(BYTES); expect(bytesCompare(msg.getOptionalBytes(), BYTES)).toBeTrue(); @@ -453,7 +453,7 @@ describe('protoBinaryTest', function() { /** * Test that bytes setters will receive result of any of the getters. */ - it('testRepeatedBytesGetters', function() { + it('testRepeatedBytesGetters', () => { const msg = new proto.jspb.test.TestAllTypes(); function assertGetters() { @@ -575,7 +575,7 @@ describe('protoBinaryTest', function() { /** * Tests extension serialization and deserialization. */ - it('testExtensions', function() { + it('testExtensions', () => { const msg = new proto.jspb.test.TestExtendable(); fillExtensions(msg); const encoded = msg.serializeBinary(); @@ -586,7 +586,7 @@ describe('protoBinaryTest', function() { /** * Tests that unknown extensions don't cause deserialization failure. */ - it('testUnknownExtension', function() { + it('testUnknownExtension', () => { const msg = new proto.jspb.test.TestExtendable(); fillExtensions(msg); const writer = new jspb.BinaryWriter(); @@ -597,7 +597,7 @@ describe('protoBinaryTest', function() { checkExtensions(decoded); }); - it('testAnyWellKnownType', function() { + it('testAnyWellKnownType', () => { const any = new proto.google.protobuf.Any(); const msg = new proto.jspb.test.TestAllTypes(); diff --git a/binary/writer_test.js b/binary/writer_test.js index 54b9921..3663b70 100644 --- a/binary/writer_test.js +++ b/binary/writer_test.js @@ -49,95 +49,95 @@ goog.require('jspb.utils'); goog.requireType('jspb.BinaryMessage'); -describe('binaryWriterTest', function() { +describe('binaryWriterTest', () => { /** * Verifies that misuse of the writer class triggers assertions. */ - it('testWriteErrors', function() { + it('testWriteErrors', () => { // Submessages with invalid field indices should assert. let writer = new jspb.BinaryWriter(); const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({}); - expect(function() { + expect(() => { writer.writeMessage(-1, dummyMessage, () => {}); }).toThrow(); // Writing invalid field indices should assert. writer = new jspb.BinaryWriter(); - expect(function() { + expect(() => { writer.writeUint64(-1, 1); }).toThrow(); // Writing out-of-range field values should assert. writer = new jspb.BinaryWriter(); - expect(function() { + expect(() => { writer.writeInt32(1, -Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeInt32(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeInt64(1, -Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeInt64(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeUint32(1, -1); }).toThrow(); - expect(function() { + expect(() => { writer.writeUint32(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeUint64(1, -1); }).toThrow(); - expect(function() { + expect(() => { writer.writeUint64(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeSint32(1, -Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeSint32(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeSint64(1, -Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeSint64(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeFixed32(1, -1); }).toThrow(); - expect(function() { + expect(() => { writer.writeFixed32(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeFixed64(1, -1); }).toThrow(); - expect(function() { + expect(() => { writer.writeFixed64(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeSfixed32(1, -Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeSfixed32(1, Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeSfixed64(1, -Infinity); }).toThrow(); - expect(function() { + expect(() => { writer.writeSfixed64(1, Infinity); }).toThrow(); }); @@ -146,7 +146,7 @@ describe('binaryWriterTest', function() { /** * Basic test of retrieving the result as a Uint8Array buffer */ - it('testGetResultBuffer', function() { + it('testGetResultBuffer', () => { const expected = '0864120b48656c6c6f20776f726c641a0301020320c801'; const writer = new jspb.BinaryWriter(); @@ -163,7 +163,7 @@ describe('binaryWriterTest', function() { /** * Tests websafe encodings for base64 strings. */ - it('testWebSafeOption', function() { + it('testWebSafeOption', () => { const writer = new jspb.BinaryWriter(); writer.writeBytes(1, new Uint8Array([127])); expect('CgF/').toEqual(writer.getResultBase64String()); @@ -173,7 +173,7 @@ describe('binaryWriterTest', function() { goog.crypt.base64.Alphabet.WEBSAFE_NO_PADDING)); }); - it('writes split 64 fields', function() { + it('writes split 64 fields', () => { const writer = new jspb.BinaryWriter(); writer.writeSplitVarint64(1, 0x1, 0x2); writer.writeSplitVarint64(1, 0xFFFFFFFF, 0xFFFFFFFF); @@ -243,7 +243,7 @@ describe('binaryWriterTest', function() { ]); }); - it('writes zigzag 64 fields', function() { + it('writes zigzag 64 fields', () => { // Test cases directly from the protobuf dev guide. // https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types const testCases = [ @@ -355,7 +355,7 @@ describe('binaryWriterTest', function() { })); }); - it('writes float32 fields', function() { + it('writes float32 fields', () => { const testCases = [ 0, 1, -1, jspb.BinaryConstants.FLOAT32_MIN, -jspb.BinaryConstants.FLOAT32_MIN, jspb.BinaryConstants.FLOAT32_MAX, @@ -378,7 +378,7 @@ describe('binaryWriterTest', function() { }); }); - it('writes double fields', function() { + it('writes double fields', () => { const testCases = [ 0, 1, -1, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MAX_VALUE, Number.MIN_VALUE, jspb.BinaryConstants.FLOAT32_MIN, diff --git a/commonjs/import_test.js b/commonjs/import_test.js index ef06d50..fcb63cb 100644 --- a/commonjs/import_test.js +++ b/commonjs/import_test.js @@ -40,8 +40,8 @@ googleProtobuf.exportSymbol('jspb.Message', googleProtobuf.Message, global); var test7_pb = require('./test7/test7_pb'); googleProtobuf.exportSymbol('proto.jspb.test.framing.FramingMessage', test7_pb.FramingMessage, global); -describe('Import test suite', function() { - it('testImportedMessage', function() { +describe('Import test suite', () => { + it('testImportedMessage', () => { const framing1 = new proto.jspb.test.framing.FramingMessage([]); const framing2 = new proto.jspb.test.framing.FramingMessage([]); expect(framing1.toObject()).toEqual(framing2.toObject()); diff --git a/commonjs/strict_test.js b/commonjs/strict_test.js index 6f429dc..2359185 100644 --- a/commonjs/strict_test.js +++ b/commonjs/strict_test.js @@ -38,25 +38,25 @@ const global = Function('return this')(); const test9_pb = require('./protos/test9_pb'); const test10_pb = require('./protos/test10_pb'); -describe('Strict test suite', function() { - it('testImportedMessage', function() { +describe('Strict test suite', () => { + it('testImportedMessage', () => { const simple1 = new test9_pb.jspb.exttest.strict.nine.Simple9() const simple2 = new test9_pb.jspb.exttest.strict.nine.Simple9() expect(simple1.toObject()).toEqual(simple2.toObject()); }); - it('testGlobalScopePollution', function() { + it('testGlobalScopePollution', () => { expect(global.jspb.exttest).toBeUndefined(); }); - describe('with imports', function() { - it('testImportedMessage', function() { + describe('with imports', () => { + it('testImportedMessage', () => { const simple1 = new test10_pb.jspb.exttest.strict.ten.Simple10() const simple2 = new test10_pb.jspb.exttest.strict.ten.Simple10() expect(simple1.toObject()).toEqual(simple2.toObject()); }); - it('testGlobalScopePollution', function() { + it('testGlobalScopePollution', () => { expect(global.jspb.exttest).toBeUndefined(); }); }); diff --git a/message_test.js b/message_test.js index b71f8b1..15ab24e 100644 --- a/message_test.js +++ b/message_test.js @@ -126,37 +126,37 @@ goog.require('proto.jspb.test.MessageWithLargeFieldNumbers'); goog.require('proto.jspb.test.simple1'); -describe('Message test suite', function() { +describe('Message test suite', () => { const stubs = new goog.testing.PropertyReplacer(); - beforeEach(function() { + beforeEach(() => { stubs.set(jspb.Message, 'SERIALIZE_EMPTY_TRAILING_FIELDS', false); }); - afterEach(function() { + afterEach(() => { stubs.reset(); }); - it('testEmptyProto', function() { + it('testEmptyProto', () => { const empty1 = new proto.jspb.test.Empty([]); const empty2 = new proto.jspb.test.Empty([]); expect(empty1.toObject()).toEqual({}); expect(empty1).toEqual(empty2); }); - it('testTopLevelEnum', function() { + it('testTopLevelEnum', () => { const response = new proto.jspb.test.EnumContainer([]); response.setOuterEnum(proto.jspb.test.OuterEnum.FOO); expect(response.getOuterEnum()).toEqual(proto.jspb.test.OuterEnum.FOO); }); - it('testByteStrings', function() { + it('testByteStrings', () => { const data = new proto.jspb.test.DefaultValues([]); data.setBytesField('some_bytes'); expect(data.getBytesField()).toEqual('some_bytes'); }); - it('testComplexConversion', function() { + it('testComplexConversion', () => { const data1 = ['a', , , [, 11], [[, 22], [, 33]], , ['s1', 's2'], , 1]; const foo = new proto.jspb.test.Complex(data1); let result = foo.toObject(); @@ -186,7 +186,7 @@ describe('Message test suite', function() { }); }); - it('testMissingFields', function() { + it('testMissingFields', () => { const foo = new proto.jspb.test.Complex([ undefined, undefined, undefined, [], undefined, undefined, undefined, undefined @@ -203,14 +203,14 @@ describe('Message test suite', function() { }); }); - it('testNestedComplexMessage', function() { + it('testNestedComplexMessage', () => { // Instantiate the message and set a unique field, just to ensure that we // are not getting jspb.test.Complex instead. const msg = new proto.jspb.test.OuterMessage.Complex(); msg.setInnerComplexField(5); }); - it('testSpecialCases', function() { + it('testSpecialCases', () => { // Note: Some property names are reserved in JavaScript. // These names are converted to the Js property named pb_. const special = new proto.jspb.test.SpecialCases( @@ -224,7 +224,7 @@ describe('Message test suite', function() { }); }); - it('testDefaultValues', function() { + it('testDefaultValues', () => { const defaultString = 'default<>\'"abc'; let response = new proto.jspb.test.DefaultValues(); @@ -318,7 +318,7 @@ describe('Message test suite', function() { expect(response.hasEnumField()).toEqual(false); }); - it('testEqualsSimple', function() { + it('testEqualsSimple', () => { const s1 = new proto.jspb.test.Simple1(['hi']); expect(jspb.Message.equals(s1, new proto.jspb.test.Simple1(['hi']))) .toEqual(true); @@ -339,7 +339,7 @@ describe('Message test suite', function() { expect(jspb.Message.equals(s1, s2)).toEqual(false); }); - it('testEquals_softComparison', function() { + it('testEquals_softComparison', () => { const s1 = new proto.jspb.test.Simple1(['hi', [], null]); expect(jspb.Message.equals(s1, new proto.jspb.test.Simple1(['hi', []]))) .toBeTrue(); @@ -349,7 +349,7 @@ describe('Message test suite', function() { .toBeTrue(); }); - it('testEqualsComplex', function() { + it('testEqualsComplex', () => { const data1 = ['a', , , [, 11], [[, 22], [, 33]], , ['s1', 's2'], , 1]; const data2 = ['a', , , [, 11], [[, 22], [, 34]], , ['s1', 's2'], , 1]; const data3 = ['a', , , [, 11], [[, 22]], , ['s1', 's2'], , 1]; @@ -366,7 +366,7 @@ describe('Message test suite', function() { expect(jspb.Message.equals(c1a, s1)).toBeFalse(); }); - it('testEqualsExtensionsConstructed', function() { + it('testEqualsExtensionsConstructed', () => { expect(jspb.Message.equals( new proto.jspb.test.HasExtensions([]), new proto.jspb.test.HasExtensions([{}]))) @@ -403,7 +403,7 @@ describe('Message test suite', function() { .toBeTrue(); }); - it('testEqualsExtensionsUnconstructed', function() { + it('testEqualsExtensionsUnconstructed', () => { expect(jspb.Message.compareFields([], [{}])).toBeTrue(); expect(jspb.Message.compareFields([, , , {}], [])).toBeTrue(); expect(jspb.Message.compareFields([, , , {}], [, , {}])).toBeTrue(); @@ -430,13 +430,13 @@ describe('Message test suite', function() { ])).toBeTrue(); }); - it('testInitializeMessageWithLastFieldNull', function() { + it('testInitializeMessageWithLastFieldNull', () => { // This tests for regression to bug http://b/117298778 const msg = new proto.jspb.test.TestLastFieldBeforePivot([null]); expect(msg.getLastFieldBeforePivot()).not.toBeUndefined(); }); - it('testEqualsNonFinite', function() { + it('testEqualsNonFinite', () => { expect(jspb.Message.compareFields(NaN, NaN)).toEqual(true); expect(jspb.Message.compareFields(NaN, 'NaN')).toEqual(true); expect(jspb.Message.compareFields('NaN', NaN)).toEqual(true); @@ -448,7 +448,7 @@ describe('Message test suite', function() { expect(jspb.Message.compareFields(NaN, undefined)).toEqual(false); }); - it('testToMap', function() { + it('testToMap', () => { const p1 = new proto.jspb.test.Simple1(['k', ['v']]); const p2 = new proto.jspb.test.Simple1(['k1', ['v1', 'v2']]); const soymap = jspb.Message.toMap( @@ -462,7 +462,7 @@ describe('Message test suite', function() { expect(protomap['k'].getARepeatedStringList()).toEqual(['v']); }); - it('testClone', function() { + it('testClone', () => { const supportsUint8Array = !goog.userAgent.IE || goog.userAgent.isVersionOrHigher('10'); const original = new proto.jspb.test.TestClone(); @@ -508,7 +508,7 @@ describe('Message test suite', function() { ]); }); - it('testCopyInto', function() { + it('testCopyInto', () => { const supportsUint8Array = !goog.userAgent.IE || goog.userAgent.isVersionOrHigher('10'); const original = new proto.jspb.test.TestClone(); @@ -560,7 +560,7 @@ describe('Message test suite', function() { .getExt()); }); - it('testCopyInto_notSameType', function() { + it('testCopyInto_notSameType', () => { const a = new proto.jspb.test.TestClone(); const b = new proto.jspb.test.Simple1(['str', ['s1', 's2']]); @@ -568,7 +568,7 @@ describe('Message test suite', function() { .toThrowError(Error, /should have the same type/); }); - it('testExtensions', function() { + it('testExtensions', () => { const extension1 = new proto.jspb.test.IsExtension(['ext1field']); const extension2 = new proto.jspb.test.Simple1(['str', ['s1', 's2']]); const extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); @@ -611,7 +611,7 @@ describe('Message test suite', function() { expect(proto.jspb.test.HasExtensions['ignoredFloating']).toBeUndefined(); }); - it('testFloatingExtensions', function() { + it('testFloatingExtensions', () => { // From an autogenerated container. let extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); let extension = new proto.jspb.test.Simple1(['foo', ['s1', 's2']]); @@ -632,7 +632,7 @@ describe('Message test suite', function() { expect(proto.jspb.exttest.beta.floatingStrField).not.toBeUndefined(); }); - it('testNestedExtensions', function() { + it('testNestedExtensions', () => { const extendable = new proto.jspb.exttest.nested.TestNestedExtensionsMessage(); const extension = @@ -645,7 +645,7 @@ describe('Message test suite', function() { .toEqual(extension); }); - it('testToObject_extendedObject', function() { + it('testToObject_extendedObject', () => { const extension1 = new proto.jspb.test.IsExtension(['ext1field']); const extension2 = new proto.jspb.test.Simple1(['str', ['s1', 's2'], true]); const extendable = new proto.jspb.test.HasExtensions(['v1', 'v2', 'v3']); @@ -711,38 +711,38 @@ describe('Message test suite', function() { }); }); - it('testInitialization_emptyArray', function() { + it('testInitialization_emptyArray', () => { const msg = new proto.jspb.test.HasExtensions([]); expect(msg.toArray()).toEqual([]); }); - it('testInitialization_justExtensionObject', function() { + it('testInitialization_justExtensionObject', () => { const msg = new proto.jspb.test.Empty([{1: 'hi'}]); // The extensionObject is not moved from its original location. expect(msg.toArray()).toEqual([{1: 'hi'}]) }); - it('testInitialization_incompleteList', function() { + it('testInitialization_incompleteList', () => { const msg = new proto.jspb.test.Empty([1, {4: 'hi'}]); // The extensionObject is not moved from its original location. expect(msg.toArray()).toEqual([1, {4: 'hi'}]); }); - it('testInitialization_forwardCompatible', function() { + it('testInitialization_forwardCompatible', () => { const msg = new proto.jspb.test.Empty([1, 2, 3, {1: 'hi'}]); expect(msg.toArray()).toEqual([1, 2, 3, {1: 'hi'}]); }); it('testExtendedMessageEnsureObject', - /** @suppress {visibility} */ function() { + /** @suppress {visibility} */ () => { const data = new proto.jspb.test.HasExtensions(['str1', {'a_key': 'an_object'}]); expect(jspb.Message.getField(data, ['a_key'])).toEqual('an_object'); }); - it('testToObject_hasExtensionField', function() { + it('testToObject_hasExtensionField', () => { const data = new proto.jspb.test.HasExtensions(['str1', {100: ['ext1'], 102: ''}]); const obj = data.toObject(); @@ -751,7 +751,7 @@ describe('Message test suite', function() { expect(obj.str).toEqual(''); }); - it('testGetExtension', function() { + it('testGetExtension', () => { const data = new proto.jspb.test.HasExtensions(['str1', {100: ['ext1']}]); expect(data.getStr1()).toEqual('str1'); const extension = data.getExtension(proto.jspb.test.IsExtension.extField); @@ -759,7 +759,7 @@ describe('Message test suite', function() { expect(extension.getExt1()).toEqual('ext1'); }); - it('testSetExtension', function() { + it('testSetExtension', () => { const data = new proto.jspb.test.HasExtensions(); const extensionMessage = new proto.jspb.test.IsExtension(['is_extension']); data.setExtension(proto.jspb.test.IsExtension.extField, extensionMessage); @@ -773,7 +773,7 @@ describe('Message test suite', function() { * Note that group is long deprecated, we only support it because JsPb has * a goal of being able to generate JS classes for all proto descriptors. */ - it('testGroups', function() { + it('testGroups', () => { const group = new proto.jspb.test.TestGroup(); const someGroup = new proto.jspb.test.TestGroup.RepeatedGroup(); someGroup.setId('g1'); @@ -797,13 +797,13 @@ describe('Message test suite', function() { expect(group1.getGroup()).toEqual(someGroup); }); - it('testNonExtensionFieldsAfterExtensionRange', function() { + it('testNonExtensionFieldsAfterExtensionRange', () => { const data = [{'1': 'a_string'}]; const message = new proto.jspb.test.Complex(data); expect(message.getARepeatedStringList()).toEqual([]) }); - it('testReservedGetterNames', function() { + it('testReservedGetterNames', () => { const message = new proto.jspb.test.TestReservedNames(); message.setExtension$(11); message.setExtension(proto.jspb.test.TestReservedNamesExtension.foo, 12); @@ -813,7 +813,7 @@ describe('Message test suite', function() { expect(message.toObject()).toEqual({extension: 11, foo: 12}); }); - it('testInitializeMessageWithUnsetOneof', function() { + it('testInitializeMessageWithUnsetOneof', () => { const message = new proto.jspb.test.TestMessageWithOneof([]); expect(message.getPartialOneofCase()) .toEqual(proto.jspb.test.TestMessageWithOneof.PartialOneofCase @@ -824,7 +824,7 @@ describe('Message test suite', function() { .RECURSIVE_ONEOF_NOT_SET); }); - it('testUnsetsOneofCaseWhenFieldIsCleared', function() { + it('testUnsetsOneofCaseWhenFieldIsCleared', () => { const message = new proto.jspb.test.TestMessageWithOneof; expect(message.getPartialOneofCase()) .toEqual(proto.jspb.test.TestMessageWithOneof.PartialOneofCase @@ -841,7 +841,7 @@ describe('Message test suite', function() { .PARTIAL_ONEOF_NOT_SET); }); - it('testFloatingPointFieldsSupportNan', function() { + it('testFloatingPointFieldsSupportNan', () => { const message = new proto.jspb.test.FloatingPointFields([ 'NaN', 'NaN', ['NaN', 'NaN'], 'NaN', 'NaN', 'NaN', ['NaN', 'NaN'], 'NaN' ]); @@ -857,7 +857,7 @@ describe('Message test suite', function() { expect(message.getDefaultDoubleField()).toBeNaN(); }); - it('testFloatingPointsAreConvertedFromStringInput', function() { + it('testFloatingPointsAreConvertedFromStringInput', () => { const message = new proto.jspb.test.FloatingPointFields([ Infinity, 'Infinity', ['Infinity', Infinity], 'Infinity', 'Infinity', 'Infinity', ['Infinity', Infinity], 'Infinity' @@ -874,7 +874,7 @@ describe('Message test suite', function() { expect(message.getDefaultDoubleField()).toBePositiveInfinity(); }); - it('testBooleansAreConvertedFromNumberInput', function() { + it('testBooleansAreConvertedFromNumberInput', () => { let message = new proto.jspb.test.BooleanFields([1, 1, [true, 1]]); expect(message.getOptionalBooleanField()).toBeTrue(); expect(message.getRequiredBooleanField()).toBeTrue(); @@ -889,7 +889,7 @@ describe('Message test suite', function() { expect(message.getRepeatedBooleanFieldList()[1]).toBeFalse(); }); - it('testExtensionReverseOrder', function() { + it('testExtensionReverseOrder', () => { const message2 = new proto.jspb.exttest.reverse.TestExtensionReverseOrderMessage2; @@ -911,7 +911,7 @@ describe('Message test suite', function() { expect(message2.getExtension(proto.jspb.exttest.reverse.c)).toEqual(23333); }); - it('testCircularDepsBaseOnMessageField', function() { + it('testCircularDepsBaseOnMessageField', () => { const nestMessage1 = new proto.jspb.circulartest.MessageField1; const nestMessage2 = new proto.jspb.circulartest.MessageField2; const message1 = new proto.jspb.circulartest.MessageField1; @@ -928,7 +928,7 @@ describe('Message test suite', function() { }); - it('testCircularDepsBaseOnRepeatedMessageField', function() { + it('testCircularDepsBaseOnRepeatedMessageField', () => { const nestMessage1 = new proto.jspb.circulartest.RepeatedMessageField1; const nestMessage2 = new proto.jspb.circulartest.RepeatedMessageField2; const message1 = new proto.jspb.circulartest.RepeatedMessageField1; @@ -944,7 +944,7 @@ describe('Message test suite', function() { expect(message2.getBList()[0].getA()).toEqual(1); }); - it('testCircularDepsBaseOnMapField', function() { + it('testCircularDepsBaseOnMapField', () => { const nestMessage1 = new proto.jspb.circulartest.MapField1; const nestMessage2 = new proto.jspb.circulartest.MapField2; const message1 = new proto.jspb.circulartest.MapField1; @@ -960,7 +960,7 @@ describe('Message test suite', function() { expect(message2.getBMap().get(1).getA()).toEqual(1); }); - it('testCircularDepsBaseOnNestedMessage', function() { + it('testCircularDepsBaseOnNestedMessage', () => { const nestMessage1 = new proto.jspb.circulartest.NestedMessage1.NestedNestedMessage; const nestMessage2 = new proto.jspb.circulartest.NestedMessage2; @@ -977,7 +977,7 @@ describe('Message test suite', function() { expect(message2.getB().getA()).toEqual(1); }); - it('testCircularDepsBaseOnNestedEnum', function() { + it('testCircularDepsBaseOnNestedEnum', () => { const nestMessage2 = new proto.jspb.circulartest.NestedEnum2; const message1 = new proto.jspb.circulartest.NestedEnum1; const message2 = new proto.jspb.circulartest.NestedEnum2; @@ -992,7 +992,7 @@ describe('Message test suite', function() { .toEqual(proto.jspb.circulartest.NestedEnum1.NestedNestedEnum.VALUE_1); }); - it('testCircularDepsBaseOnExtensionContainingType', function() { + it('testCircularDepsBaseOnExtensionContainingType', () => { const nestMessage2 = new proto.jspb.circulartest.ExtensionContainingType2; const message1 = new proto.jspb.circulartest.ExtensionContainingType1; @@ -1008,7 +1008,7 @@ describe('Message test suite', function() { .toEqual(1); }); - it('testCircularDepsBaseOnExtensionField', function() { + it('testCircularDepsBaseOnExtensionField', () => { const nestMessage2 = new proto.jspb.circulartest.ExtensionField2; const message1 = new proto.jspb.circulartest.ExtensionField1; const message3 = new proto.jspb.circulartest.ExtensionField3; @@ -1024,7 +1024,7 @@ describe('Message test suite', function() { .toEqual(2); }); - it('testSameMessageNameOuputs', function() { + it('testSameMessageNameOuputs', () => { const package1Message = new proto.jspb.filenametest.package1.TestMessage; const package2Message = new proto.jspb.filenametest.package2.TestMessage; @@ -1040,7 +1040,7 @@ describe('Message test suite', function() { }); - it('testMessageWithLargeFieldNumbers', function() { + it('testMessageWithLargeFieldNumbers', () => { const message = new proto.jspb.test.MessageWithLargeFieldNumbers; message.setAString('string'); From c6fb31473f9a8a6a24058b42dfe4a528314559a8 Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Thu, 6 Oct 2022 10:49:12 -0700 Subject: [PATCH 8/9] Remove remaining assert functions from global namespace doAssertFailure was mistakenly glossed over. Now namespaced and set to private. subs is dead code, so just removed it. --- asserts.js | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/asserts.js b/asserts.js index 2d70da5..350f2a5 100644 --- a/asserts.js +++ b/asserts.js @@ -11,29 +11,6 @@ goog.provide('jspb.asserts'); -/** - * Does simple python-style string substitution. - * subs("foo%s hot%s", "bar", "dog") becomes "foobar hotdog". - * @param {string} pattern The string containing the pattern. - * @param {!Array<*>} subs The items to substitute into the pattern. - * @return {string} A copy of `str` in which each occurrence of - * `%s` has been replaced an argument from `var_args`. - */ -function subs(pattern, subs) { - const splitParts = pattern.split('%s'); - let returnString = ''; - - // Replace up to the last split part. We are inserting in the - // positions between split parts. - const subLast = splitParts.length - 1; - for (let i = 0; i < subLast; i++) { - // keep unsupplied as '%s' - const sub = (i < subs.length) ? subs[i] : '%s'; - returnString += splitParts[i] + sub; - } - return returnString + splitParts[subLast]; -} - /** * Throws an exception with the given message and "Assertion failed" prefixed * onto it. @@ -43,7 +20,7 @@ function subs(pattern, subs) { * @param {!Array<*>} givenArgs The substitution arguments for givenMessage. * @throws {Error} When the value is not a number. */ -function doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) { +jspb.asserts.doAssertFailure = function(defaultMessage, defaultArgs, givenMessage, givenArgs) { let message = 'Assertion failed'; let args; if (givenMessage) { @@ -72,7 +49,7 @@ function doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) { jspb.asserts.assert = function(condition, opt_message, ...args) { if (!condition) { - doAssertFailure('', null, opt_message, args); + jspb.asserts.doAssertFailure('', null, opt_message, args); } return condition; }; @@ -88,7 +65,7 @@ jspb.asserts.assert = function(condition, opt_message, ...args) { */ jspb.asserts.assertString = function(value, opt_message, ...args) { if (typeof value !== 'string') { - doAssertFailure( + jspb.asserts.doAssertFailure( 'Expected string but got %s: %s.', [goog.typeOf(value), value], opt_message, args); } @@ -106,7 +83,7 @@ jspb.asserts.assertString = function(value, opt_message, ...args) { */ jspb.asserts.assertArray = function(value, opt_message, ...args) { if (!Array.isArray(value)) { - doAssertFailure( + jspb.asserts.doAssertFailure( 'Expected array but got %s: %s.', [goog.typeOf(value), value], opt_message, args); } @@ -155,7 +132,7 @@ jspb.asserts.fail = function(opt_message, ...args) { */ jspb.asserts.assertInstanceof = function(value, type, opt_message, ...args) { if (!(value instanceof type)) { - doAssertFailure( + jspb.assert.doAssertFailure( 'Expected instanceof %s but got %s.', [getType(type), getType(value)], opt_message, args); } From 864e80f26d388e0fbb2d7fe6063789976842615f Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Thu, 6 Oct 2022 11:06:08 -0700 Subject: [PATCH 9/9] Remove getType in jspb.asserts from global namespace --- asserts.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/asserts.js b/asserts.js index 350f2a5..b4a1e5f 100644 --- a/asserts.js +++ b/asserts.js @@ -133,7 +133,8 @@ jspb.asserts.fail = function(opt_message, ...args) { jspb.asserts.assertInstanceof = function(value, type, opt_message, ...args) { if (!(value instanceof type)) { jspb.assert.doAssertFailure( - 'Expected instanceof %s but got %s.', [getType(type), getType(value)], + 'Expected instanceof %s but got %s.', + [jspb.asserts.getType(type), jspb.asseerts.getType(value)], opt_message, args); } return value; @@ -144,8 +145,9 @@ jspb.asserts.assertInstanceof = function(value, type, opt_message, ...args) { * string cannot be found, 'unknown type name' will be returned. * @param {*} value A constructor, object, or primitive. * @return {string} The best display name for the value, or 'unknown type name'. + * @private */ -function getType(value) { +jspb.asserts.getType = function(value) { if (value instanceof Function) { return value.displayName || value.name || 'unknown type name'; } else if (value instanceof Object) {