Skip to content

Commit 21d6f38

Browse files
committed
CSA 1.2.2: Correct version number and simplify
1 parent 6243ca7 commit 21d6f38

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

ChatSetAttr/1.2.2/ChatSetAttr.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// ChatSetAttr version 1.2.1
2-
// Last Updated: 2017-01-30
1+
// ChatSetAttr version 1.2.2
2+
// Last Updated: 2017-03-28
33
// A script to create, modify, or delete character attributes from the chat area or macros.
44
// If you don't like my choices for --replace, you can edit the replacers variable at your own peril to change them.
5+
56
var chatSetAttr = chatSetAttr || (function () {
67
'use strict';
7-
const version = '1.2',
8+
const version = '1.2.2',
89
schemaVersion = 3,
910
replacers = [
1011
['<', '[', /</g, /\[/g],
@@ -486,12 +487,12 @@ var chatSetAttr = chatSetAttr || (function () {
486487
// an expression of the form key|value or key|value|maxvalue
487488
// replace - true if characters from the replacers array should be replaced
488489
// Output: Object containing key|value for all expressions.
489-
let setting = args.map(str => str.split(/(\\?(?:#|\|))/g))
490-
.map(function (split) {
491-
return split.reduce(function (m, str) {
492-
if ((str === '#' || str === '|')) m[m.length] = '';
493-
else if ((str === '\\#' || str === '\\|')) m[m.length - 1] += str.slice(-1);
494-
else m[m.length - 1] += str;
490+
let setting = args.map(function (str) {
491+
return str.split(/(\\?(?:#|\|))/g)
492+
.reduce(function (m, s) {
493+
if ((s === '#' || s === '|')) m[m.length] = '';
494+
else if ((s === '\\#' || s === '\\|')) m[m.length - 1] += s.slice(-1);
495+
else m[m.length - 1] += s;
495496
return m;
496497
}, ['']);
497498
})

ChatSetAttr/ChatSetAttr.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// ChatSetAttr version 1.2.1
2-
// Last Updated: 2017-01-30
1+
// ChatSetAttr version 1.2.2
2+
// Last Updated: 2017-03-28
33
// A script to create, modify, or delete character attributes from the chat area or macros.
44
// If you don't like my choices for --replace, you can edit the replacers variable at your own peril to change them.
5+
56
var chatSetAttr = chatSetAttr || (function () {
67
'use strict';
7-
const version = '1.2',
8+
const version = '1.2.2',
89
schemaVersion = 3,
910
replacers = [
1011
['<', '[', /</g, /\[/g],
@@ -486,12 +487,12 @@ var chatSetAttr = chatSetAttr || (function () {
486487
// an expression of the form key|value or key|value|maxvalue
487488
// replace - true if characters from the replacers array should be replaced
488489
// Output: Object containing key|value for all expressions.
489-
let setting = args.map(str => str.split(/(\\?(?:#|\|))/g))
490-
.map(function (split) {
491-
return split.reduce(function (m, str) {
492-
if ((str === '#' || str === '|')) m[m.length] = '';
493-
else if ((str === '\\#' || str === '\\|')) m[m.length - 1] += str.slice(-1);
494-
else m[m.length - 1] += str;
490+
let setting = args.map(function (str) {
491+
return str.split(/(\\?(?:#|\|))/g)
492+
.reduce(function (m, s) {
493+
if ((s === '#' || s === '|')) m[m.length] = '';
494+
else if ((s === '\\#' || s === '\\|')) m[m.length - 1] += s.slice(-1);
495+
else m[m.length - 1] += s;
495496
return m;
496497
}, ['']);
497498
})

0 commit comments

Comments
 (0)