Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cache-list/lib/AmpCaches.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AmpCaches {
}

/**
* Retrieves the cache instance that maches the cacheId.
* Retrieves the cache instance that matches the cacheId.
*
* @param {string} cacheId The id of the cache to be retrieved.
* @returns {Promise<object>} the Cache which the matching id or undefined, if a cache with the
Expand Down
2 changes: 1 addition & 1 deletion packages/linter/src/rules/VideosAreSubtitled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class VideosAreSubtitled extends Rule {

//Are there any <amp-video> tags? If so, is there at least 1 <track>?
return numOfVideoElems > 0 && numOfSubtitleElems <= 0
? this.warn(`One or more videos are missing HMTL subtitles`)
? this.warn(`One or more videos are missing HTML subtitles`)
: this.pass();
}
meta() {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizer-docker/spec/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Server integration tests', () => {
});
});

it('should run the provided HTML throught the optimizer', async () => {
it('should run the provided HTML through the optimizer', async () => {
const {body} = await request({body: VALID_REQUEST, query: {canonical: 'http://example.com'}});
expect(body).toMatch('<!doctype html>');
expect(body).toMatch('<link data-auto rel="canonical" href="http://example.com">');
Expand Down
6 changes: 3 additions & 3 deletions packages/optimizer-express/lib/AmpOptimizeMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AmpOptimizerMiddleware {
return;
}

// This is a request for the canonical URL. Setup the middelware to transform the
// This is a request for the canonical URL. Setup the middleware to transform the
// response using amp-optimizer.
const chunks = [];

Expand Down Expand Up @@ -78,7 +78,7 @@ class AmpOptimizerMiddleware {
chunks.push(chunk);
}

// If end is called withouth any chunks, end the request.
// If end is called without any chunks, end the request.
if (chunks.length === 0) {
res.end();
return;
Expand All @@ -104,7 +104,7 @@ class AmpOptimizerMiddleware {
* Javascript or CSS file.
*
* @param {Request} req the request to be checked.
* @returns {boolean} true if the reqeust is for a resource.
* @returns {boolean} true if the request is for a resource.
*/
static isResourceRequest_(req) {
// Checks if mime-type for request is text/html. If mime type is unknown, assume text/html,
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizer-express/spec/lib/UrlMappingSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('UrlMapping', () => {
expect(result).toBe(true);
});

it('correcty identifies non-AMP urls', () => {
it('correctly identifies non-AMP urls', () => {
const result = urlMapping.isAmpUrl('/page');
expect(result).toBe(false);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizer/lib/DomTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const fetchRuntimeParameters = require('./fetchRuntimeParameters');
const cache = require('./cache');

/**
* AMP Optimizer Configuration only applying AMP validity perserving transformations.
* AMP Optimizer Configuration only applying AMP validity preserving transformations.
*/
const TRANSFORMATIONS_AMP_FIRST = [
// Adds missing AMP tags
Expand Down
4 changes: 2 additions & 2 deletions packages/optimizer/lib/ParseLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const SIZE_DEFINED_LAYOUTS = [
];
const CSS_LENGTH_ONE_PX = cssLength('1', false, false);
const CSS_LENGTH_AUTO = cssLength('auto', true, false);
const CSS_LENGTH_FOURTY_FOUR_PX = cssLength('44px', false, false);
const CSS_LENGTH_FORTY_FOUR_PX = cssLength('44px', false, false);
const CSS_LENGTH_SIXTY_PX = cssLength('60px', false, false);

function getLayoutClass(layout) {
Expand All @@ -62,7 +62,7 @@ function calculateHeight(inputLayout, inputHeight, tagName) {
case 'amp-pixel':
return CSS_LENGTH_ONE_PX;
case 'amp-social-share':
return CSS_LENGTH_FOURTY_FOUR_PX;
return CSS_LENGTH_FORTY_FOUR_PX;
default:
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class AddBlurryImagePlaceholders {
this.cache_ = new Map();
} else if (maxCacheSize > 0) {
const LRU = require('lru-cache');
this.log_.debug('using LRU cache for regularily used placeholders', maxCacheSize);
this.log_.debug('using LRU cache for regularly used placeholders', maxCacheSize);
// use a LRU cache otherwise
this.cache_ = new LRU({
max: maxCacheSize,
Expand Down
6 changes: 3 additions & 3 deletions packages/optimizer/lib/transformers/AutoExtensionImporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ const manualExtensions = Array.from(manualAttributeToExtensionMapping.values());
*
* - use validation rules to map used AMP tags to required AMP extensions.
* - use validation rules to map used AMP attributes to required AMP extensions.
* - manually specifiy attribute to extension mappings if this information is not available in the
* - manually specify attribute to extension mappings if this information is not available in the
* validation rules.
* - mnullay implement AMP extension detection for a few corner cases.
* - manually implement AMP extension detection for a few corner cases.
*
* This importer also enables a shortcode `bindtext` instead of `data-amp-bind-text` for specifying
* AMP bindings when the square bracket notation (`[text]`) is not available. To avoid accidently
* AMP bindings when the square bracket notation (`[text]`) is not available. To avoid accidentally
* rewriting non-AMP attributes, the transformer uses the AMP validation rules to only rename bindable
* attributes as specified in the validation rules.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizer/lib/transformers/OptimizeImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SrcsetWidth {
}

/**
* Sets the base width, i.e., renderered dimension measured in CSS pixels.
* Sets the base width, i.e., rendered dimension measured in CSS pixels.
* Returns true if srcset is needed, that is, we'll resize the image to at
* least 2 supported widths (@see SRCSET_WIDTH for a list of supported widths).
*
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizer/lib/transformers/PreloadHeroImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

'use strict';

/* This transfomer has been deprecated, use OptimizeHeroImages.js instead */
/* This transformer has been deprecated, use OptimizeHeroImages.js instead */

/** @module PreloadHeroImage */
module.exports = require('./OptimizeHeroImages');
2 changes: 1 addition & 1 deletion packages/optimizer/lib/transformers/PreloadImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const MAX_PRELOADED_IMAGES = 5;
*
* This transformer supports the following option:
*
* * `imagePreloadCount`: specifies the maxinum number of images to preload. The default is 5.
* * `imagePreloadCount`: specifies the maximum number of images to preload. The default is 5.
*/
class PreloadImages {
transform(root, params) {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizer/lib/transformers/RewriteAmpUrls.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class RewriteAmpUrls {
node = node.nextSibling;
}

// process preloads later to avoid accidently rewriting the URL
// process preloads later to avoid accidentally rewriting the URL
for (const preload of preloads) {
if (preload) {
insertAfter(head, preload, referenceNode);
Expand Down
6 changes: 3 additions & 3 deletions packages/optimizer/spec/transformers/TransformerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ log.verbose();
const {getDirectories} = require('../helpers/Utils.js');
const createSpec = require('../helpers/TransformerRunner.js');

describe('Transfomers', () => {
describe('Transformers', () => {
['experimental', 'valid'].forEach((subDir) => {
loadTestConfigs(subDir).forEach(createSpec);
});
});

function loadTestConfigs(subDir) {
const transfomerTestDirs = getDirectories(join(__dirname, subDir));
return transfomerTestDirs.map((testDir) => {
const transformerTestDirs = getDirectories(join(__dirname, subDir));
return transformerTestDirs.map((testDir) => {
const transformerName = basename(testDir);
const transformerPath = join('../../lib/transformers', transformerName + '.js');

Expand Down
2 changes: 1 addition & 1 deletion packages/page-experience/lib/PageDataGatherer.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class PageAnalyzer {
request.resourceType() === 'script' &&
!request.url().startsWith('https://cdn.ampproject.org')
) {
// Only donwload AMP runtime scripts as they're need for layouting the page
// Only download AMP runtime scripts as they're need for layouting the page
// Once self-hosting is a thing we'll have to change this
// TODO: investigate whether we could cache these locally
return request.abort();
Expand Down
2 changes: 1 addition & 1 deletion packages/page-experience/lib/checks/earlyIframes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const earlyIframes = (pageData, result) => {
}

result.warn({
title: 'Avoid iframes at the begining of pages',
title: 'Avoid iframes at the beginning of pages',
message:
'You have iframes at the top of your page - move them below the initial viewport to improve your loading time',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
}
},
"earlyIframes": {
"title": "Avoid iframes at the begining of pages",
"title": "Avoid iframes at the beginning of pages",
"message": "You have iframes at the top of your page - move them below the initial viewport to improve your loading time",
"status": "WARN"
}
}
}
Loading