chordsheetjs 5.0.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/d7b54993c4ea66c07a35bd36690482ab620f836e.patch +105 -0
- package/lib/chord.js +118 -13
- package/lib/chord_sheet/chord_lyrics_pair.js +1 -1
- package/lib/chord_sheet/chord_pro/composite.js +1 -1
- package/lib/chord_sheet/chord_pro/evaluation_error.js +7 -3
- package/lib/chord_sheet/chord_pro/literal.js +1 -1
- package/lib/chord_sheet/chord_pro/ternary.js +1 -1
- package/lib/chord_sheet/comment.js +1 -1
- package/lib/chord_sheet/line.js +1 -1
- package/lib/chord_sheet/metadata.js +1 -1
- package/lib/chord_sheet/paragraph.js +1 -1
- package/lib/chord_sheet/song.js +9 -5
- package/lib/chord_sheet/tag.js +10 -3
- package/lib/chord_sheet_serializer.js +1 -1
- package/lib/constants.js +6 -2
- package/lib/formatter/chord_pro_formatter.js +1 -1
- package/lib/formatter/html_div_formatter.js +4 -4
- package/lib/formatter/html_formatter.js +3 -2
- package/lib/formatter/html_table_formatter.js +4 -4
- package/lib/formatter/templates/html_div_formatter.js +31 -32
- package/lib/formatter/templates/html_table_formatter.js +7 -6
- package/lib/formatter/text_formatter.js +25 -17
- package/lib/helpers.js +32 -0
- package/lib/index.js +1 -1
- package/lib/key.js +103 -32
- package/lib/note.js +154 -27
- package/lib/parser/chord_pro_parser.js +1 -1
- package/lib/parser/chord_pro_peg_parser.js +22 -13
- package/lib/parser/chord_sheet_parser.js +1 -1
- package/lib/parser/parser_warning.js +1 -1
- package/lib/parser/ultimate_guitar_parser.js +3 -3
- package/lib/{handlebars_helpers.js → template_helpers.js} +21 -2
- package/lib/utilities.js +3 -17
- package/package.json +5 -4
package/lib/utilities.js
CHANGED
|
@@ -4,18 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.deprecate = deprecate;
|
|
7
|
-
exports.
|
|
7
|
+
exports.hasChordContents = void 0;
|
|
8
8
|
exports.isEmptyString = isEmptyString;
|
|
9
9
|
exports.pushNew = exports.presence = exports.padLeft = exports.isPresent = exports.isEvaluatable = void 0;
|
|
10
10
|
exports.scopeCss = scopeCss;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _tag = _interopRequireDefault(require("./chord_sheet/tag"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
12
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
19
13
|
|
|
20
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
15
|
|
|
@@ -39,7 +33,7 @@ exports.pushNew = pushNew;
|
|
|
39
33
|
|
|
40
34
|
var hasChordContents = function hasChordContents(line) {
|
|
41
35
|
return line.items.some(function (item) {
|
|
42
|
-
return item
|
|
36
|
+
return !!item.chords;
|
|
43
37
|
});
|
|
44
38
|
};
|
|
45
39
|
|
|
@@ -51,14 +45,6 @@ var isEvaluatable = function isEvaluatable(item) {
|
|
|
51
45
|
|
|
52
46
|
exports.isEvaluatable = isEvaluatable;
|
|
53
47
|
|
|
54
|
-
var hasTextContents = function hasTextContents(line) {
|
|
55
|
-
return line.items.some(function (item) {
|
|
56
|
-
return item instanceof _chord_lyrics_pair["default"] && item.lyrics || item instanceof _tag["default"] && item.isRenderable() || isEvaluatable(item);
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
exports.hasTextContents = hasTextContents;
|
|
61
|
-
|
|
62
48
|
var padLeft = function padLeft(str, length) {
|
|
63
49
|
var paddedString = str;
|
|
64
50
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chordsheetjs",
|
|
3
3
|
"author": "Martijn Versluis",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.3.0",
|
|
5
5
|
"description": "A JavaScript library for parsing and formatting chord sheets",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -15,16 +15,17 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@babel/cli": "^7.10.1",
|
|
17
17
|
"@babel/core": "^7.10.2",
|
|
18
|
+
"@babel/eslint-parser": "^7.16.3",
|
|
18
19
|
"@babel/plugin-transform-runtime": "^7.10.1",
|
|
19
20
|
"@babel/preset-env": "^7.10.2",
|
|
20
|
-
"babel-eslint": "^10.1.0",
|
|
21
21
|
"babel-plugin-handlebars-inline-precompile": "^2.1.1",
|
|
22
|
-
"eslint": "^
|
|
22
|
+
"eslint": "^8.3.0",
|
|
23
23
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
24
24
|
"eslint-plugin-import": "^2.21.2",
|
|
25
25
|
"jest": "^27.0.1",
|
|
26
26
|
"jsdoc-to-markdown": "^7.1.0",
|
|
27
|
-
"pegjs": "^0.10.0"
|
|
27
|
+
"pegjs": "^0.10.0",
|
|
28
|
+
"print": "^1.2.0"
|
|
28
29
|
},
|
|
29
30
|
"scripts": {
|
|
30
31
|
"jest": "jest",
|