magic-string
Advanced tools
Comparing version 0.26.1 to 0.26.2
{ | ||
"name": "magic-string", | ||
"version": "0.26.1", | ||
"version": "0.26.2", | ||
"description": "Modify strings, generate sourcemaps", | ||
@@ -15,5 +15,6 @@ "keywords": [ | ||
"author": "Rich Harris", | ||
"main": "dist/magic-string.cjs.js", | ||
"module": "dist/magic-string.es.mjs", | ||
"jsnext:main": "dist/magic-string.es.mjs", | ||
"main": "./dist/magic-string.cjs.js", | ||
"module": "./dist/magic-string.es.mjs", | ||
"jsnext:main": "./dist/magic-string.es.mjs", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
@@ -23,6 +24,6 @@ "./package.json": "./package.json", | ||
"import": "./dist/magic-string.es.mjs", | ||
"require": "./dist/magic-string.cjs.js" | ||
"require": "./dist/magic-string.cjs.js", | ||
"types": "./index.d.ts" | ||
} | ||
}, | ||
"typings": "index.d.ts", | ||
"files": [ | ||
@@ -29,0 +30,0 @@ "dist/*", |
@@ -16,3 +16,3 @@ # magic-string | ||
Suppose you have some source code. You want to make some light modifications to it - replacing a few characters here and there, wrapping it with a header and footer, etc - and ideally you'd like to generate a source map at the end of it. You've thought about using something like [recast](https://github.com/benjamn/recast) (which allows you to generate an AST from some JavaScript, manipulate it, and reprint it with a sourcemap without losing your comments and formatting), but it seems like overkill for your needs (or maybe the source code isn't JavaScript). | ||
Suppose you have some source code. You want to make some light modifications to it - replacing a few characters here and there, wrapping it with a header and footer, etc - and ideally you'd like to generate a [source map](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/) at the end of it. You've thought about using something like [recast](https://github.com/benjamn/recast) (which allows you to generate an AST from some JavaScript, manipulate it, and reprint it with a sourcemap without losing your comments and formatting), but it seems like overkill for your needs (or maybe the source code isn't JavaScript). | ||
@@ -178,3 +178,3 @@ Your requirements are, frankly, rather niche. But they're requirements that I also have, and for which I made magic-string. It's a small, fast utility for manipulating strings and generating sourcemaps. | ||
s.replace(foo, 'bar') | ||
s.replace('foo', 'bar') | ||
s.replace(/foo/g, 'bar') | ||
@@ -181,0 +181,0 @@ s.replace(/(\w)(\d+)/g, (_, $1, $2) => $1.toUpperCase() + $2) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
383057