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

@ember-template-lint/pending-utils

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ember-template-lint/pending-utils - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

9

CHANGELOG.md

@@ -0,1 +1,10 @@

## v2.1.0 (2020-10-02)
#### :rocket: Enhancement
* [#10](https://github.com/ember-template-lint/ember-template-lint-pending-utils/pull/10) Make pending lint messages map building public ([@scalvert](https://github.com/scalvert))
#### Committers: 1
- Steve Calvert ([@scalvert](https://github.com/scalvert))
## v2.0.0 (2020-10-02)

@@ -2,0 +11,0 @@

@@ -15,2 +15,8 @@ import { LintMessage, LintResult, PendingLintMessage } from './types';

export declare function buildPendingLintMessages(lintResults: LintResult[]): PendingLintMessage[];
/**
* Builds a map of fileHash, pendingLintMessage.
*
* @param pendingLintMessages The linting data for all violations.
*/
export declare function buildPendingLintMessagesMap(pendingLintMessages: PendingLintMessage[]): Map<string, PendingLintMessage>;
//# sourceMappingURL=builders.d.ts.map

15

lib/builders.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildPendingLintMessages = exports.buildPendingLintMessage = void 0;
exports.buildPendingLintMessagesMap = exports.buildPendingLintMessages = exports.buildPendingLintMessage = void 0;
const io_1 = require("./io");
/**

@@ -39,2 +40,14 @@ * Adapts an {ESLint.LintResult} or {TemplateLintResult} to a {PendingLintMessage}

exports.buildPendingLintMessages = buildPendingLintMessages;
/**
* Builds a map of fileHash, pendingLintMessage.
*
* @param pendingLintMessages The linting data for all violations.
*/
function buildPendingLintMessagesMap(pendingLintMessages) {
return new Map(pendingLintMessages.map((currentLintMessage) => {
const fileName = io_1.generateFileName(currentLintMessage);
return [fileName, currentLintMessage];
}));
}
exports.buildPendingLintMessagesMap = buildPendingLintMessagesMap;
function getEngine(result) {

@@ -41,0 +54,0 @@ return result.filePath.endsWith('.js') ? 'eslint' : 'ember-template-lint';

4

lib/index.d.ts

@@ -1,3 +0,3 @@

export { buildPendingLintMessage, buildPendingLintMessages } from './builders';
export { ensurePendingDir, getPendingDirPath, generateFileName, generatePendingFiles, readPendingFiles, getPendingBatches, _getPendingMap, } from './io';
export { buildPendingLintMessage, buildPendingLintMessages, buildPendingLintMessagesMap, } from './builders';
export { ensurePendingDir, getPendingDirPath, generateFileName, generatePendingFiles, readPendingFiles, getPendingBatches, } from './io';
//# sourceMappingURL=index.d.ts.map

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "buildPendingLintMessages", { enumerable: true, get: function () { return builders_1.buildPendingLintMessages; } });
Object.defineProperty(exports, "buildPendingLintMessagesMap", { enumerable: true, get: function () { return builders_1.buildPendingLintMessagesMap; } });
var io_1 = require("./io");

@@ -14,3 +15,2 @@ Object.defineProperty(exports, "ensurePendingDir", { enumerable: true, get: function () { return io_1.ensurePendingDir; } });

Object.defineProperty(exports, "getPendingBatches", { enumerable: true, get: function () { return io_1.getPendingBatches; } });
Object.defineProperty(exports, "_getPendingMap", { enumerable: true, get: function () { return io_1._getPendingMap; } });
//# sourceMappingURL=index.js.map

@@ -41,3 +41,2 @@ import { PendingLintMessage } from './types';

export declare function getPendingBatches(lintResults: Map<string, PendingLintMessage>, existing: Map<string, PendingLintMessage>): Promise<Map<string, PendingLintMessage>[]>;
export declare function _getPendingMap(pendingLintMessages: PendingLintMessage[]): Map<string, PendingLintMessage>;
//# sourceMappingURL=io.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports._getPendingMap = exports.getPendingBatches = exports.readPendingFiles = exports.generatePendingFiles = exports.generateFileName = exports.getPendingDirPath = exports.ensurePendingDir = void 0;
exports.getPendingBatches = exports.readPendingFiles = exports.generatePendingFiles = exports.generateFileName = exports.getPendingDirPath = exports.ensurePendingDir = void 0;
const crypto_1 = require("crypto");
const path_1 = require("path");
const fs_extra_1 = require("fs-extra");
const builders_1 = require("./builders");
/**

@@ -46,3 +47,3 @@ * Creates, or ensures the creation of, the .lint-pending directory.

const existing = await readPendingFiles(pendingDir, filePath);
const [add, remove] = await getPendingBatches(_getPendingMap(pendingLintMessages), existing);
const [add, remove] = await getPendingBatches(builders_1.buildPendingLintMessagesMap(pendingLintMessages), existing);
await _generateFiles(baseDir, add, remove);

@@ -110,9 +111,2 @@ return pendingDir;

}
function _getPendingMap(pendingLintMessages) {
return new Map(pendingLintMessages.map((currentLintMessage) => {
const fileName = generateFileName(currentLintMessage);
return [fileName, currentLintMessage];
}));
}
exports._getPendingMap = _getPendingMap;
//# sourceMappingURL=io.js.map
{
"name": "@ember-template-lint/pending-utils",
"version": "2.0.0",
"version": "2.1.0",
"repository": "https://github.com/ember-template-lint/ember-template-lint-pending-utils.git",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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