occam-file-system 5.0.13 → 5.0.15

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.
Files changed (68) hide show
  1. package/README.md +4 -4
  2. package/lib/browser.js +63 -0
  3. package/lib/constants.js +13 -1
  4. package/lib/dependencies.js +81 -0
  5. package/lib/dependency.js +89 -0
  6. package/lib/directory.js +100 -0
  7. package/lib/entries.js +228 -0
  8. package/lib/file.js +141 -0
  9. package/lib/fileNames.js +38 -0
  10. package/lib/files.js +121 -0
  11. package/lib/loadProjects.js +1 -1
  12. package/lib/loadReleases.js +18 -0
  13. package/lib/main.js +103 -0
  14. package/lib/messages.js +13 -0
  15. package/lib/mixins/bnf.js +47 -0
  16. package/lib/mixins/entries.js +31 -0
  17. package/lib/mixins/files.js +41 -0
  18. package/lib/mixins/pattern.js +47 -0
  19. package/lib/project.js +123 -0
  20. package/lib/projects.js +112 -0
  21. package/lib/release.js +127 -0
  22. package/lib/releases.js +112 -0
  23. package/lib/shortenedVersion.js +125 -0
  24. package/lib/types.js +22 -0
  25. package/lib/utilities/content.js +34 -0
  26. package/lib/utilities/filePath.js +63 -0
  27. package/lib/utilities/fileSystem.js +130 -12
  28. package/lib/utilities/files.js +95 -0
  29. package/lib/utilities/metaJSON.js +80 -0
  30. package/lib/utilities/name.js +25 -4
  31. package/lib/utilities/query.js +48 -0
  32. package/lib/version.js +163 -0
  33. package/package.json +5 -3
  34. package/src/browser.js +14 -0
  35. package/src/constants.js +3 -0
  36. package/src/dependencies.js +46 -0
  37. package/src/dependency.js +52 -0
  38. package/src/directory.js +54 -0
  39. package/src/entries.js +192 -0
  40. package/src/file.js +95 -0
  41. package/src/fileNames.js +8 -0
  42. package/src/files.js +78 -0
  43. package/src/loadProjects.js +1 -1
  44. package/src/loadReleases.js +13 -0
  45. package/src/main.js +25 -0
  46. package/src/messages.js +3 -0
  47. package/src/mixins/bnf.js +59 -0
  48. package/src/mixins/entries.js +18 -0
  49. package/src/mixins/files.js +52 -0
  50. package/src/mixins/pattern.js +59 -0
  51. package/src/project.js +92 -0
  52. package/src/projects.js +66 -0
  53. package/src/release.js +97 -0
  54. package/src/releases.js +66 -0
  55. package/src/shortenedVersion.js +109 -0
  56. package/src/types.js +4 -0
  57. package/src/utilities/content.js +12 -0
  58. package/src/utilities/filePath.js +36 -0
  59. package/src/utilities/fileSystem.js +186 -15
  60. package/src/utilities/files.js +103 -0
  61. package/src/utilities/metaJSON.js +82 -0
  62. package/src/utilities/name.js +17 -0
  63. package/src/utilities/query.js +36 -0
  64. package/src/version.js +151 -0
  65. package/lib/index.js +0 -55
  66. package/lib/utilities/pathMaps.js +0 -31
  67. package/src/index.js +0 -11
  68. package/src/utilities/pathMaps.js +0 -21
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ import { Query } from "occam-dom";
4
+
5
+ export function nodeQuery(expression) {
6
+ const query = Query.fromExpression(expression);
7
+
8
+ return function(node) {
9
+ if (node !== null) {
10
+ const nodes = query.execute(node);
11
+
12
+ node = nodes.shift() || null; ///
13
+ }
14
+
15
+ return node;
16
+ };
17
+ }
18
+
19
+ export function nodesQuery(expression) {
20
+ const query = Query.fromExpression(expression);
21
+
22
+ return function(node) {
23
+ let nodes = null;
24
+
25
+ if (node !== null) {
26
+ nodes = query.execute(node);
27
+ }
28
+
29
+ return nodes;
30
+ };
31
+ }
32
+
33
+ export default {
34
+ nodeQuery,
35
+ nodesQuery
36
+ };
package/src/version.js ADDED
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+
3
+ import { arrayUtilities } from "necessary";
4
+
5
+ const { second } = arrayUtilities;
6
+
7
+ export default class Version {
8
+ constructor(majorNumber, minorNumber, patchNumber) {
9
+ this.majorNumber = majorNumber;
10
+ this.minorNumber = minorNumber;
11
+ this.patchNumber = patchNumber;
12
+ }
13
+
14
+ getMajorNumber() {
15
+ return this.majorNumber;
16
+ }
17
+
18
+ getMinorNumber() {
19
+ return this.minorNumber;
20
+ }
21
+
22
+ getPatchNumber() {
23
+ return this.patchNumber;
24
+ }
25
+
26
+ bumpMajorNumber() {
27
+ this.majorNumber += 1;
28
+ }
29
+
30
+ bumpMinorNumber() {
31
+ this.minorNumber += 1;
32
+ }
33
+
34
+ bumpPatchNumber() {
35
+ this.patchNumber += 1;
36
+ }
37
+
38
+ toString() {
39
+ const string = `${this.majorNumber}.${this.minorNumber}.${this.patchNumber}`;
40
+
41
+ return string;
42
+ }
43
+
44
+ asNumber() {
45
+ const number = this.majorNumber * 1e12 + this.minorNumber * 1e6 + this.patchNumber * 1e0; ///
46
+
47
+ return number;
48
+ }
49
+
50
+ toJSON() {
51
+ const majorNumber = this.majorNumber,
52
+ minorNumber = this.minorNumber,
53
+ patchNumber = this.patchNumber,
54
+ json = {
55
+ majorNumber,
56
+ minorNumber,
57
+ patchNumber
58
+ };
59
+
60
+ return json;
61
+ }
62
+
63
+ static fromJSON(json) {
64
+ const { majorNumber, minorNumber, patchNumber } = json,
65
+ version = new Version(majorNumber, minorNumber, patchNumber);
66
+
67
+ return version;
68
+ }
69
+
70
+ static fromString(string) {
71
+ const majorNumber = majorNumberFromString(string),
72
+ minorNumber = minorNumberFromString(string),
73
+ patchNumber = patchNumberFromString(string),
74
+ version = new Version(majorNumber, minorNumber, patchNumber);
75
+
76
+ return version;
77
+ }
78
+
79
+ static fromVersionNumber(versionNumber) {
80
+ const number = versionNumber, ///
81
+ majorNumber = majorNumberFromNumber(number),
82
+ minorNumber = minorNumberFromNumber(number),
83
+ patchNumber = patchNumberFromNumber(number),
84
+ version = new Version(majorNumber, minorNumber, patchNumber);
85
+
86
+ return version;
87
+ }
88
+ }
89
+
90
+ function majorNumberFromNumber(number) {
91
+ const majorNumber = (number !== null) ?
92
+ Math.floor(number / 1e12) :
93
+ 0; ///
94
+
95
+ return majorNumber;
96
+ }
97
+
98
+ function minorNumberFromNumber(number) {
99
+ const minorNumber = (number !== null) ?
100
+ Math.floor(number / 1e6) :
101
+ 0; ///
102
+
103
+ return minorNumber;
104
+ }
105
+
106
+ function patchNumberFromNumber(number) {
107
+ const patchNumber = (number !== null) ?
108
+ Math.floor(number / 1e0) :
109
+ 0; ///
110
+
111
+ return patchNumber;
112
+ }
113
+
114
+ function majorNumberFromString(string) {
115
+ let majorNumber = 0;
116
+
117
+ if (string) {
118
+ const matches = string.match(/^(\d+)\.\d+\.\d+$/),
119
+ secondMatch = second(matches);
120
+
121
+ majorNumber = secondMatch; ///
122
+ }
123
+
124
+ return majorNumber;
125
+ }
126
+
127
+ function minorNumberFromString(string) {
128
+ let minorNumber = 0;
129
+
130
+ if (string) {
131
+ const matches = string.match(/^\d+\.(\d+)\.\d+$/),
132
+ secondMatch = second(matches);
133
+
134
+ minorNumber = secondMatch; ///
135
+ }
136
+
137
+ return minorNumber;
138
+ }
139
+
140
+ function patchNumberFromString(string) {
141
+ let patchNumber = 0;
142
+
143
+ if (string) {
144
+ const matches = string.match(/^\d+\.\d+\.(\d+)$/),
145
+ secondMatch = second(matches);
146
+
147
+ patchNumber = secondMatch; ///
148
+ }
149
+
150
+ return patchNumber;
151
+ }
package/lib/index.js DELETED
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- pathMapsUtilities: function() {
13
- return _pathMaps.default;
14
- },
15
- httpUtilities: function() {
16
- return _http.default;
17
- },
18
- loadFile: function() {
19
- return _loadFile.default;
20
- },
21
- saveFile: function() {
22
- return _saveFile.default;
23
- },
24
- loadFiles: function() {
25
- return _loadFiles.default;
26
- },
27
- saveFiles: function() {
28
- return _saveFiles.default;
29
- },
30
- loadProjects: function() {
31
- return _loadProjects.default;
32
- },
33
- moveProjectEntries: function() {
34
- return _moveProjectEntries.default;
35
- },
36
- removeProjectEntries: function() {
37
- return _removeProjectEntries.default;
38
- }
39
- });
40
- var _pathMaps = /*#__PURE__*/ _interopRequireDefault(require("./utilities/pathMaps"));
41
- var _http = /*#__PURE__*/ _interopRequireDefault(require("./utilities/http"));
42
- var _loadFile = /*#__PURE__*/ _interopRequireDefault(require("./loadFile"));
43
- var _saveFile = /*#__PURE__*/ _interopRequireDefault(require("./saveFile"));
44
- var _loadFiles = /*#__PURE__*/ _interopRequireDefault(require("./loadFiles"));
45
- var _saveFiles = /*#__PURE__*/ _interopRequireDefault(require("./saveFiles"));
46
- var _loadProjects = /*#__PURE__*/ _interopRequireDefault(require("./loadProjects"));
47
- var _moveProjectEntries = /*#__PURE__*/ _interopRequireDefault(require("./moveProjectEntries"));
48
- var _removeProjectEntries = /*#__PURE__*/ _interopRequireDefault(require("./removeProjectEntries"));
49
- function _interopRequireDefault(obj) {
50
- return obj && obj.__esModule ? obj : {
51
- default: obj
52
- };
53
- }
54
-
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0IHsgZGVmYXVsdCBhcyBwYXRoTWFwc1V0aWxpdGllcyB9IGZyb20gXCIuL3V0aWxpdGllcy9wYXRoTWFwc1wiO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBodHRwVXRpbGl0aWVzIH0gZnJvbSBcIi4vdXRpbGl0aWVzL2h0dHBcIjtcbmV4cG9ydCB7IGRlZmF1bHQgYXMgbG9hZEZpbGUgfSBmcm9tIFwiLi9sb2FkRmlsZVwiO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBzYXZlRmlsZSB9IGZyb20gXCIuL3NhdmVGaWxlXCI7XG5leHBvcnQgeyBkZWZhdWx0IGFzIGxvYWRGaWxlcyB9IGZyb20gXCIuL2xvYWRGaWxlc1wiO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBzYXZlRmlsZXMgfSBmcm9tIFwiLi9zYXZlRmlsZXNcIjtcbmV4cG9ydCB7IGRlZmF1bHQgYXMgbG9hZFByb2plY3RzIH0gZnJvbSBcIi4vbG9hZFByb2plY3RzXCI7XG5leHBvcnQgeyBkZWZhdWx0IGFzIG1vdmVQcm9qZWN0RW50cmllcyB9IGZyb20gXCIuL21vdmVQcm9qZWN0RW50cmllc1wiO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyByZW1vdmVQcm9qZWN0RW50cmllcyB9IGZyb20gXCIuL3JlbW92ZVByb2plY3RFbnRyaWVzXCI7XG4iXSwibmFtZXMiOlsicGF0aE1hcHNVdGlsaXRpZXMiLCJodHRwVXRpbGl0aWVzIiwibG9hZEZpbGUiLCJzYXZlRmlsZSIsImxvYWRGaWxlcyIsInNhdmVGaWxlcyIsImxvYWRQcm9qZWN0cyIsIm1vdmVQcm9qZWN0RW50cmllcyIsInJlbW92ZVByb2plY3RFbnRyaWVzIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7SUFFb0JBLGlCQUFpQjtlQUFqQkEsaUJBQWlCOztJQUNqQkMsYUFBYTtlQUFiQSxhQUFhOztJQUNiQyxRQUFRO2VBQVJBLGlCQUFROztJQUNSQyxRQUFRO2VBQVJBLGlCQUFROztJQUNSQyxTQUFTO2VBQVRBLGtCQUFTOztJQUNUQyxTQUFTO2VBQVRBLGtCQUFTOztJQUNUQyxZQUFZO2VBQVpBLHFCQUFZOztJQUNaQyxrQkFBa0I7ZUFBbEJBLDJCQUFrQjs7SUFDbEJDLG9CQUFvQjtlQUFwQkEsNkJBQW9COzs7NkRBUks7eURBQ0o7NkRBQ0w7NkRBQ0E7OERBQ0M7OERBQ0E7aUVBQ0c7dUVBQ007eUVBQ0UifQ==
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- asynchronousForEach: function() {
13
- return asynchronousForEach;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- var _necessary = require("necessary");
20
- var forEach = _necessary.asynchronousUtilities.forEach;
21
- function asynchronousForEach(pathMaps, operation, done) {
22
- forEach(pathMaps, function(pathMap, next, done, context, index) {
23
- var sourceEntryPath = pathMap.sourceEntryPath, targetEntryPath = pathMap.targetEntryPath, entryDirectory = pathMap.entryDirectory;
24
- operation(sourceEntryPath, targetEntryPath, entryDirectory, next, done, index);
25
- }, done);
26
- }
27
- var _default = {
28
- asynchronousForEach: asynchronousForEach
29
- };
30
-
31
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvcGF0aE1hcHMuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCB7IGFzeW5jaHJvbm91c1V0aWxpdGllcyB9IGZyb20gXCJuZWNlc3NhcnlcIjtcblxuY29uc3QgeyBmb3JFYWNoIH0gPSBhc3luY2hyb25vdXNVdGlsaXRpZXM7XG5cbmV4cG9ydCBmdW5jdGlvbiBhc3luY2hyb25vdXNGb3JFYWNoKHBhdGhNYXBzLCBvcGVyYXRpb24sIGRvbmUpIHtcbiAgZm9yRWFjaChcbiAgICBwYXRoTWFwcyxcbiAgICAocGF0aE1hcCwgbmV4dCwgZG9uZSwgY29udGV4dCwgaW5kZXgpID0+IHtcbiAgICAgIGNvbnN0IHsgc291cmNlRW50cnlQYXRoLCB0YXJnZXRFbnRyeVBhdGgsIGVudHJ5RGlyZWN0b3J5IH0gPSBwYXRoTWFwO1xuXG4gICAgICBvcGVyYXRpb24oc291cmNlRW50cnlQYXRoLCB0YXJnZXRFbnRyeVBhdGgsIGVudHJ5RGlyZWN0b3J5LCBuZXh0LCBkb25lLCBpbmRleCk7XG4gICAgfSxcbiAgICBkb25lXG4gICk7XG59XG5cbmV4cG9ydCBkZWZhdWx0IHtcbiAgYXN5bmNocm9ub3VzRm9yRWFjaFxufTtcbiJdLCJuYW1lcyI6WyJhc3luY2hyb25vdXNGb3JFYWNoIiwiZm9yRWFjaCIsImFzeW5jaHJvbm91c1V0aWxpdGllcyIsInBhdGhNYXBzIiwib3BlcmF0aW9uIiwiZG9uZSIsInBhdGhNYXAiLCJuZXh0IiwiY29udGV4dCIsImluZGV4Iiwic291cmNlRW50cnlQYXRoIiwidGFyZ2V0RW50cnlQYXRoIiwiZW50cnlEaXJlY3RvcnkiXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7OztJQU1nQkEsbUJBQW1CO2VBQW5CQTs7SUFZaEIsT0FFRTtlQUZGOzs7eUJBaEJzQztBQUV0QyxJQUFNLEFBQUVDLFVBQVlDLGdDQUFxQixDQUFqQ0Q7QUFFRCxTQUFTRCxvQkFBb0JHLFFBQVEsRUFBRUMsU0FBUyxFQUFFQyxJQUFJLEVBQUU7SUFDN0RKLFFBQ0VFLFVBQ0EsU0FBQ0csU0FBU0MsTUFBTUYsTUFBTUcsU0FBU0MsT0FBVTtRQUN2QyxJQUFRQyxrQkFBcURKLFFBQXJESSxpQkFBaUJDLGtCQUFvQ0wsUUFBcENLLGlCQUFpQkMsaUJBQW1CTixRQUFuQk07UUFFMUNSLFVBQVVNLGlCQUFpQkMsaUJBQWlCQyxnQkFBZ0JMLE1BQU1GLE1BQU1JO0lBQzFFLEdBQ0FKO0FBRUo7SUFFQSxXQUFlO0lBQ2JMLHFCQUFBQTtBQUNGIn0=
package/src/index.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- export { default as pathMapsUtilities } from "./utilities/pathMaps";
4
- export { default as httpUtilities } from "./utilities/http";
5
- export { default as loadFile } from "./loadFile";
6
- export { default as saveFile } from "./saveFile";
7
- export { default as loadFiles } from "./loadFiles";
8
- export { default as saveFiles } from "./saveFiles";
9
- export { default as loadProjects } from "./loadProjects";
10
- export { default as moveProjectEntries } from "./moveProjectEntries";
11
- export { default as removeProjectEntries } from "./removeProjectEntries";
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- import { asynchronousUtilities } from "necessary";
4
-
5
- const { forEach } = asynchronousUtilities;
6
-
7
- export function asynchronousForEach(pathMaps, operation, done) {
8
- forEach(
9
- pathMaps,
10
- (pathMap, next, done, context, index) => {
11
- const { sourceEntryPath, targetEntryPath, entryDirectory } = pathMap;
12
-
13
- operation(sourceEntryPath, targetEntryPath, entryDirectory, next, done, index);
14
- },
15
- done
16
- );
17
- }
18
-
19
- export default {
20
- asynchronousForEach
21
- };