@putout/bundle 1.1.2 → 1.1.3
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/bundle/plugin-putout.js +126 -96
- package/package.json +3 -2
package/bundle/plugin-putout.js
CHANGED
|
@@ -194,6 +194,8 @@ function requireApplyRemove () {
|
|
|
194
194
|
return applyRemove;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
var checkReplaceCode = {};
|
|
198
|
+
|
|
197
199
|
var tryCatch;
|
|
198
200
|
var hasRequiredTryCatch;
|
|
199
201
|
|
|
@@ -316,8 +318,6 @@ function requireGenerateCode () {
|
|
|
316
318
|
return generateCode;
|
|
317
319
|
}
|
|
318
320
|
|
|
319
|
-
var checkReplaceCode = {};
|
|
320
|
-
|
|
321
321
|
var hasRequiredCheckReplaceCode;
|
|
322
322
|
|
|
323
323
|
function requireCheckReplaceCode () {
|
|
@@ -933,96 +933,6 @@ function requireConvertReplaceToFunction () {
|
|
|
933
933
|
return convertReplaceToFunction;
|
|
934
934
|
}
|
|
935
935
|
|
|
936
|
-
var convertReplaceWithMultiple = {};
|
|
937
|
-
|
|
938
|
-
var hasRequiredConvertReplaceWithMultiple;
|
|
939
|
-
|
|
940
|
-
function requireConvertReplaceWithMultiple () {
|
|
941
|
-
if (hasRequiredConvertReplaceWithMultiple) return convertReplaceWithMultiple;
|
|
942
|
-
hasRequiredConvertReplaceWithMultiple = 1;
|
|
943
|
-
|
|
944
|
-
const {
|
|
945
|
-
operator,
|
|
946
|
-
template,
|
|
947
|
-
types,
|
|
948
|
-
} = require$$0$1;
|
|
949
|
-
|
|
950
|
-
const {
|
|
951
|
-
insertAfter,
|
|
952
|
-
replaceWith,
|
|
953
|
-
} = operator;
|
|
954
|
-
|
|
955
|
-
const {
|
|
956
|
-
Identifier,
|
|
957
|
-
ObjectProperty,
|
|
958
|
-
} = types;
|
|
959
|
-
|
|
960
|
-
convertReplaceWithMultiple.report = () => {
|
|
961
|
-
return `"operate.replaceWithMultiple" should be called instead of "path.replaceWithMultiple"`;
|
|
962
|
-
};
|
|
963
|
-
|
|
964
|
-
const replaceWithAST = template.ast(`
|
|
965
|
-
const {replaceWithMultiple} = require('putout').operate;
|
|
966
|
-
`);
|
|
967
|
-
|
|
968
|
-
convertReplaceWithMultiple.fix = ({path, calleePath, property, object, program}) => {
|
|
969
|
-
const strictModePath = program.get('body.0');
|
|
970
|
-
const {bindings} = strictModePath.scope;
|
|
971
|
-
|
|
972
|
-
replaceWith(calleePath, property);
|
|
973
|
-
path.node.arguments.unshift(object);
|
|
974
|
-
|
|
975
|
-
if (bindings.replaceWithMultiple)
|
|
976
|
-
return;
|
|
977
|
-
|
|
978
|
-
if (!bindings.replaceWith && !bindings.insertAfter)
|
|
979
|
-
return insertAfter(strictModePath, replaceWithAST);
|
|
980
|
-
|
|
981
|
-
const id = Identifier('replaceWithMultiple');
|
|
982
|
-
|
|
983
|
-
const varPath = getVarPath(bindings);
|
|
984
|
-
varPath.node.id.properties
|
|
985
|
-
.push(ObjectProperty(id, id, false, true));
|
|
986
|
-
};
|
|
987
|
-
|
|
988
|
-
function getVarPath(bindings) {
|
|
989
|
-
const {
|
|
990
|
-
replaceWith,
|
|
991
|
-
insertAfter,
|
|
992
|
-
} = bindings;
|
|
993
|
-
|
|
994
|
-
if (replaceWith)
|
|
995
|
-
return replaceWith.path;
|
|
996
|
-
|
|
997
|
-
return insertAfter.path;
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
convertReplaceWithMultiple.traverse = ({push}) => ({
|
|
1001
|
-
CallExpression(path) {
|
|
1002
|
-
const calleePath = path.get('callee');
|
|
1003
|
-
|
|
1004
|
-
if (!calleePath.isMemberExpression())
|
|
1005
|
-
return;
|
|
1006
|
-
|
|
1007
|
-
const {object, property} = calleePath.node;
|
|
1008
|
-
|
|
1009
|
-
if (property.name !== 'replaceWithMultiple')
|
|
1010
|
-
return;
|
|
1011
|
-
|
|
1012
|
-
const program = path.findParent((path) => path.isProgram());
|
|
1013
|
-
|
|
1014
|
-
push({
|
|
1015
|
-
path,
|
|
1016
|
-
object,
|
|
1017
|
-
program,
|
|
1018
|
-
calleePath,
|
|
1019
|
-
property,
|
|
1020
|
-
});
|
|
1021
|
-
},
|
|
1022
|
-
});
|
|
1023
|
-
return convertReplaceWithMultiple;
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
936
|
var convertReplaceWith = {};
|
|
1027
937
|
|
|
1028
938
|
var fullstore;
|
|
@@ -1154,6 +1064,96 @@ function requireConvertReplaceWith () {
|
|
|
1154
1064
|
return convertReplaceWith;
|
|
1155
1065
|
}
|
|
1156
1066
|
|
|
1067
|
+
var convertReplaceWithMultiple = {};
|
|
1068
|
+
|
|
1069
|
+
var hasRequiredConvertReplaceWithMultiple;
|
|
1070
|
+
|
|
1071
|
+
function requireConvertReplaceWithMultiple () {
|
|
1072
|
+
if (hasRequiredConvertReplaceWithMultiple) return convertReplaceWithMultiple;
|
|
1073
|
+
hasRequiredConvertReplaceWithMultiple = 1;
|
|
1074
|
+
|
|
1075
|
+
const {
|
|
1076
|
+
operator,
|
|
1077
|
+
template,
|
|
1078
|
+
types,
|
|
1079
|
+
} = require$$0$1;
|
|
1080
|
+
|
|
1081
|
+
const {
|
|
1082
|
+
insertAfter,
|
|
1083
|
+
replaceWith,
|
|
1084
|
+
} = operator;
|
|
1085
|
+
|
|
1086
|
+
const {
|
|
1087
|
+
Identifier,
|
|
1088
|
+
ObjectProperty,
|
|
1089
|
+
} = types;
|
|
1090
|
+
|
|
1091
|
+
convertReplaceWithMultiple.report = () => {
|
|
1092
|
+
return `"operate.replaceWithMultiple" should be called instead of "path.replaceWithMultiple"`;
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
const replaceWithAST = template.ast(`
|
|
1096
|
+
const {replaceWithMultiple} = require('putout').operate;
|
|
1097
|
+
`);
|
|
1098
|
+
|
|
1099
|
+
convertReplaceWithMultiple.fix = ({path, calleePath, property, object, program}) => {
|
|
1100
|
+
const strictModePath = program.get('body.0');
|
|
1101
|
+
const {bindings} = strictModePath.scope;
|
|
1102
|
+
|
|
1103
|
+
replaceWith(calleePath, property);
|
|
1104
|
+
path.node.arguments.unshift(object);
|
|
1105
|
+
|
|
1106
|
+
if (bindings.replaceWithMultiple)
|
|
1107
|
+
return;
|
|
1108
|
+
|
|
1109
|
+
if (!bindings.replaceWith && !bindings.insertAfter)
|
|
1110
|
+
return insertAfter(strictModePath, replaceWithAST);
|
|
1111
|
+
|
|
1112
|
+
const id = Identifier('replaceWithMultiple');
|
|
1113
|
+
|
|
1114
|
+
const varPath = getVarPath(bindings);
|
|
1115
|
+
varPath.node.id.properties
|
|
1116
|
+
.push(ObjectProperty(id, id, false, true));
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
function getVarPath(bindings) {
|
|
1120
|
+
const {
|
|
1121
|
+
replaceWith,
|
|
1122
|
+
insertAfter,
|
|
1123
|
+
} = bindings;
|
|
1124
|
+
|
|
1125
|
+
if (replaceWith)
|
|
1126
|
+
return replaceWith.path;
|
|
1127
|
+
|
|
1128
|
+
return insertAfter.path;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
convertReplaceWithMultiple.traverse = ({push}) => ({
|
|
1132
|
+
CallExpression(path) {
|
|
1133
|
+
const calleePath = path.get('callee');
|
|
1134
|
+
|
|
1135
|
+
if (!calleePath.isMemberExpression())
|
|
1136
|
+
return;
|
|
1137
|
+
|
|
1138
|
+
const {object, property} = calleePath.node;
|
|
1139
|
+
|
|
1140
|
+
if (property.name !== 'replaceWithMultiple')
|
|
1141
|
+
return;
|
|
1142
|
+
|
|
1143
|
+
const program = path.findParent((path) => path.isProgram());
|
|
1144
|
+
|
|
1145
|
+
push({
|
|
1146
|
+
path,
|
|
1147
|
+
object,
|
|
1148
|
+
program,
|
|
1149
|
+
calleePath,
|
|
1150
|
+
property,
|
|
1151
|
+
});
|
|
1152
|
+
},
|
|
1153
|
+
});
|
|
1154
|
+
return convertReplaceWithMultiple;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
1157
|
var convertReportToFunction = {};
|
|
1158
1158
|
|
|
1159
1159
|
var hasRequiredConvertReportToFunction;
|
|
@@ -3037,41 +3037,71 @@ var dynamicModules;
|
|
|
3037
3037
|
|
|
3038
3038
|
function getDynamicModules() {
|
|
3039
3039
|
return dynamicModules || (dynamicModules = {
|
|
3040
|
+
"/node_modules/@putout/plugin-putout/lib/add-args": requireAddArgs,
|
|
3040
3041
|
"/node_modules/@putout/plugin-putout/lib/add-args/index.js": requireAddArgs,
|
|
3042
|
+
"/node_modules/@putout/plugin-putout/lib/add-push": requireAddPush,
|
|
3041
3043
|
"/node_modules/@putout/plugin-putout/lib/add-push/index.js": requireAddPush,
|
|
3044
|
+
"/node_modules/@putout/plugin-putout/lib/apply-async-formatter": requireApplyAsyncFormatter,
|
|
3042
3045
|
"/node_modules/@putout/plugin-putout/lib/apply-async-formatter/index.js": requireApplyAsyncFormatter,
|
|
3046
|
+
"/node_modules/@putout/plugin-putout/lib/apply-create-test": requireApplyCreateTest,
|
|
3043
3047
|
"/node_modules/@putout/plugin-putout/lib/apply-create-test/index.js": requireApplyCreateTest,
|
|
3048
|
+
"/node_modules/@putout/plugin-putout/lib/apply-processors-destructuring": requireApplyProcessorsDestructuring,
|
|
3044
3049
|
"/node_modules/@putout/plugin-putout/lib/apply-processors-destructuring/index.js": requireApplyProcessorsDestructuring,
|
|
3050
|
+
"/node_modules/@putout/plugin-putout/lib/apply-remove": requireApplyRemove,
|
|
3045
3051
|
"/node_modules/@putout/plugin-putout/lib/apply-remove/index.js": requireApplyRemove,
|
|
3046
|
-
"/node_modules/@putout/plugin-putout/lib/check-replace-code
|
|
3052
|
+
"/node_modules/@putout/plugin-putout/lib/check-replace-code": requireCheckReplaceCode,
|
|
3047
3053
|
"/node_modules/@putout/plugin-putout/lib/check-replace-code/index.js": requireCheckReplaceCode,
|
|
3054
|
+
"/node_modules/@putout/plugin-putout/lib/convert-add-argument-to-add-args": requireConvertAddArgumentToAddArgs,
|
|
3048
3055
|
"/node_modules/@putout/plugin-putout/lib/convert-add-argument-to-add-args/index.js": requireConvertAddArgumentToAddArgs,
|
|
3056
|
+
"/node_modules/@putout/plugin-putout/lib/convert-babel-types": requireConvertBabelTypes,
|
|
3049
3057
|
"/node_modules/@putout/plugin-putout/lib/convert-babel-types/index.js": requireConvertBabelTypes,
|
|
3058
|
+
"/node_modules/@putout/plugin-putout/lib/convert-destructuring-to-identifier": requireConvertDestructuringToIdentifier,
|
|
3050
3059
|
"/node_modules/@putout/plugin-putout/lib/convert-destructuring-to-identifier/index.js": requireConvertDestructuringToIdentifier,
|
|
3060
|
+
"/node_modules/@putout/plugin-putout/lib/convert-dirname-to-url": requireConvertDirnameToUrl,
|
|
3051
3061
|
"/node_modules/@putout/plugin-putout/lib/convert-dirname-to-url/index.js": requireConvertDirnameToUrl,
|
|
3062
|
+
"/node_modules/@putout/plugin-putout/lib/convert-find-to-traverse": requireConvertFindToTraverse,
|
|
3052
3063
|
"/node_modules/@putout/plugin-putout/lib/convert-find-to-traverse/index.js": requireConvertFindToTraverse,
|
|
3064
|
+
"/node_modules/@putout/plugin-putout/lib/convert-match-to-function": requireConvertMatchToFunction,
|
|
3053
3065
|
"/node_modules/@putout/plugin-putout/lib/convert-match-to-function/index.js": requireConvertMatchToFunction,
|
|
3066
|
+
"/node_modules/@putout/plugin-putout/lib/convert-method-to-property": requireConvertMethodToProperty,
|
|
3054
3067
|
"/node_modules/@putout/plugin-putout/lib/convert-method-to-property/index.js": requireConvertMethodToProperty,
|
|
3068
|
+
"/node_modules/@putout/plugin-putout/lib/convert-node-to-path-in-get-template-values": requireConvertNodeToPathInGetTemplateValues,
|
|
3055
3069
|
"/node_modules/@putout/plugin-putout/lib/convert-node-to-path-in-get-template-values/index.js": requireConvertNodeToPathInGetTemplateValues,
|
|
3070
|
+
"/node_modules/@putout/plugin-putout/lib/convert-number-to-numeric": requireConvertNumberToNumeric,
|
|
3056
3071
|
"/node_modules/@putout/plugin-putout/lib/convert-number-to-numeric/index.js": requireConvertNumberToNumeric,
|
|
3072
|
+
"/node_modules/@putout/plugin-putout/lib/convert-process-to-find": requireConvertProcessToFind,
|
|
3057
3073
|
"/node_modules/@putout/plugin-putout/lib/convert-process-to-find/index.js": requireConvertProcessToFind,
|
|
3074
|
+
"/node_modules/@putout/plugin-putout/lib/convert-putout-test-to-create-test": requireConvertPutoutTestToCreateTest,
|
|
3058
3075
|
"/node_modules/@putout/plugin-putout/lib/convert-putout-test-to-create-test/index.js": requireConvertPutoutTestToCreateTest,
|
|
3076
|
+
"/node_modules/@putout/plugin-putout/lib/convert-replace-to-function": requireConvertReplaceToFunction,
|
|
3059
3077
|
"/node_modules/@putout/plugin-putout/lib/convert-replace-to-function/index.js": requireConvertReplaceToFunction,
|
|
3060
|
-
"/node_modules/@putout/plugin-putout/lib/convert-replace-with
|
|
3078
|
+
"/node_modules/@putout/plugin-putout/lib/convert-replace-with": requireConvertReplaceWith,
|
|
3061
3079
|
"/node_modules/@putout/plugin-putout/lib/convert-replace-with/index.js": requireConvertReplaceWith,
|
|
3080
|
+
"/node_modules/@putout/plugin-putout/lib/convert-replace-with-multiple": requireConvertReplaceWithMultiple,
|
|
3081
|
+
"/node_modules/@putout/plugin-putout/lib/convert-replace-with-multiple/index.js": requireConvertReplaceWithMultiple,
|
|
3082
|
+
"/node_modules/@putout/plugin-putout/lib/convert-report-to-function": requireConvertReportToFunction,
|
|
3062
3083
|
"/node_modules/@putout/plugin-putout/lib/convert-report-to-function/index.js": requireConvertReportToFunction,
|
|
3084
|
+
"/node_modules/@putout/plugin-putout/lib/convert-to-no-transform-code": requireConvertToNoTransformCode,
|
|
3063
3085
|
"/node_modules/@putout/plugin-putout/lib/convert-to-no-transform-code/index.js": requireConvertToNoTransformCode,
|
|
3086
|
+
"/node_modules/@putout/plugin-putout/lib/convert-traverse-to-include": requireConvertTraverseToInclude,
|
|
3064
3087
|
"/node_modules/@putout/plugin-putout/lib/convert-traverse-to-include/index.js": requireConvertTraverseToInclude,
|
|
3088
|
+
"/node_modules/@putout/plugin-putout/lib/convert-traverse-to-replace": requireConvertTraverseToReplace,
|
|
3065
3089
|
"/node_modules/@putout/plugin-putout/lib/convert-traverse-to-replace/index.js": requireConvertTraverseToReplace,
|
|
3090
|
+
"/node_modules/@putout/plugin-putout/lib/convert-url-to-dirname": requireConvertUrlToDirname,
|
|
3066
3091
|
"/node_modules/@putout/plugin-putout/lib/convert-url-to-dirname/index.js": requireConvertUrlToDirname,
|
|
3067
|
-
"/node_modules/@putout/plugin-putout/lib/declare
|
|
3092
|
+
"/node_modules/@putout/plugin-putout/lib/declare": requireDeclare,
|
|
3068
3093
|
"/node_modules/@putout/plugin-putout/lib/declare/index.js": requireDeclare,
|
|
3069
|
-
"/node_modules/@putout/plugin-putout/lib/
|
|
3094
|
+
"/node_modules/@putout/plugin-putout/lib/includer": requireIncluder,
|
|
3070
3095
|
"/node_modules/@putout/plugin-putout/lib/includer/index.js": requireIncluder,
|
|
3096
|
+
"/node_modules/@putout/plugin-putout/lib/move-require-on-top-level": requireMoveRequireOnTopLevel,
|
|
3071
3097
|
"/node_modules/@putout/plugin-putout/lib/move-require-on-top-level/index.js": requireMoveRequireOnTopLevel,
|
|
3098
|
+
"/node_modules/@putout/plugin-putout/lib/rename-operate-to-operator": requireRenameOperateToOperator,
|
|
3072
3099
|
"/node_modules/@putout/plugin-putout/lib/rename-operate-to-operator/index.js": requireRenameOperateToOperator,
|
|
3100
|
+
"/node_modules/@putout/plugin-putout/lib/replace-operate-with-operator": requireReplaceOperateWithOperator,
|
|
3073
3101
|
"/node_modules/@putout/plugin-putout/lib/replace-operate-with-operator/index.js": requireReplaceOperateWithOperator,
|
|
3102
|
+
"/node_modules/@putout/plugin-putout/lib/replace-test-message": requireReplaceTestMessage,
|
|
3074
3103
|
"/node_modules/@putout/plugin-putout/lib/replace-test-message/index.js": requireReplaceTestMessage,
|
|
3104
|
+
"/node_modules/@putout/plugin-putout/lib/shorten-imports": requireShortenImports,
|
|
3075
3105
|
"/node_modules/@putout/plugin-putout/lib/shorten-imports/index.js": requireShortenImports
|
|
3076
3106
|
});
|
|
3077
3107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/bundle",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"commitType": "colon",
|
|
6
6
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
"fix:lint": "madrun fix:lint",
|
|
30
30
|
"coverage": "madrun coverage",
|
|
31
31
|
"report": "madrun report",
|
|
32
|
+
"build": "madrun build",
|
|
32
33
|
"build:putout": "madrun build:putout",
|
|
33
|
-
"build:
|
|
34
|
+
"build:plugins:putout": "madrun build:plugins:putout",
|
|
34
35
|
"wisdom": "madrun wisdom"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {},
|