amphtml-validator
Advanced tools
Comparing version 1.0.35 to 1.0.36
18
cli.js
#!/usr/bin/env node | ||
/** | ||
* @license | ||
* Copyright 2016 The AMP HTML Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS-IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the license. | ||
*/ | ||
'use strict'; | ||
const {main} = require('./index'); | ||
const {main} = require('./'); | ||
main(); | ||
#!/usr/bin/env node | ||
/** | ||
* @license | ||
* Copyright 2016 The AMP HTML Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS-IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the license. | ||
*/ | ||
@@ -29,3 +13,3 @@ 'use strict'; | ||
const ampValidator = require('./index.js'); | ||
const ampValidator = require('./'); | ||
@@ -72,4 +56,4 @@ it('deployed validator rejects the empty file', function(done) { | ||
fs.readFileSync( | ||
'../../testdata/feature_tests/minimum_valid_amp.html', 'utf-8') | ||
.trim(); | ||
'../../testdata/feature_tests/minimum_valid_amp.html', 'utf-8') | ||
.trim(); | ||
ampValidator.getInstance(/*validatorJs*/ '../../dist/validator_minified.js') | ||
@@ -92,5 +76,5 @@ .then(function(instance) { | ||
fs.readFileSync( | ||
'../../testdata/amp4ads_feature_tests/min_valid_amp4ads.html', | ||
'utf-8') | ||
.trim(); | ||
'../../testdata/amp4ads_feature_tests/min_valid_amp4ads.html', | ||
'utf-8') | ||
.trim(); | ||
ampValidator.getInstance(/*validatorJs*/ '../../dist/validator_minified.js') | ||
@@ -123,10 +107,10 @@ .then(function(instance) { | ||
fs.readFileSync( | ||
'../../testdata/feature_tests/several_errors.html', 'utf-8') | ||
.trim(); | ||
'../../testdata/feature_tests/several_errors.html', 'utf-8') | ||
.trim(); | ||
const severalErrorsOut = | ||
fs.readFileSync( | ||
'../../testdata/feature_tests/several_errors.out', 'utf-8') | ||
.split('\n') | ||
.filter(isErrorLine) | ||
.join('\n'); | ||
'../../testdata/feature_tests/several_errors.out', 'utf-8') | ||
.split('\n') | ||
.filter(isErrorLine) | ||
.join('\n'); | ||
@@ -178,4 +162,4 @@ ampValidator.getInstance(/*validatorJs*/ '../../dist/validator_minified.js') | ||
fs.readFileSync( | ||
'../../testdata/feature_tests/minimum_valid_amp.html', 'utf-8') | ||
.trim(); | ||
'../../testdata/feature_tests/minimum_valid_amp.html', 'utf-8') | ||
.trim(); | ||
const validatorJsContents = | ||
@@ -190,4 +174,4 @@ fs.readFileSync('../../dist/validator_minified.js', 'utf-8'); | ||
fs.readFileSync( | ||
'../../testdata/feature_tests/several_errors.html', 'utf-8') | ||
.trim(); | ||
'../../testdata/feature_tests/several_errors.html', 'utf-8') | ||
.trim(); | ||
const resultForSeveralErrors = ampValidator.newInstance(validatorJsContents) | ||
@@ -202,7 +186,8 @@ .validateString(severalErrorsHtml); | ||
fs.readFileSync( | ||
'../../testdata/feature_tests/several_errors.out', 'utf-8') | ||
.split('\n') | ||
.filter(isErrorLine) | ||
.splice(1) // trim 1st line | ||
.join('\n'); | ||
'../../testdata/feature_tests/several_errors.out', 'utf-8') | ||
.split('\n') | ||
.filter(isErrorLine) | ||
.splice(1) // trim 1st line | ||
.join('\n') | ||
.replace(/ \[[A-Z_]+\]/g, ''); // trim error categories | ||
execFile( | ||
@@ -267,3 +252,4 @@ process.execPath, | ||
.splice(1) // trim 1st line | ||
.join('\n'); | ||
.join('\n') | ||
.replace(/ \[[A-Z_]+\]/g, ''); // trim error categories | ||
execFile( | ||
@@ -270,0 +256,0 @@ process.execPath, |
19
index.js
@@ -1,18 +0,1 @@ | ||
/** | ||
* @license | ||
* Copyright 2016 The AMP HTML Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS-IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the license. | ||
*/ | ||
'use strict'; | ||
@@ -27,4 +10,2 @@ | ||
const Promise = require('promise'); | ||
const querystring = require('querystring'); | ||
const url = require('url'); | ||
const util = require('util'); | ||
@@ -31,0 +12,0 @@ const vm = require('vm'); |
{ | ||
"name": "amphtml-validator", | ||
"version": "1.0.35", | ||
"version": "1.0.36", | ||
"description": "Official validator for AMP HTML (www.ampproject.org)", | ||
@@ -23,8 +23,8 @@ "keywords": [ | ||
"colors": "1.4.0", | ||
"commander": "7.2.0", | ||
"promise": "8.1.0" | ||
"commander": "12.0.0", | ||
"promise": "8.3.0" | ||
}, | ||
"devDependencies": { | ||
"jasmine": "3.7.0" | ||
"jasmine": "5.1.0" | ||
} | ||
} | ||
} |
@@ -94,3 +94,3 @@ # amphtml-validator Node.js Package | ||
- Remove engine section from pacakge.json to allow any version of nodejs. | ||
- Remove engine section from package.json to allow any version of nodejs. | ||
@@ -97,0 +97,0 @@ ### 1.0.29 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31482
716
+ Addedcommander@12.0.0(transitive)
+ Addedpromise@8.3.0(transitive)
- Removedcommander@7.2.0(transitive)
- Removedpromise@8.1.0(transitive)
Updatedcommander@12.0.0
Updatedpromise@8.3.0