Gathering detailed insights and metrics for @jridgewell/source-map
Gathering detailed insights and metrics for @jridgewell/source-map
Gathering detailed insights and metrics for @jridgewell/source-map
Gathering detailed insights and metrics for @jridgewell/source-map
npm install @jridgewell/source-map
98.6
Supply Chain
98.3
Quality
76.4
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
16 Stars
25 Commits
2 Forks
3 Watching
1 Branches
4 Contributors
Updated on 19 Mar 2024
Minified
Minified + Gzipped
JavaScript (87.32%)
TypeScript (12.68%)
Cumulative downloads
Total Downloads
Last day
-2.9%
4,400,508
Compared to previous day
Last week
3.2%
23,290,885
Compared to previous week
Last month
12.9%
96,037,295
Compared to previous month
Last year
38.8%
990,273,673
Compared to previous year
Packages
@jridgewell/trace-mapping
and@jridgewell/gen-mapping
into the familiar source-map API
This isn't the full API, but it's the core functionality. This wraps @jridgewell/trace-mapping and @jridgewell/gen-mapping implementations.
1npm install @jridgewell/source-map
TODO
1import { SourceMapConsumer } from '@jridgewell/source-map'; 2const smc = new SourceMapConsumer({ 3 version: 3, 4 names: ['foo'], 5 sources: ['input.js'], 6 mappings: 'AAAAA', 7});
Transforms a SourceMapGenerator
into a SourceMapConsumer
.
1const smg = new SourceMapGenerator(); 2 3const smc = SourceMapConsumer.fromSourceMap(map); 4smc.originalPositionFor({ line: 1, column: 0 });
1const smc = new SourceMapConsumer(map); 2smc.originalPositionFor({ line: 1, column: 0 });
1const smc = new SourceMapConsumer(map); 2smc.mappings; // AAAA
1const smc = new SourceMapConsumer(map); 2smc.allGeneratedpositionsfor({ line: 1, column: 5, source: "baz.ts" }); 3// [ 4// { line: 2, column: 8 } 5// ]
This implementation currently does not support the "order" parameter. This function can only iterate in Generated order.
1const smc = new SourceMapConsumer(map); 2smc.eachMapping((mapping) => { 3// { source: 'baz.ts', 4// generatedLine: 4, 5// generatedColumn: 5, 6// originalLine: 4, 7// originalColumn: 5, 8// name: null } 9});
1const smc = new SourceMapConsumer(map); 2smc.generatedPositionFor({ line: 1, column: 5, source: "baz.ts" }); 3// { line: 2, column: 8 }
1const smc = new SourceMapConsumer(map); 2smc.hasContentsOfAllSources(); 3// true
1const smc = new SourceMapConsumer(map); 2smc.generatedPositionFor("baz.ts"); 3// "export default ..."
Returns the source map's version
1import { SourceMapGenerator } from '@jridgewell/source-map'; 2const smg = new SourceMapGenerator({ 3 file: 'output.js', 4 sourceRoot: 'https://example.com/', 5});
Transform a SourceMapConsumer
into a SourceMapGenerator
.
1const smc = new SourceMapConsumer(); 2const smg = SourceMapGenerator.fromSourceMap(smc);
This method is not implemented yet
1const smg = new SourceMapGenerator(); 2smg.addMapping({ 3 generated: { line: 1, column: 0 }, 4 source: 'input.js', 5 original: { line: 1, column: 0 }, 6 name: 'foo', 7});
1const smg = new SourceMapGenerator(); 2smg.setSourceContent('input.js', 'foobar');
1const smg = new SourceMapGenerator(); 2smg.toJSON(); // { version: 3, names: [], sources: [], mappings: '' }
1const smg = new SourceMapGenerator(); 2smg.toJSON(); // "{version:3,names:[],sources:[],mappings:''}"
1const smg = new SourceMapGenerator(); 2smg.toDecodedMap(); // { version: 3, names: [], sources: [], mappings: [] }
This implementation has some differences with source-map
and source-map-js
.
SourceMapConsumer.prototype.eachMapping()
order
argumentSourceMapGenerator.prototype.applySourceMap()
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
7 existing vulnerabilities detected
Details
Reason
Found 3/16 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More