@es-shims/api
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -48,3 +48,3 @@ { | ||
"disallowQuotedKeysInObjects": "allButReserved", | ||
"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, | ||
@@ -169,4 +169,10 @@ "disallowSpaceAfterObjectKeys": true, | ||
"requireNewlineBeforeSingleStatementsInIf": false | ||
"requireNewlineBeforeSingleStatementsInIf": false, | ||
"disallowUnusedVariables": true, | ||
"requireSpacesInsideImportedObjectBraces": true, | ||
"requireUseStrict": true | ||
} | ||
39
api.js
@@ -12,4 +12,7 @@ #!/usr/bin/env node | ||
var argEqualsBound = function (arg) { return arg === '--bound'; }; | ||
var argEqualsProperty = function (arg) { return arg === '--property'; }; | ||
var argEquals = function (argName) { | ||
return function (arg) { | ||
return arg === argName; | ||
}; | ||
}; | ||
var not = function (fn) { | ||
@@ -20,10 +23,13 @@ return function () { | ||
}; | ||
var isArg = function (x) { | ||
return x.slice(0, 2) === '--'; | ||
}; | ||
var isBound = args.some(argEqualsBound); | ||
var isProperty = args.some(argEqualsProperty); | ||
var makeEntries = function (name) { return [name, name]; }; | ||
var moduleNames = args | ||
.filter(not(argEqualsBound)) | ||
.filter(not(argEqualsProperty)) | ||
.map(makeEntries); | ||
var isBound = args.some(argEquals('--bound')); | ||
var isProperty = args.some(argEquals('--property')); | ||
var skipShimPolyfill = args.some(argEquals('--skip-shim-returns-polyfill')); | ||
var makeEntries = function (name) { | ||
return [name, name]; | ||
}; | ||
var moduleNames = args.filter(not(isArg)).map(makeEntries); | ||
@@ -51,3 +57,3 @@ if (moduleNames.length < 1) { | ||
}; | ||
var validateModule = function validateModule(t, nameOrFilePaths) { | ||
var validateModule = function validateAPIModule(t, nameOrFilePaths) { | ||
var name = nameOrFilePaths; | ||
@@ -60,3 +66,5 @@ var packageDir = nameOrFilePaths; | ||
var module = requireOrEvalError(name); | ||
if (module instanceof EvalError) { return module; } | ||
if (module instanceof EvalError) { | ||
return module; | ||
} | ||
var implementation = requireOrEvalError(packageDir + '/implementation'); | ||
@@ -80,3 +88,3 @@ var shim = requireOrEvalError(packageDir + '/shim'); | ||
} else { | ||
st.equal(typeof implementation, 'function', 'implementation is a function'); | ||
st.equal(typeof implementation, 'function', 'implementation is a function (pass `--property` to skip this test)'); | ||
} | ||
@@ -96,3 +104,8 @@ st.end(); | ||
if (typeof shim === 'function') { | ||
st.equal(shim(), getPolyfill(), 'shim returns polyfill'); | ||
var msg = 'shim returns polyfill (pass `--skip-shim-returns-polyfill` to skip this test)'; | ||
if (skipShimPolyfill) { | ||
st.comment('# SKIP ' + msg); | ||
} else { | ||
st.equal(shim(), getPolyfill(), msg); | ||
} | ||
} | ||
@@ -99,0 +112,0 @@ st.end(); |
@@ -0,1 +1,11 @@ | ||
1.3.0 / 2017-07-26 | ||
================== | ||
* [New] add `--skip-shim-returns-polyfill` | ||
* [Refactor] ensure `--property` test indicates how to skip it | ||
* [Refactor] skip all `--`-prefixed args. | ||
* [Refactor] consolidate `argEquals` implementations | ||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `semver`, `jscs` | ||
* [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v4.8`; improve matrix; newer npm breaks on older node | ||
* [Docs] Update shims list. | ||
1.2.0 / 2016-03-29 | ||
@@ -2,0 +12,0 @@ ================== |
{ | ||
"name": "@es-shims/api", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"author": "Jordan Harband", | ||
@@ -11,5 +11,6 @@ "description": "Loosely test a package's compliance with the es-shim API", | ||
"scripts": { | ||
"test": "npm run --silent lint", | ||
"pretest": "npm run --silent lint", | ||
"test": "npm run --silent tests-only", | ||
"posttest": "npm run --silent security", | ||
"tests-only": "npm run --silent lint", | ||
"tests-only": "echo 'no tests yet :-('", | ||
"lint": "npm run --silent jscs && npm run --silent eslint", | ||
@@ -38,13 +39,13 @@ "jscs": "jscs *.js", | ||
"dependencies": { | ||
"tape": "^4.5.1" | ||
"tape": "^4.6.0" | ||
}, | ||
"devDependencies": { | ||
"jscs": "^2.11.0", | ||
"nsp": "^2.2.2", | ||
"eslint": "^2.5.3", | ||
"@ljharb/eslint-config": "^2.2.0", | ||
"@ljharb/eslint-config": "^12.2.0", | ||
"eslint": "^4.3.0", | ||
"jscs": "^3.0.7", | ||
"make-arrow-function": "^1.1.0", | ||
"make-generator-function": "^1.1.0", | ||
"semver": "^5.1.0", | ||
"replace": "^0.3.0" | ||
"nsp": "^2.6.3", | ||
"replace": "^0.3.0", | ||
"semver": "^5.4.1" | ||
}, | ||
@@ -51,0 +52,0 @@ "testling": { |
@@ -7,2 +7,4 @@ ## Compliant Shims | ||
- `includes`: [ES7/ES2016 spec](http://tc39.github.io/ecma262/#sec-array.prototype.includes) | [repo](https://github.com/ljharb/array-includes) | [npm](https://www.npmjs.com/package/array-includes) | ||
- `Function.prototype` | ||
- `name`: [ES6/ES2015 spec](https://tc39.github.io/ecma262/#sec-built-in-function-objects) | [repo](https://github.com/ljharb/function.prototype.name) | [npm](https://www.npmjs.com/package/function.prototype.name) | ||
- `Number` | ||
@@ -15,2 +17,4 @@ - `isNaN`: [ES6/ES2015 spec](http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan) | [repo](https://github.com/ljharb/is-nan) | [npm](https://www.npmjs.com/package/is-nan) | ||
- `values`: [ES8/ES2017 proposal](https://github.com/ljharb/proposal-object-values-entries) | [repo](https://github.com/es-shims/Object.values) | [npm](https://www.npmjs.com/package/object.values) | ||
- `Promise.prototype` | ||
- `finally`: [ES8/ES2017 proposal](https://github.com/tc39/proposal-promise-finally) | [repo](https://github.com/es-shims/Promise.prototype.finally) | [npm](https://www.npmjs.com/package/promise.prototype.finally) | ||
- `RegExp.prototype` | ||
@@ -17,0 +21,0 @@ - `flags`: [ES6/ES2015 spec](http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.flags) | [repo](https://github.com/es-shims/RegExp.prototype.flags) | [npm](https://www.npmjs.com/package/regexp.prototype.flags) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
29817
12
222
Updatedtape@^4.6.0