Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ampproject/toolbox-linter

Package Overview
Dependencies
Maintainers
8
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ampproject/toolbox-linter - npm Package Compare versions

Comparing version 2.5.12 to 2.5.14

27

dist/rules/StoryMetadataThumbnailsAreOk.js

@@ -25,6 +25,6 @@ "use strict";

isLandscape: " a 4:3 aspect ratio",
isAtLeast80x80: " at least 80x80px [96px+ recommended]",
isAtLeast80x80: " at least 96x96 or larger",
isAtLeast640x640: " 640x640px or larger",
isAtLeast480x640: " 480x640px or larger [640x853px+ recommended]",
isAtLeast640x480: " 640x480px or larger",
isAtLeast640x853: " 640x853px or larger",
isAtLeast853x640: " 853x640px or larger",
};

@@ -35,3 +35,3 @@ class StoryMetadataThumbnailsAreOk extends rule_1.Rule {

// https://amp.dev/documentation/components/amp-story/#poster-guidelines-for-poster-portrait-src-poster-landscape-src-and-poster-square-src
// Last Updated: June 8th, 2020
// Last Updated: July 8th, 2020
function isSquare({ width, height }) {

@@ -49,4 +49,4 @@ return width > 0.9 * height && width < 1.1 * height;

}
function isAtLeast80x80({ width, height }) {
return width >= 80 && height >= 80;
function isAtLeast96x96({ width, height }) {
return width >= 96 && height >= 96;
}

@@ -56,7 +56,7 @@ function isAtLeast640x640({ width, height }) {

}
function isAtLeast480x640({ width, height }) {
return width >= 480 && height >= 640;
function isAtLeast640x853({ width, height }) {
return width >= 640 && height >= 853;
}
function isAtLeast640x480({ width, height }) {
return width >= 640 && height >= 480;
function isAtLeast853x640({ width, height }) {
return width >= 853 && height >= 640;
}

@@ -93,3 +93,2 @@ const metadata = inlineMetadata(context.$);

});
console.log("here ", failed);
//Remove the last ' and' + tack on the src

@@ -100,7 +99,7 @@ m = m.slice(0, m.length - 4) + `\nsrc: ${url}`;

const res = [
assert("publisher-logo-src", true, [isRaster, isSquare, isAtLeast80x80]),
assert("publisher-logo-src", true, [isRaster, isSquare, isAtLeast96x96]),
assert("poster-portrait-src", true, [
isRaster,
isPortrait,
isAtLeast480x640,
isAtLeast640x853,
]),

@@ -115,3 +114,3 @@ assert("poster-square-src", false, [

isLandscape,
isAtLeast640x480,
isAtLeast853x640,
]),

@@ -118,0 +117,0 @@ ];

{
"name": "@ampproject/toolbox-linter",
"version": "2.5.12",
"version": "2.5.14",
"description": "A linter for AMP documents",

@@ -44,3 +44,3 @@ "repository": {

},
"gitHead": "19ef3dffbecac926ab5f60bb4c041f258e350237",
"gitHead": "bf92d77fd1f53c54519bf8bed2be05b0bca26004",
"devDependencies": {

@@ -47,0 +47,0 @@ "prettier": "2.0.5",

@@ -26,3 +26,3 @@ # AMP Linter

```sh <!-- markdownlint-disable MD014 -->
$ npx @ampproject/toolbox-linter https://amp.dev/
$ npx @ampproject/toolbox-cli lint https://amp.dev/
```

@@ -29,0 +29,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc