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 1.1.2 to 2.0.0-alpha.0

2

dist/helper.d.ts

@@ -13,3 +13,3 @@ /// <reference types="cheerio" />

export declare function buildSourceOrigin(url: string): string;
export declare function corsEndpoints($: CheerioStatic): string[];
export declare function corsEndpoints($: CheerioStatic): String[];
export declare const absoluteUrl: (s: string | undefined, base: string | undefined) => string | undefined;

@@ -16,0 +16,0 @@ export declare function fetchToCurl(url: string, init?: {

@@ -36,7 +36,15 @@ "use strict";

function corsEndpoints($) {
return []
.concat($("amp-list[src]")
const result = [];
const storyBookendSrc = $("amp-story amp-story-bookend").attr("src");
if (storyBookendSrc) {
result.push(storyBookendSrc);
}
const bookendConfigSrc = $("amp-story").attr("bookend-config-src");
if (bookendConfigSrc) {
result.push(bookendConfigSrc);
}
const ampListSrc = $("amp-list[src]")
.map((_, e) => $(e).attr("src"))
.get(), $("amp-story amp-story-bookend").attr("src"), $("amp-story").attr("bookend-config-src"))
.filter(s => !!s);
.get();
return result.concat(ampListSrc);
}

@@ -43,0 +51,0 @@ exports.corsEndpoints = corsEndpoints;

@@ -39,6 +39,6 @@ /// <reference types="cheerio" />

export interface Metadata {
"title": string;
"publisher": string;
"publisher-logo-src": string;
"poster-portrait-src": string;
"title"?: string;
"publisher"?: string;
"publisher-logo-src"?: string;
"poster-portrait-src"?: string;
"poster-square-src"?: string;

@@ -45,0 +45,0 @@ "poster-landscape-src"?: string;

@@ -63,5 +63,5 @@ "use strict";

.map((_, e) => {
const src = $(e).attr("src");
const expectedHeight = parseInt($(e).attr("height"), 10);
const expectedWidth = parseInt($(e).attr("width"), 10);
const src = $(e).attr("src") || "";
const expectedHeight = parseInt($(e).attr("height") || "", 10);
const expectedWidth = parseInt($(e).attr("width") || "", 10);
const layout = $(e).attr("layout") || "";

@@ -68,0 +68,0 @@ return test(src, layout, expectedWidth, expectedHeight);

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

};
return (await Promise.all(e.map(url => canXhrSameOrigin(helper_1.absoluteUrl(url, context.url) || "")))).filter(filter_1.notPass);
return (await Promise.all(e.map(url => canXhrSameOrigin(helper_1.absoluteUrl(url.toString(), context.url) || "")))).filter(filter_1.notPass);
}

@@ -28,0 +28,0 @@ meta() {

{
"name": "@ampproject/toolbox-linter",
"version": "1.1.2",
"version": "2.0.0-alpha.0",
"description": "A linter for AMP documents",
"repository": "https://github.com/ampproject/amp-toolbox/tree/@ampproject/toolbox-linter",
"repository": {
"type": "git",
"url": "git+https://github.com/ampproject/amp-toolbox.git",
"directory": "packages/linter"
},
"homepage": "https://github.com/ampproject/amp-toolbox/tree/master/packages/linter",
"license": "Apache-2.0",
"author": "AMPHTML Team",
"dependencies": {
"@ampproject/toolbox-cache-list": "^1.1.1",
"@ampproject/toolbox-cache-url": "^1.1.1",
"amphtml-validator": "1.0.23",
"chalk": "2.4.2",
"@ampproject/toolbox-cache-list": "^2.0.0-alpha.0",
"@ampproject/toolbox-cache-url": "^2.0.0-alpha.0",
"amphtml-validator": "1.0.29",
"chalk": "3.0.0",
"cheerio": "1.0.0-rc.2",
"commander": "3.0.2",
"commander": "4.1.0",
"debug": "4.1.1",
"execa": "3.0.0",
"execa": "4.0.0",
"node-fetch": "2.6.0",

@@ -33,3 +38,3 @@ "probe-image-size": "5.0.0",

"scripts": {
"build": "tsc --resolveJsonModule --module commonjs --target es2018 --esModuleInterop --noImplicitAny --strictNullChecks --declaration --outDir dist src/*.ts",
"build": "tsc --resolveJsonModule --module commonjs --target es2018 --esModuleInterop --strictNullChecks --declaration --outDir dist src/*.ts",
"transpile": "tsc --resolveJsonModule --module commonjs --target es2018 --esModuleInterop --noImplicitAny --strictNullChecks src/*.ts tests/*.ts",

@@ -43,8 +48,8 @@ "test": "$npm_execpath run transpile && cd tests && for t in helper.js local.js network.js ; do ( test -e $t || $npm_execpath run build ) && ( node $t | tap-parser -t ) || exit 1 ; done ; exit 0",

},
"gitHead": "e914411b6dca30b203875a6be32f2b07fcf385ed",
"gitHead": "6140009b75eaa18afeaccf0a5f1996f490dcebfb",
"devDependencies": {
"prettier": "1.18.2",
"tap-parser": "10.0.0",
"typescript": "3.6.4"
"prettier": "1.19.1",
"tap-parser": "10.0.1",
"typescript": "3.7.5"
}
}
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