@golar/plugin 0.0.2 → 0.0.3
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/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ type ServiceCode = ({
|
|
|
25
25
|
serviceText: string;
|
|
26
26
|
scriptKind: ScriptKind; /** @default false */
|
|
27
27
|
declarationFile?: boolean | undefined;
|
|
28
|
-
} &
|
|
28
|
+
} & {
|
|
29
29
|
mappings: Mapping[];
|
|
30
30
|
errors?: never;
|
|
31
31
|
ignoreMappings?: IgnoreDirectiveMapping[] | undefined;
|
|
32
32
|
expectErrorMappings?: ExpectErrorDirectiveMapping[] | undefined;
|
|
33
|
-
})
|
|
33
|
+
}) | {
|
|
34
34
|
mappings?: never;
|
|
35
35
|
errors: ServiceCodeError[];
|
|
36
36
|
};
|
|
@@ -38,8 +38,8 @@ type Promisable<T> = T | Promise<T>;
|
|
|
38
38
|
type CreatePluginOptions = {
|
|
39
39
|
filename: string;
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
* @example ['.vue']
|
|
42
|
+
*/
|
|
43
43
|
extraExtensions?: string[] | undefined;
|
|
44
44
|
createServiceCode: (cwd: string, configFileName: string | null, fileName: string, sourceText: string) => Promisable<ServiceCode>;
|
|
45
45
|
};
|
package/dist/index.js
CHANGED
|
@@ -134,7 +134,7 @@ function createPlugin(opts) {
|
|
|
134
134
|
offset = sendBuffer.writeUInt8(SCRIPT_KIND[resp.scriptKind], offset);
|
|
135
135
|
offset = sendBuffer.writeUInt32LE(serviceTextLen, offset);
|
|
136
136
|
offset += sendBuffer.write(resp.serviceText, offset);
|
|
137
|
-
const sourceIndicesUtf8 = mapIndicesToUtf8(sourceText, function* () {
|
|
137
|
+
const sourceIndicesUtf8 = mapIndicesToUtf8(sourceText, (function* () {
|
|
138
138
|
for (const m of resp.mappings) {
|
|
139
139
|
yield m.sourceOffset;
|
|
140
140
|
yield m.sourceOffset + m.sourceLength;
|
|
@@ -143,8 +143,8 @@ function createPlugin(opts) {
|
|
|
143
143
|
yield m.sourceOffset;
|
|
144
144
|
yield m.sourceOffset + m.sourceLength;
|
|
145
145
|
}
|
|
146
|
-
}());
|
|
147
|
-
const serviceIndicesUtf8 = mapIndicesToUtf8(resp.serviceText, function* () {
|
|
146
|
+
})());
|
|
147
|
+
const serviceIndicesUtf8 = mapIndicesToUtf8(resp.serviceText, (function* () {
|
|
148
148
|
for (const m of resp.mappings) {
|
|
149
149
|
yield m.serviceOffset;
|
|
150
150
|
yield m.serviceOffset + (m.serviceLength ?? m.sourceLength);
|
|
@@ -157,7 +157,7 @@ function createPlugin(opts) {
|
|
|
157
157
|
yield m.serviceOffset;
|
|
158
158
|
yield m.serviceOffset + m.serviceLength;
|
|
159
159
|
}
|
|
160
|
-
}());
|
|
160
|
+
})());
|
|
161
161
|
offset = sendBuffer.writeUInt32LE(resp.mappings.length, offset);
|
|
162
162
|
for (const m of resp.mappings) {
|
|
163
163
|
const sourceOffsetUtf8 = sourceIndicesUtf8(m.sourceOffset);
|