Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2021-07-27 16:54:26 +00:00
parent 6b0d45a5c6
commit cc1adb825a
4247 changed files with 144820 additions and 149530 deletions

View file

@ -1,10 +1,10 @@
'use strict'
'use strict';
const crypto = require('crypto')
, moduleRequire = require('eslint-module-utils/module-require').default
, hashObject = require('eslint-module-utils/hash').hashObject
const crypto = require('crypto');
const moduleRequire = require('eslint-module-utils/module-require').default;
const hashObject = require('eslint-module-utils/hash').hashObject;
const cache = new Map()
const cache = new Map();
// must match ESLint default options or we'll miss the cache every time
const parserOptions = {
@ -14,28 +14,28 @@ const parserOptions = {
tokens: true,
comment: true,
attachComment: true,
}
};
exports.parse = function parse(content, options) {
options = Object.assign({}, options, parserOptions)
options = Object.assign({}, options, parserOptions);
if (!options.filePath) {
throw new Error('no file path provided!')
throw new Error('no file path provided!');
}
const keyHash = crypto.createHash('sha256')
keyHash.update(content)
hashObject(options, keyHash)
const keyHash = crypto.createHash('sha256');
keyHash.update(content);
hashObject(options, keyHash);
const key = keyHash.digest('hex')
const key = keyHash.digest('hex');
let ast = cache.get(key)
if (ast != null) return ast
let ast = cache.get(key);
if (ast != null) return ast;
const realParser = moduleRequire(options.parser)
const realParser = moduleRequire(options.parser);
ast = realParser.parse(content, options)
cache.set(key, ast)
ast = realParser.parse(content, options);
cache.set(key, ast);
return ast
}
return ast;
};

View file

@ -1,34 +0,0 @@
{
"name": "memo-parser",
"version": "0.2.1",
"engines": {
"node": ">=4"
},
"description": "Memoizing wrapper for any ESLint-compatible parser module.",
"main": "index.js",
"scripts": {
"prepublishOnly": "cp ../{LICENSE,.npmrc} ./",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/benmosher/eslint-plugin-import.git"
},
"keywords": [
"eslint",
"eslint-plugin-import",
"parser"
],
"author": "Ben Mosher (me@benmosher.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/benmosher/eslint-plugin-import/issues"
},
"homepage": "https://github.com/benmosher/eslint-plugin-import#readme",
"peerDependencies": {
"eslint": ">=3.5.0"
},
"dependencies": {
"eslint-module-utils": "^2.5.0"
}
}