@putout/bundle 3.13.0 → 3.14.0

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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  Usage
9
9
 
10
10
  ```js
11
- import putout from 'https://esm.sh/@putout/bundle@2';
11
+ import {putout} from 'https://esm.sh/@putout/bundle@2';
12
12
  import removeDebugger from 'https://esm.sh/@putout/plugin-remove-debugger?alias=putout:@putout/bundle';
13
13
  import declare from 'https://esm.sh/@putout/plugin-declare-undefined-variables?alias=putout:@putout/bundle';
14
14
 
@@ -29,7 +29,7 @@ console.log(putout('isFn(fn, "hello"); debugger', {
29
29
  When you need to use `@putout/plugin-putout` use:
30
30
 
31
31
  ```js
32
- import putout from 'https://esm.sh/@putout/bundle';
32
+ import {putout} from 'https://esm.sh/@putout/bundle';
33
33
  import pluginPutout from 'https://esm.sh/@putout/plugin-putout?alias=putout@putout/bundle';
34
34
 
35
35
  console.log(putout('compare(a, b)', {
package/bundle/putout.js CHANGED
@@ -29,7 +29,7 @@ function getAugmentedNamespace(n) {
29
29
  return a;
30
30
  }
31
31
 
32
- var putout = {exports: {}};
32
+ var putout$1 = {exports: {}};
33
33
 
34
34
  var global$1 = (typeof global !== "undefined" ? global :
35
35
  typeof self !== "undefined" ? self :
@@ -77358,7 +77358,7 @@ var memberExpressions$1 = {};
77358
77358
 
77359
77359
  var chain$1 = {};
77360
77360
 
77361
- const {assign: assign$e} = Object;
77361
+ const {assign: assign$c} = Object;
77362
77362
 
77363
77363
  chain$1.chain = (path) => {
77364
77364
  const all = [
@@ -77423,7 +77423,7 @@ function build(path) {
77423
77423
  };
77424
77424
 
77425
77425
  if (path.isCallExpression())
77426
- assign$e(prop, {
77426
+ assign$c(prop, {
77427
77427
  args: path.node.arguments.length,
77428
77428
  name: path.node.callee.property?.name || '',
77429
77429
  });
@@ -79089,7 +79089,7 @@ const {
79089
79089
  BlockStatement: BlockStatement$1,
79090
79090
  } = types$l;
79091
79091
 
79092
- const {assign: assign$d} = Object;
79092
+ const {assign: assign$b} = Object;
79093
79093
 
79094
79094
  operate.getBinding = getBinding;
79095
79095
  operate.getBindingPath = getBindingPath;
@@ -79134,7 +79134,7 @@ function replaceWith$4(path, node) {
79134
79134
 
79135
79135
  currentPath.replaceWith(node);
79136
79136
 
79137
- assign$d(currentPath.node, {
79137
+ assign$b(currentPath.node, {
79138
79138
  comments,
79139
79139
  loc,
79140
79140
  });
@@ -83470,7 +83470,7 @@ const {
83470
83470
  const {parseOverrides} = overrides;
83471
83471
 
83472
83472
  const isString$8 = (a) => typeof a === 'string';
83473
- const {assign: assign$c, freeze} = Object;
83473
+ const {assign: assign$a, freeze} = Object;
83474
83474
 
83475
83475
  const GET = '__';
83476
83476
  const get = (path, command) => path.get(command.replace(GET, ''));
@@ -83521,7 +83521,7 @@ tokenize$1.tokenize = (ast, overrides) => {
83521
83521
  });
83522
83522
  };
83523
83523
 
83524
- assign$c(indent, {
83524
+ assign$a(indent, {
83525
83525
  inc: incIndent,
83526
83526
  dec: decIndent,
83527
83527
  });
@@ -83571,7 +83571,7 @@ tokenize$1.tokenize = (ast, overrides) => {
83571
83571
  });
83572
83572
  };
83573
83573
 
83574
- assign$c(write, {
83574
+ assign$a(write, {
83575
83575
  indent,
83576
83576
  newline,
83577
83577
  linebreak,
@@ -83582,7 +83582,7 @@ tokenize$1.tokenize = (ast, overrides) => {
83582
83582
  endOfFile,
83583
83583
  });
83584
83584
 
83585
- assign$c(maybeWrite, {
83585
+ assign$a(maybeWrite, {
83586
83586
  newline: maybeNewline,
83587
83587
  breakline: maybeBreakline,
83588
83588
  linebreak: maybeLinebreak,
@@ -83596,7 +83596,7 @@ tokenize$1.tokenize = (ast, overrides) => {
83596
83596
  space: maybeSpace,
83597
83597
  };
83598
83598
 
83599
- assign$c(maybe.indent, {
83599
+ assign$a(maybe.indent, {
83600
83600
  inc: maybeIndentInc,
83601
83601
  dec: maybeIndentDec,
83602
83602
  });
@@ -83639,7 +83639,7 @@ tokenize$1.tokenize = (ast, overrides) => {
83639
83639
  traverse,
83640
83640
  });
83641
83641
 
83642
- assign$c(print, write, {
83642
+ assign$a(print, write, {
83643
83643
  space,
83644
83644
  round,
83645
83645
  });
@@ -83651,14 +83651,14 @@ tokenize$1.tokenize = (ast, overrides) => {
83651
83651
 
83652
83652
  const maybePrint = (a, b) => a && print(b);
83653
83653
 
83654
- assign$c(maybePrint, {
83654
+ assign$a(maybePrint, {
83655
83655
  newline: maybeNewline,
83656
83656
  breakline: maybeBreakline,
83657
83657
  linebreak: maybeLinebreak,
83658
83658
  space: maybeSpace,
83659
83659
  });
83660
83660
 
83661
- assign$c(printer.maybe, {
83661
+ assign$a(printer.maybe, {
83662
83662
  print: maybePrint,
83663
83663
  });
83664
83664
 
@@ -83967,7 +83967,7 @@ const {
83967
83967
  ObjectMethod,
83968
83968
  } = bundle.types;
83969
83969
 
83970
- const {assign: assign$b} = Object;
83970
+ const {assign: assign$9} = Object;
83971
83971
 
83972
83972
  var traverseObjectExpression$1 = (propertiesPaths) => {
83973
83973
  for (const propPath of propertiesPaths) {
@@ -83981,7 +83981,7 @@ var traverseObjectExpression$1 = (propertiesPaths) => {
83981
83981
  if (method && isFunctionExpression(value)) {
83982
83982
  propPath.replaceWith(ObjectMethod('method', key, value.params, value.body, computed));
83983
83983
 
83984
- assign$b(propPath.node, {
83984
+ assign$9(propPath.node, {
83985
83985
  id: null,
83986
83986
  method: true,
83987
83987
  generator: value.generator,
@@ -84010,7 +84010,7 @@ const {
84010
84010
  Identifier: Identifier$1,
84011
84011
  } = bundle.types;
84012
84012
 
84013
- const {assign: assign$a} = Object;
84013
+ const {assign: assign$8} = Object;
84014
84014
 
84015
84015
  var setClassMethod$1 = (path) => {
84016
84016
  const {node} = path;
@@ -84038,7 +84038,7 @@ var setClassMethod$1 = (path) => {
84038
84038
  });
84039
84039
 
84040
84040
  path.replaceWith(method);
84041
- assign$a(path.node, {
84041
+ assign$8(path.node, {
84042
84042
  loc,
84043
84043
  expression,
84044
84044
  generator,
@@ -84132,12 +84132,12 @@ var convertImportDeclaration$1 = (path) => {
84132
84132
  path.node.attributes = attributes;
84133
84133
  };
84134
84134
 
84135
- const {assign: assign$9} = Object;
84135
+ const {assign: assign$7} = Object;
84136
84136
 
84137
84137
  var convertExportDeclaration$1 = (path) => {
84138
84138
  const {attributes = []} = path.node;
84139
84139
 
84140
- assign$9(path.node, {
84140
+ assign$7(path.node, {
84141
84141
  attributes,
84142
84142
  });
84143
84143
  };
@@ -91839,7 +91839,7 @@ const options = options$1;
91839
91839
  const getFlow = (a) => !a.indexOf('// @flow');
91840
91840
  const clean = (a) => a.filter(Boolean);
91841
91841
  const initBabel = once$6(() => bundle);
91842
- const {assign: assign$8} = Object;
91842
+ const {assign: assign$6} = Object;
91843
91843
 
91844
91844
  // There is a difference in options naming for babel and recast
91845
91845
  // recast -> sourceFileName
@@ -91861,7 +91861,7 @@ babel$1.parse = function babelParse(source, {sourceFilename, isTS, isJSX = true,
91861
91861
  ]),
91862
91862
  };
91863
91863
 
91864
- sourceFilename && assign$8(parserOptions, {
91864
+ sourceFilename && assign$6(parserOptions, {
91865
91865
  sourceFilename,
91866
91866
  });
91867
91867
 
@@ -109977,7 +109977,7 @@ const {
109977
109977
  ExpressionStatement,
109978
109978
  } = types$g;
109979
109979
 
109980
- const {assign: assign$7} = Object;
109980
+ const {assign: assign$5} = Object;
109981
109981
 
109982
109982
  var moveOutDirectives$1 = (ast) => {
109983
109983
  const {body, directives} = ast.program;
@@ -109990,7 +109990,7 @@ var moveOutDirectives$1 = (ast) => {
109990
109990
  for (const directive of directives) {
109991
109991
  const {leadingComments} = directive;
109992
109992
  const {value} = directive.value;
109993
- const expression = assign$7(ExpressionStatement(StringLiteral$4(value)), {
109993
+ const expression = assign$5(ExpressionStatement(StringLiteral$4(value)), {
109994
109994
  leadingComments,
109995
109995
  });
109996
109996
 
@@ -110316,7 +110316,7 @@ const {createRequire} = require$$1;
110316
110316
 
110317
110317
  const tryCatch$3 = tryCatch$5;
110318
110318
  const once$1 = onceExports;
110319
- const {assign: assign$6} = Object;
110319
+ const {assign: assign$4} = Object;
110320
110320
 
110321
110321
  const bigFirst = (a) => `${a[0].toUpperCase()}${a.slice(1)}`;
110322
110322
 
@@ -110329,7 +110329,7 @@ const load = (type) => ({name, namespace}) => {
110329
110329
  const [error, result] = tryCatch$3(customRequire, pluginPath);
110330
110330
 
110331
110331
  if (error?.code === 'ERR_REQUIRE_ESM')
110332
- assign$6(error, {
110332
+ assign$4(error, {
110333
110333
  message: `☝️ Looks like '${name}' is ESM, use 'await putoutAsync()' instead`,
110334
110334
  name,
110335
110335
  });
@@ -110415,7 +110415,7 @@ const {nanomemoize} = require$$0$1;
110415
110415
  const tryToCatch = tryToCatch$1;
110416
110416
  const {simpleImport} = simpleImport$1;
110417
110417
 
110418
- const {assign: assign$5} = Object;
110418
+ const {assign: assign$3} = Object;
110419
110419
  const stub$2 = () => () => {};
110420
110420
 
110421
110421
  asyncLoader.createAsyncLoader = (type) => nanomemoize(async (name, load) => {
@@ -110444,14 +110444,14 @@ async function cleverLoad(names, load = simpleImport) {
110444
110444
  if (e.code === 'ERR_MODULE_NOT_FOUND')
110445
110445
  continue;
110446
110446
 
110447
- assign$5(e, {
110447
+ assign$3(e, {
110448
110448
  message: `${name}: ${e.message}`,
110449
110449
  });
110450
110450
 
110451
110451
  throw e;
110452
110452
  }
110453
110453
 
110454
- assign$5(e, {
110454
+ assign$3(e, {
110455
110455
  message: e.message.replace(/\simported.*/, ''),
110456
110456
  });
110457
110457
 
@@ -111926,7 +111926,7 @@ var store = {};
111926
111926
  const {
111927
111927
  values,
111928
111928
  entries: entries$7,
111929
- assign: assign$4,
111929
+ assign: assign$2,
111930
111930
  } = Object;
111931
111931
 
111932
111932
  const toArray = (a) => Array.from(a);
@@ -111952,7 +111952,7 @@ store.upStore = createStore({
111952
111952
  },
111953
111953
  set(map, name, data) {
111954
111954
  map[name] = map[name] || {};
111955
- assign$4(map[name], data);
111955
+ assign$2(map[name], data);
111956
111956
  },
111957
111957
  });
111958
111958
 
@@ -112030,7 +112030,7 @@ const {
112030
112030
  const shouldSkip = (a) => !a.parent;
112031
112031
  const {merge: merge$2} = traverse$9.visitors;
112032
112032
 
112033
- const {assign: assign$3} = Object;
112033
+ const {assign: assign$1} = Object;
112034
112034
 
112035
112035
  const parse$3 = (name, plugin, options) => {
112036
112036
  const list = [];
@@ -112081,7 +112081,7 @@ var mergeVisitors$1 = (pluginsToMerge, {fix, shebang, template}) => {
112081
112081
  if (!visitor)
112082
112082
  throw Error(`☝️ Visitors cannot be empty in "${rule}"`);
112083
112083
 
112084
- assign$3(options, {
112084
+ assign$1(options, {
112085
112085
  include: parse$3('include', plugin, options),
112086
112086
  exclude: parse$3('exclude', plugin, options),
112087
112087
  });
@@ -113901,7 +113901,7 @@ var maybeFs = {};
113901
113901
  const fullstore$1 = fullstore$3;
113902
113902
  const driverStore = fullstore$1();
113903
113903
 
113904
- const {assign: assign$2} = Object;
113904
+ const {assign} = Object;
113905
113905
  const noop$1 = () => {};
113906
113906
  const returns = (a) => () => a;
113907
113907
 
@@ -113914,7 +113914,7 @@ const defaultFS = {
113914
113914
  copyFile: noop$1,
113915
113915
  };
113916
113916
 
113917
- const maybeFS$1 = assign$2({}, defaultFS);
113917
+ const maybeFS$1 = assign({}, defaultFS);
113918
113918
 
113919
113919
  maybeFs.renameFile = (oldName, newName) => {
113920
113920
  maybeFS$1.renameFile(oldName, newName);
@@ -113943,7 +113943,7 @@ maybeFs.writeFileContent = (name, content) => {
113943
113943
  maybeFs.init = init;
113944
113944
 
113945
113945
  function init(fsDriver) {
113946
- assign$2(maybeFS$1, fsDriver);
113946
+ assign(maybeFS$1, fsDriver);
113947
113947
  }
113948
113948
 
113949
113949
  maybeFs.pause = () => {
@@ -113958,7 +113958,7 @@ maybeFs.start = () => {
113958
113958
  maybeFs.deinit = deinit;
113959
113959
 
113960
113960
  function deinit() {
113961
- assign$2(maybeFS$1, defaultFS);
113961
+ assign(maybeFS$1, defaultFS);
113962
113962
  }
113963
113963
 
113964
113964
  const {join: join$2, basename: basename$1} = require$$0$2;
@@ -123646,7 +123646,7 @@ const ignore$1 = ignore$2;
123646
123646
  const isNegative = (a) => !a.indexOf('!');
123647
123647
  const positive = (a) => a.replace(/^!/, '');
123648
123648
 
123649
- var ignores$1 = (dirOpt, resolvedName, options = {}) => {
123649
+ var ignores$2 = (dirOpt, resolvedName, options = {}) => {
123650
123650
  const relativeName = relative(dirOpt, resolvedName);
123651
123651
  const ignorer = ignore$1();
123652
123652
  const ignoreList = mergeIgnores(options.ignore || []);
@@ -123669,14 +123669,14 @@ function mergeIgnores(ignores) {
123669
123669
  return Array.from(noDuplicates);
123670
123670
  }
123671
123671
 
123672
- ignores$1.default;
123672
+ ignores$2.default;
123673
123673
 
123674
123674
  const path = require$$0$2;
123675
123675
 
123676
123676
  const {parse: parse$2, print: print$1} = parser$6;
123677
123677
  const {transform: transform$1} = transform$5;
123678
123678
  const {findPlaces: findPlaces$1} = findPlaces$2;
123679
- const ignores = ignores$1;
123679
+ const ignores$1 = ignores$2;
123680
123680
 
123681
123681
  const {toJS, fromJS} = json;
123682
123682
 
@@ -123736,7 +123736,7 @@ const createScan = (files) => (mainPath, {push, progress, options}) => {
123736
123736
  const dirPath = getParentDirectory$1(inputFile);
123737
123737
  const inputFilename = getFilename$1(inputFile);
123738
123738
 
123739
- if (ignores(cwd, inputFilename, options))
123739
+ if (ignores$1(cwd, inputFilename, options))
123740
123740
  continue;
123741
123741
 
123742
123742
  allFiles.push({
@@ -124057,7 +124057,7 @@ function parseElements(vars, {property, collector}) {
124057
124057
 
124058
124058
  const {codeFrameColumns} = bundle;
124059
124059
 
124060
- var codeframe = ({source, error, highlightCode = true}) => {
124060
+ var codeframe$1 = ({source, error, highlightCode = true}) => {
124061
124061
  const {message, loc} = error;
124062
124062
 
124063
124063
  if (!loc)
@@ -124073,7 +124073,7 @@ var codeframe = ({source, error, highlightCode = true}) => {
124073
124073
  });
124074
124074
  };
124075
124075
 
124076
- codeframe.default;
124076
+ codeframe$1.default;
124077
124077
 
124078
124078
  const {traverse, types} = bundle;
124079
124079
  const {
@@ -124094,7 +124094,10 @@ const {
124094
124094
 
124095
124095
  const isString = (a) => typeof a === 'string';
124096
124096
 
124097
- putout.exports = (source, opts) => {
124097
+ putout$1.exports = putout;
124098
+ var putout_2 = putout$1.exports.putout = putout;
124099
+
124100
+ function putout(source, opts) {
124098
124101
  check(source);
124099
124102
  opts = defaultOptions(opts);
124100
124103
 
@@ -124138,9 +124141,7 @@ putout.exports = (source, opts) => {
124138
124141
  code,
124139
124142
  places,
124140
124143
  };
124141
- };
124142
-
124143
- putout.exports.putoutAsync = async (source, opts) => {
124144
+ }var putoutAsync = putout$1.exports.putoutAsync = async (source, opts) => {
124144
124145
  check(source);
124145
124146
  opts = defaultOptions(opts);
124146
124147
 
@@ -124186,21 +124187,21 @@ putout.exports.putoutAsync = async (source, opts) => {
124186
124187
  };
124187
124188
  };
124188
124189
 
124189
- var transform_1 = putout.exports.transform = transform;
124190
- putout.exports.transformAsync = transformAsync;
124190
+ var transform_1 = putout$1.exports.transform = transform;
124191
+ var transformAsync_1 = putout$1.exports.transformAsync = transformAsync;
124191
124192
 
124192
- var findPlaces_1 = putout.exports.findPlaces = findPlaces;
124193
- putout.exports.findPlacesAsync = findPlacesAsync;
124193
+ var findPlaces_1 = putout$1.exports.findPlaces = findPlaces;
124194
+ var findPlacesAsync_1 = putout$1.exports.findPlacesAsync = findPlacesAsync;
124194
124195
 
124195
- var parse_1 = putout.exports.parse = parse;
124196
- var print_1 = putout.exports.print = print;
124197
- var traverse_1 = putout.exports.traverse = traverse;
124198
- var types_1 = putout.exports.types = types;
124199
- var template_1 = putout.exports.template = template;
124200
- var generate_1 = putout.exports.generate = generate;
124201
- putout.exports.initReport = report$3;
124196
+ var parse_1 = putout$1.exports.parse = parse;
124197
+ var print_1 = putout$1.exports.print = print;
124198
+ var traverse_1 = putout$1.exports.traverse = traverse;
124199
+ var types_1 = putout$1.exports.types = types;
124200
+ var template_1 = putout$1.exports.template = template;
124201
+ var generate_1 = putout$1.exports.generate = generate;
124202
+ var initReport = putout$1.exports.initReport = report$3;
124202
124203
 
124203
- var operator = putout.exports.operator = {
124204
+ var operator = putout$1.exports.operator = {
124204
124205
  ...operate,
124205
124206
  ...compare$5,
124206
124207
  ...traverse$5,
@@ -124214,36 +124215,14 @@ var operator = putout.exports.operator = {
124214
124215
  ...ignore,
124215
124216
  };
124216
124217
 
124217
- putout.exports.ignores = ignores$1;
124218
- putout.exports.codeframe = codeframe;
124218
+ var ignores = putout$1.exports.ignores = ignores$2;
124219
+ var codeframe = putout$1.exports.codeframe = codeframe$1;
124219
124220
 
124220
124221
  function check(source) {
124221
124222
  if (!isString(source))
124222
124223
  throw Error(`☝️ Looks like 'source' has type '${typeof source}', expected: 'string'`);
124223
124224
  }
124224
124225
 
124225
- var putoutExports = putout.exports;
124226
-
124227
- const {assign: assign$1} = Object;
124228
-
124229
- function esmPutout(...a) {
124230
- return putoutExports(...a);
124231
- }
124232
-
124233
- assign$1(esmPutout, putoutExports);
124234
-
124235
- const {assign} = Object;
124236
-
124237
- assign(esmPutout, {
124238
- parse: parse_1,
124239
- print: print_1,
124240
- traverse: traverse_1,
124241
- generate: generate_1,
124242
- template: template_1,
124243
- operator,
124244
- transform: transform_1,
124245
- findPlaces: findPlaces_1,
124246
- types: types_1,
124247
- });
124226
+ var putoutExports = putout$1.exports;
124248
124227
 
124249
- export { esmPutout as default, findPlaces_1 as findPlaces, generate_1 as generate, operator, parse_1 as parse, print_1 as print, template_1 as template, transform_1 as transform, traverse_1 as traverse, types_1 as types };
124228
+ export { codeframe, putoutExports as default, findPlaces_1 as findPlaces, findPlacesAsync_1 as findPlacesAsync, generate_1 as generate, ignores, initReport, operator, parse_1 as parse, print_1 as print, putout_2 as putout, putoutAsync, template_1 as template, transform_1 as transform, transformAsync_1 as transformAsync, traverse_1 as traverse, types_1 as types };