metro-source-map 0.83.2 → 0.83.4
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/package.json +6 -7
- package/src/B64Builder.js +5 -1
- package/src/BundleBuilder.js.flow +2 -2
- package/src/Consumer/AbstractConsumer.js +5 -1
- package/src/Consumer/AbstractConsumer.js.flow +2 -2
- package/src/Consumer/DelegatingConsumer.js +5 -1
- package/src/Consumer/DelegatingConsumer.js.flow +2 -2
- package/src/Consumer/MappingsConsumer.js +5 -1
- package/src/Consumer/MappingsConsumer.js.flow +4 -4
- package/src/Consumer/SectionsConsumer.js +5 -1
- package/src/Consumer/SectionsConsumer.js.flow +1 -1
- package/src/Consumer/constants.js.flow +1 -1
- package/src/Consumer/createConsumer.js +5 -1
- package/src/Consumer/createConsumer.js.flow +1 -1
- package/src/Consumer/index.js +5 -1
- package/src/Consumer/normalizeSourcePath.js +5 -1
- package/src/Consumer/search.js.flow +1 -1
- package/src/Consumer/types.js.flow +3 -3
- package/src/Generator.js +5 -1
- package/src/Generator.js.flow +3 -3
- package/src/composeSourceMaps.js +5 -1
- package/src/composeSourceMaps.js.flow +2 -2
- package/src/encode.js.flow +1 -1
- package/src/generateFunctionMap.js +35 -26
- package/src/generateFunctionMap.js.flow +6 -9
- package/src/source-map.js +5 -1
- package/src/source-map.js.flow +12 -12
- package/src/B64Builder.d.ts +0 -47
- package/src/BundleBuilder.d.ts +0 -43
- package/src/Consumer/AbstractConsumer.d.ts +0 -37
- package/src/Consumer/DelegatingConsumer.d.ts +0 -47
- package/src/Consumer/MappingsConsumer.d.ts +0 -43
- package/src/Consumer/SectionsConsumer.d.ts +0 -40
- package/src/Consumer/constants.d.ts +0 -39
- package/src/Consumer/createConsumer.d.ts +0 -15
- package/src/Consumer/index.d.ts +0 -16
- package/src/Consumer/normalizeSourcePath.d.ts +0 -15
- package/src/Consumer/positionMath.d.ts +0 -25
- package/src/Consumer/search.d.ts +0 -15
- package/src/Consumer/types.d.ts +0 -57
- package/src/Generator.d.ts +0 -107
- package/src/composeSourceMaps.d.ts +0 -16
- package/src/encode.d.ts +0 -66
- package/src/generateFunctionMap.d.ts +0 -45
- package/src/source-map.d.ts +0 -155
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {
|
|
12
|
-
GeneratedPositionLookup,
|
|
13
|
-
IConsumer,
|
|
14
|
-
IterationOrder,
|
|
15
|
-
Mapping,
|
|
16
|
-
SourcePosition,
|
|
17
|
-
} from './types';
|
|
18
|
-
|
|
19
|
-
declare class AbstractConsumer implements IConsumer {
|
|
20
|
-
_sourceMap: {readonly file?: string};
|
|
21
|
-
constructor(sourceMap: {readonly file?: string});
|
|
22
|
-
originalPositionFor(
|
|
23
|
-
generatedPosition: GeneratedPositionLookup,
|
|
24
|
-
): SourcePosition;
|
|
25
|
-
generatedMappings(): Iterable<Mapping>;
|
|
26
|
-
eachMapping(
|
|
27
|
-
callback: (mapping: Mapping) => unknown,
|
|
28
|
-
context?: unknown,
|
|
29
|
-
order?: IterationOrder,
|
|
30
|
-
): void;
|
|
31
|
-
get file(): null | undefined | string;
|
|
32
|
-
sourceContentFor(
|
|
33
|
-
source: string,
|
|
34
|
-
nullOnMissing: true,
|
|
35
|
-
): null | undefined | string;
|
|
36
|
-
}
|
|
37
|
-
export default AbstractConsumer;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {MixedSourceMap} from '../source-map';
|
|
12
|
-
import type {LookupBias} from './constants.js';
|
|
13
|
-
import type {
|
|
14
|
-
GeneratedPositionLookup,
|
|
15
|
-
IConsumer,
|
|
16
|
-
IterationOrder,
|
|
17
|
-
Mapping,
|
|
18
|
-
SourcePosition,
|
|
19
|
-
} from './types';
|
|
20
|
-
/**
|
|
21
|
-
* A source map consumer that supports both "basic" and "indexed" source maps.
|
|
22
|
-
* Uses `MappingsConsumer` and `SectionsConsumer` under the hood (via
|
|
23
|
-
* `createConsumer`).
|
|
24
|
-
*/
|
|
25
|
-
declare class DelegatingConsumer implements IConsumer {
|
|
26
|
-
static readonly GENERATED_ORDER: IterationOrder;
|
|
27
|
-
static readonly ORIGINAL_ORDER: IterationOrder;
|
|
28
|
-
static readonly GREATEST_LOWER_BOUND: LookupBias;
|
|
29
|
-
static readonly LEAST_UPPER_BOUND: LookupBias;
|
|
30
|
-
_rootConsumer: IConsumer;
|
|
31
|
-
constructor(sourceMap: MixedSourceMap);
|
|
32
|
-
originalPositionFor(
|
|
33
|
-
generatedPosition: GeneratedPositionLookup,
|
|
34
|
-
): SourcePosition;
|
|
35
|
-
generatedMappings(): Iterable<Mapping>;
|
|
36
|
-
eachMapping(
|
|
37
|
-
callback: (mapping: Mapping) => unknown,
|
|
38
|
-
context?: unknown,
|
|
39
|
-
order?: IterationOrder,
|
|
40
|
-
): void;
|
|
41
|
-
get file(): null | undefined | string;
|
|
42
|
-
sourceContentFor(
|
|
43
|
-
source: string,
|
|
44
|
-
nullOnMissing: true,
|
|
45
|
-
): null | undefined | string;
|
|
46
|
-
}
|
|
47
|
-
export default DelegatingConsumer;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {BasicSourceMap} from '../source-map';
|
|
12
|
-
import type {
|
|
13
|
-
GeneratedPositionLookup,
|
|
14
|
-
IConsumer,
|
|
15
|
-
Mapping,
|
|
16
|
-
SourcePosition,
|
|
17
|
-
} from './types';
|
|
18
|
-
import type {Number0} from 'ob1';
|
|
19
|
-
|
|
20
|
-
import AbstractConsumer from './AbstractConsumer';
|
|
21
|
-
/**
|
|
22
|
-
* A source map consumer that supports "basic" source maps (that have a
|
|
23
|
-
* `mappings` field and no sections).
|
|
24
|
-
*/
|
|
25
|
-
declare class MappingsConsumer extends AbstractConsumer implements IConsumer {
|
|
26
|
-
_sourceMap: BasicSourceMap;
|
|
27
|
-
_decodedMappings: null | undefined | ReadonlyArray<Mapping>;
|
|
28
|
-
_normalizedSources: null | undefined | ReadonlyArray<string>;
|
|
29
|
-
constructor(sourceMap: BasicSourceMap);
|
|
30
|
-
originalPositionFor(
|
|
31
|
-
generatedPosition: GeneratedPositionLookup,
|
|
32
|
-
): SourcePosition;
|
|
33
|
-
_decodeMappings(): Generator<Mapping, void, void>;
|
|
34
|
-
_normalizeAndCacheSources(): ReadonlyArray<string>;
|
|
35
|
-
_decodeAndCacheMappings(): ReadonlyArray<Mapping>;
|
|
36
|
-
generatedMappings(): Iterable<Mapping>;
|
|
37
|
-
_indexOfSource(source: string): null | undefined | Number0;
|
|
38
|
-
sourceContentFor(
|
|
39
|
-
source: string,
|
|
40
|
-
nullOnMissing: true,
|
|
41
|
-
): null | undefined | string;
|
|
42
|
-
}
|
|
43
|
-
export default MappingsConsumer;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {IndexMap} from '../source-map';
|
|
12
|
-
import type {
|
|
13
|
-
GeneratedOffset,
|
|
14
|
-
GeneratedPositionLookup,
|
|
15
|
-
IConsumer,
|
|
16
|
-
Mapping,
|
|
17
|
-
SourcePosition,
|
|
18
|
-
} from './types';
|
|
19
|
-
|
|
20
|
-
import AbstractConsumer from './AbstractConsumer';
|
|
21
|
-
/**
|
|
22
|
-
* A source map consumer that supports "indexed" source maps (that have a
|
|
23
|
-
* `sections` field and no top-level mappings).
|
|
24
|
-
*/
|
|
25
|
-
declare class SectionsConsumer extends AbstractConsumer implements IConsumer {
|
|
26
|
-
_consumers: ReadonlyArray<[GeneratedOffset, IConsumer]>;
|
|
27
|
-
constructor(sourceMap: IndexMap);
|
|
28
|
-
originalPositionFor(
|
|
29
|
-
generatedPosition: GeneratedPositionLookup,
|
|
30
|
-
): SourcePosition;
|
|
31
|
-
generatedMappings(): Iterable<Mapping>;
|
|
32
|
-
_consumerForPosition(
|
|
33
|
-
generatedPosition: GeneratedPositionLookup,
|
|
34
|
-
): null | undefined | [GeneratedOffset, IConsumer];
|
|
35
|
-
sourceContentFor(
|
|
36
|
-
source: string,
|
|
37
|
-
nullOnMissing: true,
|
|
38
|
-
): null | undefined | string;
|
|
39
|
-
}
|
|
40
|
-
export default SectionsConsumer;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {Number0, Number1} from 'ob1';
|
|
12
|
-
|
|
13
|
-
declare const FIRST_COLUMN: Number0;
|
|
14
|
-
declare const FIRST_LINE: Number1;
|
|
15
|
-
export declare type IterationOrder = symbol & {__IterationOrder__: string};
|
|
16
|
-
declare const GENERATED_ORDER: IterationOrder;
|
|
17
|
-
declare const ORIGINAL_ORDER: IterationOrder;
|
|
18
|
-
export declare type LookupBias = symbol & {__LookupBias__: string};
|
|
19
|
-
declare const GREATEST_LOWER_BOUND: LookupBias;
|
|
20
|
-
declare const LEAST_UPPER_BOUND: LookupBias;
|
|
21
|
-
declare const EMPTY_POSITION: Readonly<{
|
|
22
|
-
source: null;
|
|
23
|
-
name: null;
|
|
24
|
-
line: null;
|
|
25
|
-
column: null;
|
|
26
|
-
}>;
|
|
27
|
-
declare function iterationOrderToString(x: IterationOrder): string;
|
|
28
|
-
declare function lookupBiasToString(x: LookupBias): string;
|
|
29
|
-
export {
|
|
30
|
-
FIRST_COLUMN,
|
|
31
|
-
FIRST_LINE,
|
|
32
|
-
GENERATED_ORDER,
|
|
33
|
-
ORIGINAL_ORDER,
|
|
34
|
-
GREATEST_LOWER_BOUND,
|
|
35
|
-
LEAST_UPPER_BOUND,
|
|
36
|
-
EMPTY_POSITION,
|
|
37
|
-
iterationOrderToString,
|
|
38
|
-
lookupBiasToString,
|
|
39
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {MixedSourceMap} from '../source-map';
|
|
12
|
-
import type {IConsumer} from './types';
|
|
13
|
-
|
|
14
|
-
declare function createConsumer(sourceMap: MixedSourceMap): IConsumer;
|
|
15
|
-
export default createConsumer;
|
package/src/Consumer/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import DelegatingConsumer from './DelegatingConsumer';
|
|
12
|
-
|
|
13
|
-
declare const $$EXPORT_DEFAULT_DECLARATION$$: typeof DelegatingConsumer;
|
|
14
|
-
declare type $$EXPORT_DEFAULT_DECLARATION$$ =
|
|
15
|
-
typeof $$EXPORT_DEFAULT_DECLARATION$$;
|
|
16
|
-
export default $$EXPORT_DEFAULT_DECLARATION$$;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
declare function normalizeSourcePath(
|
|
12
|
-
sourceInput: string,
|
|
13
|
-
map: {readonly sourceRoot?: null | undefined | string},
|
|
14
|
-
): string;
|
|
15
|
-
export default normalizeSourcePath;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {GeneratedOffset} from './types';
|
|
12
|
-
import type {Number0, Number1} from 'ob1';
|
|
13
|
-
|
|
14
|
-
export declare function shiftPositionByOffset<
|
|
15
|
-
T extends {
|
|
16
|
-
readonly line: null | undefined | Number1;
|
|
17
|
-
readonly column: null | undefined | Number0;
|
|
18
|
-
},
|
|
19
|
-
>(pos: T, offset: GeneratedOffset): T;
|
|
20
|
-
export declare function subtractOffsetFromPosition<
|
|
21
|
-
T extends {
|
|
22
|
-
readonly line: null | undefined | Number1;
|
|
23
|
-
readonly column: null | undefined | Number0;
|
|
24
|
-
},
|
|
25
|
-
>(pos: T, offset: GeneratedOffset): T;
|
package/src/Consumer/search.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export declare function greatestLowerBound<T, U>(
|
|
12
|
-
elements: ReadonlyArray<T>,
|
|
13
|
-
target: U,
|
|
14
|
-
comparator: ($$PARAM_0$$: U, $$PARAM_1$$: T) => number,
|
|
15
|
-
): null | undefined | number;
|
package/src/Consumer/types.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {IterationOrder, LookupBias} from './constants';
|
|
12
|
-
import type {Number0, Number1} from 'ob1';
|
|
13
|
-
|
|
14
|
-
export type {IterationOrder, LookupBias};
|
|
15
|
-
export type GeneratedOffset = {
|
|
16
|
-
readonly lines: Number0;
|
|
17
|
-
readonly columns: Number0;
|
|
18
|
-
};
|
|
19
|
-
export type SourcePosition = {
|
|
20
|
-
source: null | undefined | string;
|
|
21
|
-
line: null | undefined | Number1;
|
|
22
|
-
column: null | undefined | Number0;
|
|
23
|
-
name: null | undefined | string;
|
|
24
|
-
};
|
|
25
|
-
export type GeneratedPosition = {
|
|
26
|
-
readonly line: Number1;
|
|
27
|
-
readonly column: Number0;
|
|
28
|
-
};
|
|
29
|
-
export type GeneratedPositionLookup = {
|
|
30
|
-
readonly line: null | undefined | Number1;
|
|
31
|
-
readonly column: null | undefined | Number0;
|
|
32
|
-
readonly bias?: LookupBias;
|
|
33
|
-
};
|
|
34
|
-
export type Mapping = Readonly<{
|
|
35
|
-
source: null | undefined | string;
|
|
36
|
-
generatedLine: Number1;
|
|
37
|
-
generatedColumn: Number0;
|
|
38
|
-
originalLine: null | undefined | Number1;
|
|
39
|
-
originalColumn: null | undefined | Number0;
|
|
40
|
-
name: null | undefined | string;
|
|
41
|
-
}>;
|
|
42
|
-
export interface IConsumer {
|
|
43
|
-
originalPositionFor(
|
|
44
|
-
generatedPosition: GeneratedPositionLookup,
|
|
45
|
-
): SourcePosition;
|
|
46
|
-
generatedMappings(): Iterable<Mapping>;
|
|
47
|
-
eachMapping(
|
|
48
|
-
callback: (mapping: Mapping) => unknown,
|
|
49
|
-
context?: unknown,
|
|
50
|
-
order?: IterationOrder,
|
|
51
|
-
): void;
|
|
52
|
-
get file(): null | undefined | string;
|
|
53
|
-
sourceContentFor(
|
|
54
|
-
source: string,
|
|
55
|
-
nullOnMissing: true,
|
|
56
|
-
): null | undefined | string;
|
|
57
|
-
}
|
package/src/Generator.d.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {
|
|
12
|
-
BasicSourceMap,
|
|
13
|
-
FBSourceFunctionMap,
|
|
14
|
-
FBSourceMetadata,
|
|
15
|
-
} from './source-map';
|
|
16
|
-
|
|
17
|
-
import B64Builder from './B64Builder';
|
|
18
|
-
|
|
19
|
-
type FileFlags = Readonly<{addToIgnoreList?: boolean}>;
|
|
20
|
-
/**
|
|
21
|
-
* Generates a source map from raw mappings.
|
|
22
|
-
*
|
|
23
|
-
* Raw mappings are a set of 2, 4, or five elements:
|
|
24
|
-
*
|
|
25
|
-
* - line and column number in the generated source
|
|
26
|
-
* - line and column number in the original source
|
|
27
|
-
* - symbol name in the original source
|
|
28
|
-
*
|
|
29
|
-
* Mappings have to be passed in the order appearance in the generated source.
|
|
30
|
-
*/
|
|
31
|
-
declare class Generator {
|
|
32
|
-
builder: B64Builder;
|
|
33
|
-
last: {
|
|
34
|
-
generatedColumn: number;
|
|
35
|
-
generatedLine: number;
|
|
36
|
-
name: number;
|
|
37
|
-
source: number;
|
|
38
|
-
sourceColumn: number;
|
|
39
|
-
sourceLine: number;
|
|
40
|
-
};
|
|
41
|
-
names: IndexedSet;
|
|
42
|
-
source: number;
|
|
43
|
-
sources: Array<string>;
|
|
44
|
-
sourcesContent: Array<null | undefined | string>;
|
|
45
|
-
x_facebook_sources: Array<null | undefined | FBSourceMetadata>;
|
|
46
|
-
x_google_ignoreList: Array<number>;
|
|
47
|
-
constructor();
|
|
48
|
-
/**
|
|
49
|
-
* Mark the beginning of a new source file.
|
|
50
|
-
*/
|
|
51
|
-
startFile(
|
|
52
|
-
file: string,
|
|
53
|
-
code: string,
|
|
54
|
-
functionMap: null | undefined | FBSourceFunctionMap,
|
|
55
|
-
flags?: FileFlags,
|
|
56
|
-
): void;
|
|
57
|
-
/**
|
|
58
|
-
* Mark the end of the current source file
|
|
59
|
-
*/
|
|
60
|
-
endFile(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Adds a mapping for generated code without a corresponding source location.
|
|
63
|
-
*/
|
|
64
|
-
addSimpleMapping(generatedLine: number, generatedColumn: number): void;
|
|
65
|
-
/**
|
|
66
|
-
* Adds a mapping for generated code with a corresponding source location.
|
|
67
|
-
*/
|
|
68
|
-
addSourceMapping(
|
|
69
|
-
generatedLine: number,
|
|
70
|
-
generatedColumn: number,
|
|
71
|
-
sourceLine: number,
|
|
72
|
-
sourceColumn: number,
|
|
73
|
-
): void;
|
|
74
|
-
/**
|
|
75
|
-
* Adds a mapping for code with a corresponding source location + symbol name.
|
|
76
|
-
*/
|
|
77
|
-
addNamedSourceMapping(
|
|
78
|
-
generatedLine: number,
|
|
79
|
-
generatedColumn: number,
|
|
80
|
-
sourceLine: number,
|
|
81
|
-
sourceColumn: number,
|
|
82
|
-
name: string,
|
|
83
|
-
): void;
|
|
84
|
-
/**
|
|
85
|
-
* Return the source map as object.
|
|
86
|
-
*/
|
|
87
|
-
toMap(file?: string, options?: {excludeSource?: boolean}): BasicSourceMap;
|
|
88
|
-
/**
|
|
89
|
-
* Return the source map as string.
|
|
90
|
-
*
|
|
91
|
-
* This is ~2.5x faster than calling `JSON.stringify(generator.toMap())`
|
|
92
|
-
*/
|
|
93
|
-
toString(file?: string, options?: {excludeSource?: boolean}): string;
|
|
94
|
-
/**
|
|
95
|
-
* Determine whether we need to write the `x_facebook_sources` field.
|
|
96
|
-
* If the metadata is all `null`s, we can omit the field entirely.
|
|
97
|
-
*/
|
|
98
|
-
hasSourcesMetadata(): boolean;
|
|
99
|
-
}
|
|
100
|
-
export default Generator;
|
|
101
|
-
declare class IndexedSet {
|
|
102
|
-
map: Map<string, number>;
|
|
103
|
-
nextIndex: number;
|
|
104
|
-
constructor();
|
|
105
|
-
indexFor(x: string): number;
|
|
106
|
-
items(): Array<string>;
|
|
107
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {MixedSourceMap} from './source-map';
|
|
12
|
-
|
|
13
|
-
declare function composeSourceMaps(
|
|
14
|
-
maps: ReadonlyArray<MixedSourceMap>,
|
|
15
|
-
): MixedSourceMap;
|
|
16
|
-
export default composeSourceMaps;
|
package/src/encode.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Portions Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Copyright 2011 Mozilla Foundation and contributors
|
|
13
|
-
* Licensed under the New BSD license. See LICENSE or:
|
|
14
|
-
* http://opensource.org/licenses/BSD-3-Clause
|
|
15
|
-
*
|
|
16
|
-
* Based on the Base 64 VLQ implementation in Closure Compiler:
|
|
17
|
-
* https://git.io/vymuA
|
|
18
|
-
*
|
|
19
|
-
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
|
|
20
|
-
* Redistribution and use in source and binary forms, with or without
|
|
21
|
-
* modification, are permitted provided that the following conditions are
|
|
22
|
-
* met:
|
|
23
|
-
*
|
|
24
|
-
* * Redistributions of source code must retain the above copyright
|
|
25
|
-
* notice, this list of conditions and the following disclaimer.
|
|
26
|
-
* * Redistributions in binary form must reproduce the above
|
|
27
|
-
* copyright notice, this list of conditions and the following
|
|
28
|
-
* disclaimer in the documentation and/or other materials provided
|
|
29
|
-
* with the distribution.
|
|
30
|
-
* * Neither the name of Google Inc. nor the names of its
|
|
31
|
-
* contributors may be used to endorse or promote products derived
|
|
32
|
-
* from this software without specific prior written permission.
|
|
33
|
-
*
|
|
34
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
35
|
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
36
|
-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
37
|
-
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
38
|
-
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
39
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
40
|
-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
41
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
42
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
43
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
44
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
45
|
-
*
|
|
46
|
-
* @copyright
|
|
47
|
-
*
|
|
48
|
-
* Associate this with the THIRD_PARTY_LICENCE type to ensure it isn't
|
|
49
|
-
* stripped by flow-api-translator.
|
|
50
|
-
*/
|
|
51
|
-
export type THIRD_PARTY_LICENSE = unknown;
|
|
52
|
-
/**
|
|
53
|
-
* Encodes a number to base64 VLQ format and appends it to the passed-in buffer
|
|
54
|
-
*
|
|
55
|
-
* DON'T USE COMPOUND OPERATORS (eg `>>>=`) ON `let`-DECLARED VARIABLES!
|
|
56
|
-
* V8 WILL DEOPTIMIZE THIS FUNCTION AND MAP CREATION WILL BE 25% SLOWER!
|
|
57
|
-
*
|
|
58
|
-
* DON'T ADD MORE COMMENTS TO THIS FUNCTION TO KEEP ITS LENGTH SHORT ENOUGH FOR
|
|
59
|
-
* V8 OPTIMIZATION!
|
|
60
|
-
*/
|
|
61
|
-
declare function encode(
|
|
62
|
-
value: number,
|
|
63
|
-
buffer: Buffer,
|
|
64
|
-
position: number,
|
|
65
|
-
): number;
|
|
66
|
-
export default encode;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {FBSourceFunctionMap} from './source-map';
|
|
12
|
-
import type {PluginObj} from '@babel/core';
|
|
13
|
-
import type {Node as BabelNode} from '@babel/types';
|
|
14
|
-
|
|
15
|
-
type Position = {line: number; column: number};
|
|
16
|
-
type RangeMapping = {name: string; start: Position};
|
|
17
|
-
export type Context = {filename?: null | undefined | string};
|
|
18
|
-
/**
|
|
19
|
-
* Generate a map of source positions to function names. The names are meant to
|
|
20
|
-
* describe the stack frame in an error trace and may contain more contextual
|
|
21
|
-
* information than just the actual name of the function.
|
|
22
|
-
*
|
|
23
|
-
* The output is encoded for use in a source map. For details about the format,
|
|
24
|
-
* see MappingEncoder below.
|
|
25
|
-
*/
|
|
26
|
-
declare function generateFunctionMap(
|
|
27
|
-
ast: BabelNode,
|
|
28
|
-
context?: Context,
|
|
29
|
-
): FBSourceFunctionMap;
|
|
30
|
-
/**
|
|
31
|
-
* Same as generateFunctionMap, but returns the raw array of mappings instead
|
|
32
|
-
* of encoding it for use in a source map.
|
|
33
|
-
*
|
|
34
|
-
* Lines are 1-based and columns are 0-based.
|
|
35
|
-
*/
|
|
36
|
-
declare function generateFunctionMappingsArray(
|
|
37
|
-
ast: BabelNode,
|
|
38
|
-
context?: Context,
|
|
39
|
-
): ReadonlyArray<RangeMapping>;
|
|
40
|
-
declare function functionMapBabelPlugin(): PluginObj;
|
|
41
|
-
export {
|
|
42
|
-
functionMapBabelPlugin,
|
|
43
|
-
generateFunctionMap,
|
|
44
|
-
generateFunctionMappingsArray,
|
|
45
|
-
};
|