summaryrefslogtreecommitdiff
path: root/tools/license2rtf.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-03-01 22:47:47 -0800
committerRich Trott <rtrott@gmail.com>2019-03-04 11:06:23 -0800
commit5fa642a91750db5395d07fb2ab63e93a4bd7baad (patch)
tree5b420b0551058752ae4cbe2aeaab9dffc465545a /tools/license2rtf.js
parentc7e628f8b3b6f2b7dcb2f3d70708454ee66cbf26 (diff)
downloadandroid-node-v8-5fa642a91750db5395d07fb2ab63e93a4bd7baad.tar.gz
android-node-v8-5fa642a91750db5395d07fb2ab63e93a4bd7baad.tar.bz2
android-node-v8-5fa642a91750db5395d07fb2ab63e93a4bd7baad.zip
tools: refactor tools JS code
* standardize on arrow functions for callbacks * standaradize on trailing commas for multiline arrays PR-URL: https://github.com/nodejs/node/pull/26394 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'tools/license2rtf.js')
-rw-r--r--tools/license2rtf.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/tools/license2rtf.js b/tools/license2rtf.js
index e08cf1e5c2..817da81d7a 100644
--- a/tools/license2rtf.js
+++ b/tools/license2rtf.js
@@ -222,20 +222,12 @@ function rtfEscape(string) {
}
return string
- .replace(/[\\{}]/g, function(m) {
- return `\\${m}`;
- })
- .replace(/\t/g, function() {
- return '\\tab ';
- })
+ .replace(/[\\{}]/g, (m) => `\\${m}`)
+ .replace(/\t/g, () => '\\tab ')
// eslint-disable-next-line no-control-regex
- .replace(/[\x00-\x1f\x7f-\xff]/g, function(m) {
- return `\\'${toHex(m.charCodeAt(0), 2)}`;
- })
+ .replace(/[\x00-\x1f\x7f-\xff]/g, (m) => `\\'${toHex(m.charCodeAt(0), 2)}`)
.replace(/\ufeff/g, '')
- .replace(/[\u0100-\uffff]/g, function(m) {
- return `\\u${toHex(m.charCodeAt(0), 4)}?`;
- });
+ .replace(/[\u0100-\uffff]/g, (m) => `\\u${toHex(m.charCodeAt(0), 4)}?`);
}
/*