es-tooling / module-replacements-codemods

MIT License
188 stars 26 forks source link

fix: scaffold script doesn't work for packages with dots in the name #2

Closed ronanru closed 4 months ago

ronanru commented 4 months ago

When I used the scaffold script to generate files for the array.prototype.map package, it added this line to index.js

import array.prototype.map from './array.prototype.map/index.js';

This PR fixes this. Now the generated code is valid js.

import arrayPrototypeMap from './array.prototype.map/index.js';
thepassle commented 4 months ago

Good catch, thanks :)