@dolphinweex/weex-harmony-transform 0.1.34 → 0.1.35

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/weexTransform.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolphinweex/weex-harmony-transform",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "description": "weex harmony adapter",
5
5
  "main": "index.js",
6
6
  "files": [
package/weexTransform.js CHANGED
@@ -88,7 +88,7 @@ module.exports = function ({ types: t }) {
88
88
  if (arguments && arguments.length > 0 && arguments[0].value) {
89
89
  const oldPath = arguments[0].value;
90
90
  Object.keys(replaceMap).forEach(key => {
91
- if (oldPath.startsWith(key)) {
91
+ if (oldPath == key) {
92
92
  astPath.node.arguments[0] = {
93
93
  type: 'StringLiteral',
94
94
  value: oldPath.replace(key, replaceMap[key])
@@ -101,7 +101,7 @@ module.exports = function ({ types: t }) {
101
101
  ImportDeclaration(path) {
102
102
  const importPath = path.node.source.value;
103
103
  Object.keys(replaceMap).forEach(key => {
104
- if (importPath.startsWith(key)) {
104
+ if (importPath == key) {
105
105
  path.node.source.value = importPath.replace(key, replaceMap[key]);
106
106
  }
107
107
  });