From bf9a1360ade3b1374ad71fc661f3f12003beed53 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Fri, 3 Aug 2018 16:42:15 -0400 Subject: [PATCH] Misc. doxy and trivial source comment typo fixes Found via `codespell -q 3` in downstream sweethome3d --- dist/jszip.js | 28 +++++++++++------------ documentation/api_jszip/external.md | 2 +- documentation/api_jszip/generate_async.md | 2 +- documentation/api_zipobject/async.md | 2 +- documentation/examples.md | 2 +- documentation/faq.md | 2 +- index.html | 2 +- lib/compressedObject.js | 2 +- lib/generate/ZipFileWorker.js | 6 ++--- lib/object.js | 2 +- lib/reader/DataReader.js | 4 ++-- lib/utils.js | 2 +- lib/zipEntry.js | 2 +- test/asserts/file.js | 2 +- test/asserts/generate.js | 4 ++-- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dist/jszip.js b/dist/jszip.js index e53c056b..33797e92 100644 --- a/dist/jszip.js +++ b/dist/jszip.js @@ -178,7 +178,7 @@ CompressedObject.prototype = { /** * Chain the given worker with other workers to compress the content with the - * given compresion. + * given compression. * @param {GenericWorker} uncompressedWorker the worker to pipe. * @param {Object} compression the compression object. * @param {Object} compressionOptions the options to use when compressing. @@ -484,7 +484,7 @@ var generateDosExternalFileAttr = function (dosPermissions, isDir) { /** * Generate the various parts used in the construction of the final zip file. - * @param {Object} streamInfo the hash with informations about the compressed file. + * @param {Object} streamInfo the hash with information about the compressed file. * @param {Boolean} streamedContent is the content streamed ? * @param {Boolean} streamingEnded is the stream finished ? * @param {number} offset the current offset from the start of the zip file. @@ -707,7 +707,7 @@ var generateCentralDirectoryEnd = function (entriesCount, centralDirLength, loca /** * Generate data descriptors for a file entry. - * @param {Object} streamInfo the hash generated by a worker, containing informations + * @param {Object} streamInfo the hash generated by a worker, containing information * on the file entry. * @return {String} the data descriptors. */ @@ -759,7 +759,7 @@ function ZipFileWorker(streamFiles, comment, platform, encodeFileName) { // The total number of entries in this zip file. this.entriesCount = 0; // the name of the file currently being added, null when handling the end of the zip file. - // Used for the emited metadata. + // Used for the emitted metadata. this.currentFile = null; @@ -1667,7 +1667,7 @@ var out = { opts.type = opts.type.toLowerCase(); opts.compression = opts.compression.toUpperCase(); - // "binarystring" is prefered but the internals use "string". + // "binarystring" is preferred but the internals use "string". if(opts.type === "binarystring") { opts.type = "string"; } @@ -1876,9 +1876,9 @@ DataReader.prototype = { // see implementations }, /** - * Find the last occurence of a zip signature (4 bytes). + * Find the last occurrence of a zip signature (4 bytes). * @param {string} sig the signature to find. - * @return {number} the index of the last occurence, -1 if not found. + * @return {number} the index of the last occurrence, -1 if not found. */ lastIndexOfSignature: function(sig) { // see implementations @@ -3122,7 +3122,7 @@ function stringToArrayLike(str, array) { /** * An helper for the function arrayLikeToString. - * This contains static informations and functions that + * This contains static information and functions that * can be optimized by the browser JIT compiler. */ var arrayToStringHelper = { @@ -3862,7 +3862,7 @@ ZipEntry.prototype = { reader.skip(localExtraFieldsLength); if (this.compressedSize === -1 || this.uncompressedSize === -1) { - throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize === -1 || uncompressedSize === -1)"); + throw new Error("Bug or corrupted zip : didn't get enough information from the central directory " + "(compressedSize === -1 || uncompressedSize === -1)"); } compression = findCompression(this.compressionMethod); @@ -4608,7 +4608,7 @@ var Z_DEFLATED = 8; /* internal * Deflate.chunks -> Array * - * Chunks of output data, if [[Deflate#onData]] not overriden. + * Chunks of output data, if [[Deflate#onData]] not overridden. **/ /** @@ -4850,7 +4850,7 @@ Deflate.prototype.push = function (data, mode) { /** * Deflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * - chunk (Uint8Array|Array|String): output data. Type of array depends * on js engine support. When string output requested, each chunk * will be string. * @@ -4993,7 +4993,7 @@ var toString = Object.prototype.toString; /* internal * inflate.chunks -> Array * - * Chunks of output data, if [[Inflate#onData]] not overriden. + * Chunks of output data, if [[Inflate#onData]] not overridden. **/ /** @@ -5268,7 +5268,7 @@ Inflate.prototype.push = function (data, mode) { /** * Inflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * - chunk (Uint8Array|Array|String): output data. Type of array depends * on js engine support. When string output requested, each chunk * will be string. * @@ -5295,7 +5295,7 @@ Inflate.prototype.onEnd = function (status) { if (status === c.Z_OK) { if (this.options.to === 'string') { // Glue & convert here, until we teach pako to send - // utf8 alligned strings to onData + // utf8 aligned strings to onData this.result = this.chunks.join(''); } else { this.result = utils.flattenChunks(this.chunks); diff --git a/documentation/api_jszip/external.md b/documentation/api_jszip/external.md index a480972f..898e4bca 100644 --- a/documentation/api_jszip/external.md +++ b/documentation/api_jszip/external.md @@ -11,7 +11,7 @@ contains the following properties : * `Promise` : the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) implementation used. -The global object is prefered when available. +The global object is preferred when available. __Example__ diff --git a/documentation/api_jszip/generate_async.md b/documentation/api_jszip/generate_async.md index e89a4961..047dfe8a 100644 --- a/documentation/api_jszip/generate_async.md +++ b/documentation/api_jszip/generate_async.md @@ -186,7 +186,7 @@ zip.generateAsync({ If specified, this function will be called each time a chunk is pushed to the output stream (or internally accumulated). -The function takes a `metadata` object which contains informations about the +The function takes a `metadata` object which contains information about the ongoing process. __Metadata__ : the metadata are: diff --git a/documentation/api_zipobject/async.md b/documentation/api_zipobject/async.md index 47adbca3..6ab20095 100644 --- a/documentation/api_zipobject/async.md +++ b/documentation/api_zipobject/async.md @@ -44,7 +44,7 @@ zip.file("image.png").async("uint8array").then(function (u8) { If specified, this function will be called each time a chunk is pushed to the output stream (or internally accumulated). -The function takes a `metadata` object which contains informations about the +The function takes a `metadata` object which contains information about the ongoing process. __Metadata__ : the metadata are : diff --git a/documentation/examples.md b/documentation/examples.md index 31b30b94..8ffb8798 100644 --- a/documentation/examples.md +++ b/documentation/examples.md @@ -91,7 +91,7 @@ zip.remove("photos"); // by removing the folder, you also remove its content. With `.generateAsync(options)` or `.generateNodeStream(options)` you can generate a zip file (not a real file but its representation in memory). Check [this page]({{site.baseurl}}/documentation/howto/write_zip.html) for more -informations on how to write / give the file to the user. +information on how to write / give the file to the user. ```js var promise = null; diff --git a/documentation/faq.md b/documentation/faq.md index 28d93f9f..b13a59a9 100644 --- a/documentation/faq.md +++ b/documentation/faq.md @@ -15,7 +15,7 @@ decode the binary content as a text and corrupt it. See That happens if you try to handle to much data with the synchronous API. If possible, try the asynchronous API, see -[this page]({{site.baseurl}}/documentation/limitations.html) for more informations. +[this page]({{site.baseurl}}/documentation/limitations.html) for more information. ### Can't read the data of [...]. Is it in a supported JavaScript type ? diff --git a/index.html b/index.html index 609e75bd..6656ed92 100644 --- a/index.html +++ b/index.html @@ -136,7 +136,7 @@

Getting help

answers to common questions.
  • - If you're looking for informations about a specific method, try the + If you're looking for information about a specific method, try the documentation.
  • diff --git a/lib/compressedObject.js b/lib/compressedObject.js index 07d369b7..d4a7f5e9 100644 --- a/lib/compressedObject.js +++ b/lib/compressedObject.js @@ -57,7 +57,7 @@ CompressedObject.prototype = { /** * Chain the given worker with other workers to compress the content with the - * given compresion. + * given compression. * @param {GenericWorker} uncompressedWorker the worker to pipe. * @param {Object} compression the compression object. * @param {Object} compressionOptions the options to use when compressing. diff --git a/lib/generate/ZipFileWorker.js b/lib/generate/ZipFileWorker.js index 55c9348f..4c7a6112 100644 --- a/lib/generate/ZipFileWorker.js +++ b/lib/generate/ZipFileWorker.js @@ -70,7 +70,7 @@ var generateDosExternalFileAttr = function (dosPermissions, isDir) { /** * Generate the various parts used in the construction of the final zip file. - * @param {Object} streamInfo the hash with informations about the compressed file. + * @param {Object} streamInfo the hash with information about the compressed file. * @param {Boolean} streamedContent is the content streamed ? * @param {Boolean} streamingEnded is the stream finished ? * @param {number} offset the current offset from the start of the zip file. @@ -293,7 +293,7 @@ var generateCentralDirectoryEnd = function (entriesCount, centralDirLength, loca /** * Generate data descriptors for a file entry. - * @param {Object} streamInfo the hash generated by a worker, containing informations + * @param {Object} streamInfo the hash generated by a worker, containing information * on the file entry. * @return {String} the data descriptors. */ @@ -345,7 +345,7 @@ function ZipFileWorker(streamFiles, comment, platform, encodeFileName) { // The total number of entries in this zip file. this.entriesCount = 0; // the name of the file currently being added, null when handling the end of the zip file. - // Used for the emited metadata. + // Used for the emitted metadata. this.currentFile = null; diff --git a/lib/object.js b/lib/object.js index 3b9de579..1c9d8e80 100644 --- a/lib/object.js +++ b/lib/object.js @@ -335,7 +335,7 @@ var out = { opts.type = opts.type.toLowerCase(); opts.compression = opts.compression.toUpperCase(); - // "binarystring" is prefered but the internals use "string". + // "binarystring" is preferred but the internals use "string". if(opts.type === "binarystring") { opts.type = "string"; } diff --git a/lib/reader/DataReader.js b/lib/reader/DataReader.js index c6e51afa..c4e1e03b 100644 --- a/lib/reader/DataReader.js +++ b/lib/reader/DataReader.js @@ -83,9 +83,9 @@ DataReader.prototype = { // see implementations }, /** - * Find the last occurence of a zip signature (4 bytes). + * Find the last occurrence of a zip signature (4 bytes). * @param {string} sig the signature to find. - * @return {number} the index of the last occurence, -1 if not found. + * @return {number} the index of the last occurrence, -1 if not found. */ lastIndexOfSignature: function(sig) { // see implementations diff --git a/lib/utils.js b/lib/utils.js index 9c64b59d..3c18dbfa 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -88,7 +88,7 @@ function stringToArrayLike(str, array) { /** * An helper for the function arrayLikeToString. - * This contains static informations and functions that + * This contains static information and functions that * can be optimized by the browser JIT compiler. */ var arrayToStringHelper = { diff --git a/lib/zipEntry.js b/lib/zipEntry.js index dca8e7c5..39afdbd3 100644 --- a/lib/zipEntry.js +++ b/lib/zipEntry.js @@ -86,7 +86,7 @@ ZipEntry.prototype = { reader.skip(localExtraFieldsLength); if (this.compressedSize === -1 || this.uncompressedSize === -1) { - throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize === -1 || uncompressedSize === -1)"); + throw new Error("Bug or corrupted zip : didn't get enough information from the central directory " + "(compressedSize === -1 || uncompressedSize === -1)"); } compression = findCompression(this.compressionMethod); diff --git a/test/asserts/file.js b/test/asserts/file.js index 9cdb0a06..6b406be8 100644 --- a/test/asserts/file.js +++ b/test/asserts/file.js @@ -247,7 +247,7 @@ QUnit.module("file", function () { if (JSZip.support.blob) { QUnit.assert.equal(err, null, testName + "no error"); QUnit.assert.ok(blob instanceof Blob, testName + "the result is a instance of Blob"); - QUnit.assert.equal(blob.type, "", testName + "the result has the rigth mime type"); + QUnit.assert.equal(blob.type, "", testName + "the result has the right mime type"); QUnit.assert.equal(blob.size, opts.rawData.length, testName + "the result has the right length"); } else { QUnit.assert.equal(blob, null, testName + "no data"); diff --git a/test/asserts/generate.js b/test/asserts/generate.js index 9e2bbc63..4830be82 100644 --- a/test/asserts/generate.js +++ b/test/asserts/generate.js @@ -149,7 +149,7 @@ testGenerateFor([{ if (JSZip.support.blob) { assert.equal(err, null, "no error"); assert.ok(result instanceof Blob, "the result is a instance of Blob"); - assert.equal(result.type, "application/zip", "the result has the rigth mime type"); + assert.equal(result.type, "application/zip", "the result has the right mime type"); assert.equal(result.size, expected.length, "the result has the right length"); } else { assert.equal(result, null, "no data"); @@ -168,7 +168,7 @@ testGenerateFor([{ if (JSZip.support.blob) { assert.equal(err, null, "no error"); assert.ok(result instanceof Blob, "the result is a instance of Blob"); - assert.equal(result.type, "application/ods", "the result has the rigth mime type"); + assert.equal(result.type, "application/ods", "the result has the right mime type"); assert.equal(result.size, expected.length, "the result has the right length"); } else { assert.equal(result, null, "no data");