neo-cmp-cli 1.8.6 → 1.8.8

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 (127) hide show
  1. package/{src → bin}/index.js +18 -13
  2. package/bin/neo.js +1 -1
  3. package/dist/_virtual/_commonjsHelpers.js +12 -0
  4. package/dist/_virtual/array-set.js +7 -0
  5. package/dist/_virtual/base64-vlq.js +7 -0
  6. package/dist/_virtual/base64.js +7 -0
  7. package/dist/_virtual/binary-search.js +7 -0
  8. package/dist/_virtual/mapping-list.js +7 -0
  9. package/dist/_virtual/quick-sort.js +7 -0
  10. package/dist/_virtual/source-map-consumer.js +7 -0
  11. package/dist/_virtual/source-map-generator.js +7 -0
  12. package/dist/_virtual/source-map-support.js +7 -0
  13. package/dist/_virtual/source-map.js +7 -0
  14. package/dist/_virtual/source-node.js +7 -0
  15. package/dist/_virtual/typescript.js +7 -0
  16. package/dist/_virtual/util.js +7 -0
  17. package/dist/config/auth.config.js +43 -0
  18. package/dist/config/default.config.js +192 -0
  19. package/dist/config/index.js +26 -0
  20. package/dist/main.js +9 -0
  21. package/dist/main2.js +259 -0
  22. package/dist/module/inspect.js +63 -0
  23. package/dist/module/neoInit.js +75 -0
  24. package/dist/module/neoInitByCopy.js +83 -0
  25. package/dist/neo/neoLogin.js +590 -0
  26. package/dist/neo/neoRequire.js +123 -0
  27. package/dist/neo/neoService.js +898 -0
  28. package/dist/node_modules/buffer-from/index.js +86 -0
  29. package/dist/node_modules/source-map/lib/array-set.js +138 -0
  30. package/dist/node_modules/source-map/lib/base64-vlq.js +157 -0
  31. package/dist/node_modules/source-map/lib/base64.js +83 -0
  32. package/dist/node_modules/source-map/lib/binary-search.js +129 -0
  33. package/dist/node_modules/source-map/lib/mapping-list.js +96 -0
  34. package/dist/node_modules/source-map/lib/quick-sort.js +130 -0
  35. package/dist/node_modules/source-map/lib/source-map-consumer.js +1166 -0
  36. package/dist/node_modules/source-map/lib/source-map-generator.js +445 -0
  37. package/dist/node_modules/source-map/lib/source-node.js +431 -0
  38. package/dist/node_modules/source-map/lib/util.js +506 -0
  39. package/dist/node_modules/source-map/source-map.js +27 -0
  40. package/dist/node_modules/source-map-support/source-map-support.js +646 -0
  41. package/dist/node_modules/typescript/lib/typescript.js +174130 -0
  42. package/dist/oss/publish2oss.js +331 -0
  43. package/dist/plugins/AddNeoRequirePlugin.js +195 -0
  44. package/dist/utils/autoEntryRootDir.js +103 -0
  45. package/dist/utils/cmpUtils/createCmpByTemplate.js +82 -0
  46. package/dist/utils/cmpUtils/createCmpByZip.js +433 -0
  47. package/dist/utils/cmpUtils/createCommonModulesCode.js +139 -0
  48. package/dist/utils/cmpUtils/deleteCmp.js +81 -0
  49. package/dist/utils/cmpUtils/getCmpModelRegisterCode.js +47 -0
  50. package/dist/utils/cmpUtils/getCmpPreviewCode.js +60 -0
  51. package/dist/utils/cmpUtils/getCmpRegisterCode.js +47 -0
  52. package/dist/utils/cmpUtils/getCmpTypeByDir.js +59 -0
  53. package/dist/utils/cmpUtils/hasCmpTypeByDir.js +27 -0
  54. package/dist/utils/cmpUtils/previewCmp.js +75 -0
  55. package/dist/utils/cmpUtils/pullCmp.js +126 -0
  56. package/dist/utils/cmpUtils/pushCmp.js +254 -0
  57. package/dist/utils/common.js +125 -0
  58. package/dist/utils/configureNeoBuild.js +129 -0
  59. package/dist/utils/generateEntries.js +80 -0
  60. package/dist/utils/neoConfigInit.js +30 -0
  61. package/dist/utils/neoParams.js +26 -0
  62. package/dist/utils/pathUtils.js +40 -0
  63. package/dist/utils/projectNameValidator.js +90 -0
  64. package/dist/utils/projectUtils/createCmpProjectByTemplate.js +81 -0
  65. package/dist/utils/projectUtils/createCmpProjectZip.js +141 -0
  66. package/dist/utils/projectUtils/getEntries.js +99 -0
  67. package/dist/utils/projectUtils/getEntriesWithAutoRegister.js +129 -0
  68. package/dist/utils/projectUtils/hasNeoProject.js +34 -0
  69. package/dist/utils/projectUtils/openProject.js +117 -0
  70. package/dist/utils/projectUtils/updatePublishLog.js +47 -0
  71. package/dist/utils/replaceInFilesByMap.js +71 -0
  72. package/dist/utils/replaceInPackage.js +151 -0
  73. package/dist/utils/resetPackageVersion.js +132 -0
  74. package/package.json +5 -5
  75. package/test/demo.js +2 -4
  76. package/test/deprecate-versions.js +1 -1
  77. package/test/neo.config.js +1 -25
  78. package/src/config/auth.config.js +0 -27
  79. package/src/config/default.config.js +0 -176
  80. package/src/config/index.js +0 -9
  81. package/src/initData/defaultTemplate.html +0 -13
  82. package/src/initData/neo.config.js +0 -138
  83. package/src/main.js +0 -206
  84. package/src/module/inspect.js +0 -41
  85. package/src/module/neoInit.js +0 -55
  86. package/src/module/neoInitByCopy.js +0 -61
  87. package/src/neo/NeoUMDContent.js +0 -30
  88. package/src/neo/neoLogin.js +0 -565
  89. package/src/neo/neoRequire.js +0 -125
  90. package/src/neo/neoService.js +0 -874
  91. package/src/neo/webpack.mf.js +0 -60
  92. package/src/neo/wrapperContent.js +0 -16
  93. package/src/oss/publish2oss.js +0 -348
  94. package/src/plugins/AddNeoRequirePlugin-v1.js +0 -47
  95. package/src/plugins/AddNeoRequirePlugin.js +0 -179
  96. package/src/plugins/README.md +0 -109
  97. package/src/utils/autoEntryRootDir.js +0 -85
  98. package/src/utils/cmpUtils/createCmpByTemplate.js +0 -60
  99. package/src/utils/cmpUtils/createCmpByZip.js +0 -408
  100. package/src/utils/cmpUtils/createCommonModulesCode.js +0 -121
  101. package/src/utils/cmpUtils/deleteCmp.js +0 -63
  102. package/src/utils/cmpUtils/getCmpModelRegisterCode.js +0 -31
  103. package/src/utils/cmpUtils/getCmpPreviewCode.js +0 -43
  104. package/src/utils/cmpUtils/getCmpRegisterCode.js +0 -31
  105. package/src/utils/cmpUtils/getCmpTypeByDir.js +0 -41
  106. package/src/utils/cmpUtils/hasCmpTypeByDir.js +0 -11
  107. package/src/utils/cmpUtils/previewCmp.js +0 -55
  108. package/src/utils/cmpUtils/pullCmp.js +0 -104
  109. package/src/utils/cmpUtils/pushCmp.js +0 -230
  110. package/src/utils/common.js +0 -107
  111. package/src/utils/configureNeoBuild.js +0 -109
  112. package/src/utils/generateEntries.js +0 -63
  113. package/src/utils/neoConfigInit.js +0 -13
  114. package/src/utils/neoParams.js +0 -12
  115. package/src/utils/pathUtils.js +0 -23
  116. package/src/utils/projectNameValidator.js +0 -76
  117. package/src/utils/projectUtils/createCmpProjectByTemplate.js +0 -59
  118. package/src/utils/projectUtils/createCmpProjectZip.js +0 -120
  119. package/src/utils/projectUtils/getEntries.js +0 -80
  120. package/src/utils/projectUtils/getEntriesWithAutoRegister.js +0 -108
  121. package/src/utils/projectUtils/hasNeoProject.js +0 -17
  122. package/src/utils/projectUtils/openProject.js +0 -94
  123. package/src/utils/projectUtils/updatePublishLog.js +0 -30
  124. package/src/utils/replaceInFiles.js +0 -47
  125. package/src/utils/replaceInFilesByMap.js +0 -54
  126. package/src/utils/replaceInPackage.js +0 -134
  127. package/src/utils/resetPackageVersion.js +0 -115
@@ -0,0 +1,86 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ /* eslint-disable node/no-deprecated-api */
6
+
7
+ var bufferFrom_1;
8
+ var hasRequiredBufferFrom;
9
+
10
+ function requireBufferFrom () {
11
+ if (hasRequiredBufferFrom) return bufferFrom_1;
12
+ hasRequiredBufferFrom = 1;
13
+ var toString = Object.prototype.toString;
14
+
15
+ var isModern = (
16
+ typeof Buffer !== 'undefined' &&
17
+ typeof Buffer.alloc === 'function' &&
18
+ typeof Buffer.allocUnsafe === 'function' &&
19
+ typeof Buffer.from === 'function'
20
+ );
21
+
22
+ function isArrayBuffer (input) {
23
+ return toString.call(input).slice(8, -1) === 'ArrayBuffer'
24
+ }
25
+
26
+ function fromArrayBuffer (obj, byteOffset, length) {
27
+ byteOffset >>>= 0;
28
+
29
+ var maxLength = obj.byteLength - byteOffset;
30
+
31
+ if (maxLength < 0) {
32
+ throw new RangeError("'offset' is out of bounds")
33
+ }
34
+
35
+ if (length === undefined) {
36
+ length = maxLength;
37
+ } else {
38
+ length >>>= 0;
39
+
40
+ if (length > maxLength) {
41
+ throw new RangeError("'length' is out of bounds")
42
+ }
43
+ }
44
+
45
+ return isModern
46
+ ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
47
+ : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
48
+ }
49
+
50
+ function fromString (string, encoding) {
51
+ if (typeof encoding !== 'string' || encoding === '') {
52
+ encoding = 'utf8';
53
+ }
54
+
55
+ if (!Buffer.isEncoding(encoding)) {
56
+ throw new TypeError('"encoding" must be a valid string encoding')
57
+ }
58
+
59
+ return isModern
60
+ ? Buffer.from(string, encoding)
61
+ : new Buffer(string, encoding)
62
+ }
63
+
64
+ function bufferFrom (value, encodingOrOffset, length) {
65
+ if (typeof value === 'number') {
66
+ throw new TypeError('"value" argument must not be a number')
67
+ }
68
+
69
+ if (isArrayBuffer(value)) {
70
+ return fromArrayBuffer(value, encodingOrOffset, length)
71
+ }
72
+
73
+ if (typeof value === 'string') {
74
+ return fromString(value, encodingOrOffset)
75
+ }
76
+
77
+ return isModern
78
+ ? Buffer.from(value)
79
+ : new Buffer(value)
80
+ }
81
+
82
+ bufferFrom_1 = bufferFrom;
83
+ return bufferFrom_1;
84
+ }
85
+
86
+ exports.__require = requireBufferFrom;
@@ -0,0 +1,138 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const arraySet = require('../../../_virtual/array-set.js');
6
+ const util = require('./util.js');
7
+
8
+ /* -*- Mode: js; js-indent-level: 2; -*- */
9
+
10
+ var hasRequiredArraySet;
11
+
12
+ function requireArraySet () {
13
+ if (hasRequiredArraySet) return arraySet.__exports;
14
+ hasRequiredArraySet = 1;
15
+ /*
16
+ * Copyright 2011 Mozilla Foundation and contributors
17
+ * Licensed under the New BSD license. See LICENSE or:
18
+ * http://opensource.org/licenses/BSD-3-Clause
19
+ */
20
+
21
+ var util$1 = util.__require();
22
+ var has = Object.prototype.hasOwnProperty;
23
+ var hasNativeMap = typeof Map !== "undefined";
24
+
25
+ /**
26
+ * A data structure which is a combination of an array and a set. Adding a new
27
+ * member is O(1), testing for membership is O(1), and finding the index of an
28
+ * element is O(1). Removing elements from the set is not supported. Only
29
+ * strings are supported for membership.
30
+ */
31
+ function ArraySet() {
32
+ this._array = [];
33
+ this._set = hasNativeMap ? new Map() : Object.create(null);
34
+ }
35
+
36
+ /**
37
+ * Static method for creating ArraySet instances from an existing array.
38
+ */
39
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
40
+ var set = new ArraySet();
41
+ for (var i = 0, len = aArray.length; i < len; i++) {
42
+ set.add(aArray[i], aAllowDuplicates);
43
+ }
44
+ return set;
45
+ };
46
+
47
+ /**
48
+ * Return how many unique items are in this ArraySet. If duplicates have been
49
+ * added, than those do not count towards the size.
50
+ *
51
+ * @returns Number
52
+ */
53
+ ArraySet.prototype.size = function ArraySet_size() {
54
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
55
+ };
56
+
57
+ /**
58
+ * Add the given string to this set.
59
+ *
60
+ * @param String aStr
61
+ */
62
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
63
+ var sStr = hasNativeMap ? aStr : util$1.toSetString(aStr);
64
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
65
+ var idx = this._array.length;
66
+ if (!isDuplicate || aAllowDuplicates) {
67
+ this._array.push(aStr);
68
+ }
69
+ if (!isDuplicate) {
70
+ if (hasNativeMap) {
71
+ this._set.set(aStr, idx);
72
+ } else {
73
+ this._set[sStr] = idx;
74
+ }
75
+ }
76
+ };
77
+
78
+ /**
79
+ * Is the given string a member of this set?
80
+ *
81
+ * @param String aStr
82
+ */
83
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
84
+ if (hasNativeMap) {
85
+ return this._set.has(aStr);
86
+ } else {
87
+ var sStr = util$1.toSetString(aStr);
88
+ return has.call(this._set, sStr);
89
+ }
90
+ };
91
+
92
+ /**
93
+ * What is the index of the given string in the array?
94
+ *
95
+ * @param String aStr
96
+ */
97
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
98
+ if (hasNativeMap) {
99
+ var idx = this._set.get(aStr);
100
+ if (idx >= 0) {
101
+ return idx;
102
+ }
103
+ } else {
104
+ var sStr = util$1.toSetString(aStr);
105
+ if (has.call(this._set, sStr)) {
106
+ return this._set[sStr];
107
+ }
108
+ }
109
+
110
+ throw new Error('"' + aStr + '" is not in the set.');
111
+ };
112
+
113
+ /**
114
+ * What is the element at the given index?
115
+ *
116
+ * @param Number aIdx
117
+ */
118
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
119
+ if (aIdx >= 0 && aIdx < this._array.length) {
120
+ return this._array[aIdx];
121
+ }
122
+ throw new Error('No element indexed by ' + aIdx);
123
+ };
124
+
125
+ /**
126
+ * Returns the array representation of this set (which has the proper indices
127
+ * indicated by indexOf). Note that this is a copy of the internal array used
128
+ * for storing the members so that no one can mess with internal state.
129
+ */
130
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
131
+ return this._array.slice();
132
+ };
133
+
134
+ arraySet.__exports.ArraySet = ArraySet;
135
+ return arraySet.__exports;
136
+ }
137
+
138
+ exports.__require = requireArraySet;
@@ -0,0 +1,157 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const base64Vlq = require('../../../_virtual/base64-vlq.js');
6
+ const base64 = require('./base64.js');
7
+
8
+ /* -*- Mode: js; js-indent-level: 2; -*- */
9
+
10
+ var hasRequiredBase64Vlq;
11
+
12
+ function requireBase64Vlq () {
13
+ if (hasRequiredBase64Vlq) return base64Vlq.__exports;
14
+ hasRequiredBase64Vlq = 1;
15
+ /*
16
+ * Copyright 2011 Mozilla Foundation and contributors
17
+ * Licensed under the New BSD license. See LICENSE or:
18
+ * http://opensource.org/licenses/BSD-3-Clause
19
+ *
20
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
21
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
22
+ *
23
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
24
+ * Redistribution and use in source and binary forms, with or without
25
+ * modification, are permitted provided that the following conditions are
26
+ * met:
27
+ *
28
+ * * Redistributions of source code must retain the above copyright
29
+ * notice, this list of conditions and the following disclaimer.
30
+ * * Redistributions in binary form must reproduce the above
31
+ * copyright notice, this list of conditions and the following
32
+ * disclaimer in the documentation and/or other materials provided
33
+ * with the distribution.
34
+ * * Neither the name of Google Inc. nor the names of its
35
+ * contributors may be used to endorse or promote products derived
36
+ * from this software without specific prior written permission.
37
+ *
38
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
42
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
46
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
+ */
50
+
51
+ var base64$1 = base64.__require();
52
+
53
+ // A single base 64 digit can contain 6 bits of data. For the base 64 variable
54
+ // length quantities we use in the source map spec, the first bit is the sign,
55
+ // the next four bits are the actual value, and the 6th bit is the
56
+ // continuation bit. The continuation bit tells us whether there are more
57
+ // digits in this value following this digit.
58
+ //
59
+ // Continuation
60
+ // | Sign
61
+ // | |
62
+ // V V
63
+ // 101011
64
+
65
+ var VLQ_BASE_SHIFT = 5;
66
+
67
+ // binary: 100000
68
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
69
+
70
+ // binary: 011111
71
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
72
+
73
+ // binary: 100000
74
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
75
+
76
+ /**
77
+ * Converts from a two-complement value to a value where the sign bit is
78
+ * placed in the least significant bit. For example, as decimals:
79
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
80
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
81
+ */
82
+ function toVLQSigned(aValue) {
83
+ return aValue < 0
84
+ ? ((-aValue) << 1) + 1
85
+ : (aValue << 1) + 0;
86
+ }
87
+
88
+ /**
89
+ * Converts to a two-complement value from a value where the sign bit is
90
+ * placed in the least significant bit. For example, as decimals:
91
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
92
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
93
+ */
94
+ function fromVLQSigned(aValue) {
95
+ var isNegative = (aValue & 1) === 1;
96
+ var shifted = aValue >> 1;
97
+ return isNegative
98
+ ? -shifted
99
+ : shifted;
100
+ }
101
+
102
+ /**
103
+ * Returns the base 64 VLQ encoded value.
104
+ */
105
+ base64Vlq.__exports.encode = function base64VLQ_encode(aValue) {
106
+ var encoded = "";
107
+ var digit;
108
+
109
+ var vlq = toVLQSigned(aValue);
110
+
111
+ do {
112
+ digit = vlq & VLQ_BASE_MASK;
113
+ vlq >>>= VLQ_BASE_SHIFT;
114
+ if (vlq > 0) {
115
+ // There are still more digits in this value, so we must make sure the
116
+ // continuation bit is marked.
117
+ digit |= VLQ_CONTINUATION_BIT;
118
+ }
119
+ encoded += base64$1.encode(digit);
120
+ } while (vlq > 0);
121
+
122
+ return encoded;
123
+ };
124
+
125
+ /**
126
+ * Decodes the next base 64 VLQ value from the given string and returns the
127
+ * value and the rest of the string via the out parameter.
128
+ */
129
+ base64Vlq.__exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
130
+ var strLen = aStr.length;
131
+ var result = 0;
132
+ var shift = 0;
133
+ var continuation, digit;
134
+
135
+ do {
136
+ if (aIndex >= strLen) {
137
+ throw new Error("Expected more digits in base 64 VLQ value.");
138
+ }
139
+
140
+ digit = base64$1.decode(aStr.charCodeAt(aIndex++));
141
+ if (digit === -1) {
142
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
143
+ }
144
+
145
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
146
+ digit &= VLQ_BASE_MASK;
147
+ result = result + (digit << shift);
148
+ shift += VLQ_BASE_SHIFT;
149
+ } while (continuation);
150
+
151
+ aOutParam.value = fromVLQSigned(result);
152
+ aOutParam.rest = aIndex;
153
+ };
154
+ return base64Vlq.__exports;
155
+ }
156
+
157
+ exports.__require = requireBase64Vlq;
@@ -0,0 +1,83 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const base64 = require('../../../_virtual/base64.js');
6
+
7
+ /* -*- Mode: js; js-indent-level: 2; -*- */
8
+
9
+ var hasRequiredBase64;
10
+
11
+ function requireBase64 () {
12
+ if (hasRequiredBase64) return base64.__exports;
13
+ hasRequiredBase64 = 1;
14
+ /*
15
+ * Copyright 2011 Mozilla Foundation and contributors
16
+ * Licensed under the New BSD license. See LICENSE or:
17
+ * http://opensource.org/licenses/BSD-3-Clause
18
+ */
19
+
20
+ var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
21
+
22
+ /**
23
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
24
+ */
25
+ base64.__exports.encode = function (number) {
26
+ if (0 <= number && number < intToCharMap.length) {
27
+ return intToCharMap[number];
28
+ }
29
+ throw new TypeError("Must be between 0 and 63: " + number);
30
+ };
31
+
32
+ /**
33
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
34
+ * failure.
35
+ */
36
+ base64.__exports.decode = function (charCode) {
37
+ var bigA = 65; // 'A'
38
+ var bigZ = 90; // 'Z'
39
+
40
+ var littleA = 97; // 'a'
41
+ var littleZ = 122; // 'z'
42
+
43
+ var zero = 48; // '0'
44
+ var nine = 57; // '9'
45
+
46
+ var plus = 43; // '+'
47
+ var slash = 47; // '/'
48
+
49
+ var littleOffset = 26;
50
+ var numberOffset = 52;
51
+
52
+ // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
53
+ if (bigA <= charCode && charCode <= bigZ) {
54
+ return (charCode - bigA);
55
+ }
56
+
57
+ // 26 - 51: abcdefghijklmnopqrstuvwxyz
58
+ if (littleA <= charCode && charCode <= littleZ) {
59
+ return (charCode - littleA + littleOffset);
60
+ }
61
+
62
+ // 52 - 61: 0123456789
63
+ if (zero <= charCode && charCode <= nine) {
64
+ return (charCode - zero + numberOffset);
65
+ }
66
+
67
+ // 62: +
68
+ if (charCode == plus) {
69
+ return 62;
70
+ }
71
+
72
+ // 63: /
73
+ if (charCode == slash) {
74
+ return 63;
75
+ }
76
+
77
+ // Invalid base64 digit.
78
+ return -1;
79
+ };
80
+ return base64.__exports;
81
+ }
82
+
83
+ exports.__require = requireBase64;
@@ -0,0 +1,129 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const binarySearch = require('../../../_virtual/binary-search.js');
6
+
7
+ /* -*- Mode: js; js-indent-level: 2; -*- */
8
+
9
+ var hasRequiredBinarySearch;
10
+
11
+ function requireBinarySearch () {
12
+ if (hasRequiredBinarySearch) return binarySearch.__exports;
13
+ hasRequiredBinarySearch = 1;
14
+ (function (exports$1) {
15
+ /*
16
+ * Copyright 2011 Mozilla Foundation and contributors
17
+ * Licensed under the New BSD license. See LICENSE or:
18
+ * http://opensource.org/licenses/BSD-3-Clause
19
+ */
20
+
21
+ exports$1.GREATEST_LOWER_BOUND = 1;
22
+ exports$1.LEAST_UPPER_BOUND = 2;
23
+
24
+ /**
25
+ * Recursive implementation of binary search.
26
+ *
27
+ * @param aLow Indices here and lower do not contain the needle.
28
+ * @param aHigh Indices here and higher do not contain the needle.
29
+ * @param aNeedle The element being searched for.
30
+ * @param aHaystack The non-empty array being searched.
31
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
32
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
33
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
34
+ * closest element that is smaller than or greater than the one we are
35
+ * searching for, respectively, if the exact element cannot be found.
36
+ */
37
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
38
+ // This function terminates when one of the following is true:
39
+ //
40
+ // 1. We find the exact element we are looking for.
41
+ //
42
+ // 2. We did not find the exact element, but we can return the index of
43
+ // the next-closest element.
44
+ //
45
+ // 3. We did not find the exact element, and there is no next-closest
46
+ // element than the one we are searching for, so we return -1.
47
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
48
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
49
+ if (cmp === 0) {
50
+ // Found the element we are looking for.
51
+ return mid;
52
+ }
53
+ else if (cmp > 0) {
54
+ // Our needle is greater than aHaystack[mid].
55
+ if (aHigh - mid > 1) {
56
+ // The element is in the upper half.
57
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
58
+ }
59
+
60
+ // The exact needle element was not found in this haystack. Determine if
61
+ // we are in termination case (3) or (2) and return the appropriate thing.
62
+ if (aBias == exports$1.LEAST_UPPER_BOUND) {
63
+ return aHigh < aHaystack.length ? aHigh : -1;
64
+ } else {
65
+ return mid;
66
+ }
67
+ }
68
+ else {
69
+ // Our needle is less than aHaystack[mid].
70
+ if (mid - aLow > 1) {
71
+ // The element is in the lower half.
72
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
73
+ }
74
+
75
+ // we are in termination case (3) or (2) and return the appropriate thing.
76
+ if (aBias == exports$1.LEAST_UPPER_BOUND) {
77
+ return mid;
78
+ } else {
79
+ return aLow < 0 ? -1 : aLow;
80
+ }
81
+ }
82
+ }
83
+
84
+ /**
85
+ * This is an implementation of binary search which will always try and return
86
+ * the index of the closest element if there is no exact hit. This is because
87
+ * mappings between original and generated line/col pairs are single points,
88
+ * and there is an implicit region between each of them, so a miss just means
89
+ * that you aren't on the very start of a region.
90
+ *
91
+ * @param aNeedle The element you are looking for.
92
+ * @param aHaystack The array that is being searched.
93
+ * @param aCompare A function which takes the needle and an element in the
94
+ * array and returns -1, 0, or 1 depending on whether the needle is less
95
+ * than, equal to, or greater than the element, respectively.
96
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
97
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
98
+ * closest element that is smaller than or greater than the one we are
99
+ * searching for, respectively, if the exact element cannot be found.
100
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
101
+ */
102
+ exports$1.search = function search(aNeedle, aHaystack, aCompare, aBias) {
103
+ if (aHaystack.length === 0) {
104
+ return -1;
105
+ }
106
+
107
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
108
+ aCompare, aBias || exports$1.GREATEST_LOWER_BOUND);
109
+ if (index < 0) {
110
+ return -1;
111
+ }
112
+
113
+ // We have found either the exact element, or the next-closest element than
114
+ // the one we are searching for. However, there may be more than one such
115
+ // element. Make sure we always return the smallest of these.
116
+ while (index - 1 >= 0) {
117
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
118
+ break;
119
+ }
120
+ --index;
121
+ }
122
+
123
+ return index;
124
+ };
125
+ } (binarySearch.__exports));
126
+ return binarySearch.__exports;
127
+ }
128
+
129
+ exports.__require = requireBinarySearch;
@@ -0,0 +1,96 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const mappingList = require('../../../_virtual/mapping-list.js');
6
+ const util = require('./util.js');
7
+
8
+ /* -*- Mode: js; js-indent-level: 2; -*- */
9
+
10
+ var hasRequiredMappingList;
11
+
12
+ function requireMappingList () {
13
+ if (hasRequiredMappingList) return mappingList.__exports;
14
+ hasRequiredMappingList = 1;
15
+ /*
16
+ * Copyright 2014 Mozilla Foundation and contributors
17
+ * Licensed under the New BSD license. See LICENSE or:
18
+ * http://opensource.org/licenses/BSD-3-Clause
19
+ */
20
+
21
+ var util$1 = util.__require();
22
+
23
+ /**
24
+ * Determine whether mappingB is after mappingA with respect to generated
25
+ * position.
26
+ */
27
+ function generatedPositionAfter(mappingA, mappingB) {
28
+ // Optimized for most common case
29
+ var lineA = mappingA.generatedLine;
30
+ var lineB = mappingB.generatedLine;
31
+ var columnA = mappingA.generatedColumn;
32
+ var columnB = mappingB.generatedColumn;
33
+ return lineB > lineA || lineB == lineA && columnB >= columnA ||
34
+ util$1.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
35
+ }
36
+
37
+ /**
38
+ * A data structure to provide a sorted view of accumulated mappings in a
39
+ * performance conscious manner. It trades a neglibable overhead in general
40
+ * case for a large speedup in case of mappings being added in order.
41
+ */
42
+ function MappingList() {
43
+ this._array = [];
44
+ this._sorted = true;
45
+ // Serves as infimum
46
+ this._last = {generatedLine: -1, generatedColumn: 0};
47
+ }
48
+
49
+ /**
50
+ * Iterate through internal items. This method takes the same arguments that
51
+ * `Array.prototype.forEach` takes.
52
+ *
53
+ * NOTE: The order of the mappings is NOT guaranteed.
54
+ */
55
+ MappingList.prototype.unsortedForEach =
56
+ function MappingList_forEach(aCallback, aThisArg) {
57
+ this._array.forEach(aCallback, aThisArg);
58
+ };
59
+
60
+ /**
61
+ * Add the given source mapping.
62
+ *
63
+ * @param Object aMapping
64
+ */
65
+ MappingList.prototype.add = function MappingList_add(aMapping) {
66
+ if (generatedPositionAfter(this._last, aMapping)) {
67
+ this._last = aMapping;
68
+ this._array.push(aMapping);
69
+ } else {
70
+ this._sorted = false;
71
+ this._array.push(aMapping);
72
+ }
73
+ };
74
+
75
+ /**
76
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
77
+ * generated position.
78
+ *
79
+ * WARNING: This method returns internal data without copying, for
80
+ * performance. The return value must NOT be mutated, and should be treated as
81
+ * an immutable borrow. If you want to take ownership, you must make your own
82
+ * copy.
83
+ */
84
+ MappingList.prototype.toArray = function MappingList_toArray() {
85
+ if (!this._sorted) {
86
+ this._array.sort(util$1.compareByGeneratedPositionsInflated);
87
+ this._sorted = true;
88
+ }
89
+ return this._array;
90
+ };
91
+
92
+ mappingList.__exports.MappingList = MappingList;
93
+ return mappingList.__exports;
94
+ }
95
+
96
+ exports.__require = requireMappingList;