@atomist/slack-messages
Advanced tools
Comparing version 1.1.2-master.20200108150633 to 1.1.2-master.20200430150635
"use strict"; | ||
/* | ||
* Copyright © 2018 Atomist, Inc. | ||
* Copyright © 2020 Atomist, Inc. | ||
* | ||
@@ -43,4 +43,3 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
const links = {}; | ||
// tslint:disable-next-line:no-conditional-assignment | ||
while (matches = namedLinksRegExp.exec(text)) { | ||
while (matches = namedLinksRegExp.exec(text)) { // eslint-disable-line no-cond-assign | ||
const name = matches[1]; | ||
@@ -51,11 +50,9 @@ const url = matches[2]; | ||
let linked = text; | ||
for (const n in links) { | ||
if (links.hasOwnProperty(n)) { | ||
const u = links[n]; | ||
const nameRegExp = new RegExp(`\\[(.+?)\\]\\[${n}\\]|\\[${n}\\]\\[\\]`, "g"); | ||
linked = linked.replace(nameRegExp, (m, ln) => { | ||
const linkName = (ln) ? ln : n; | ||
return `[${linkName}](${u})`; | ||
}); | ||
} | ||
for (const n of Object.keys(links)) { | ||
const u = links[n]; | ||
const nameRegExp = new RegExp(`\\[(.+?)\\]\\[${n}\\]|\\[${n}\\]\\[\\]`, "g"); | ||
linked = linked.replace(nameRegExp, (m, ln) => { | ||
const linkName = (ln) ? ln : n; | ||
return `[${linkName}](${u})`; | ||
}); | ||
} | ||
@@ -62,0 +59,0 @@ return linked.replace(namedLinksRegExp, ""); |
"use strict"; | ||
/* | ||
* Copyright © 2018 Atomist, Inc. | ||
* Copyright © 2020 Atomist, Inc. | ||
* | ||
@@ -9,3 +9,3 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
@@ -122,3 +122,3 @@ * Unless required by applicable law or agreed to in writing, software | ||
if (att.actions && att.actions.length > 0 && !att.callback_id) { | ||
att.callback_id = `cllbck${idx++}`; | ||
att.callback_id = `cllbck${idx++}`; // eslint-disable-line @typescript-eslint/camelcase | ||
} | ||
@@ -125,0 +125,0 @@ }); |
{ | ||
"name": "@atomist/slack-messages", | ||
"version": "1.1.2-master.20200108150633", | ||
"version": "1.1.2-master.20200430150635", | ||
"description": "Atomist utilities for creating formatted Slack messages", | ||
@@ -29,14 +29,16 @@ "author": { | ||
"devDependencies": { | ||
"@types/mocha": "^5.2.7", | ||
"@types/power-assert": "^1.5.0", | ||
"@types/mocha": "^7.0.2", | ||
"@types/power-assert": "^1.5.3", | ||
"@typescript-eslint/eslint-plugin": "^2.30.0", | ||
"@typescript-eslint/parser": "^2.30.0", | ||
"eslint": "^6.8.0", | ||
"espower-typescript": "^9.0.2", | ||
"mocha": "^6.1.4", | ||
"mocha": "^7.1.2", | ||
"npm-run-all": "^4.1.5", | ||
"power-assert": "^1.6.1", | ||
"rimraf": "^2.6.3", | ||
"rimraf": "^3.0.2", | ||
"supervisor": "^0.12.0", | ||
"ts-node": "^8.5.4", | ||
"tslint": "^5.20.1", | ||
"typedoc": "^0.15.6", | ||
"typescript": "^3.7.4" | ||
"ts-node": "^8.9.1", | ||
"typedoc": "^0.17.6", | ||
"typescript": "^3.8.3" | ||
}, | ||
@@ -48,3 +50,3 @@ "directories": { | ||
"autotest": "supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test", | ||
"build": "run-s compile test lint doc", | ||
"build": "run-s clean compile test lint doc", | ||
"clean": "run-p clean:compile clean:doc clean:run clean:test", | ||
@@ -59,7 +61,6 @@ "clean:compile": "rimraf git-info.json \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts", | ||
"doc": "typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib", | ||
"lint": "tslint --config tslint.json --format verbose --project .", | ||
"lint": "eslint --ext .ts .", | ||
"lint:fix": "npm run lint -- --fix", | ||
"test": "mocha --require espower-typescript/guess \"test/**/*.test.ts\"", | ||
"test:one": "mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"", | ||
"typedoc": "npm run doc" | ||
"test:one": "mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"" | ||
}, | ||
@@ -66,0 +67,0 @@ "engines": { |
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
26
58760
14
634