@putout/bundle 5.2.0 → 5.2.1

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/putout.js CHANGED
@@ -27,7 +27,7 @@ function getAugmentedNamespace(n) {
27
27
  return a;
28
28
  }
29
29
 
30
- var fullstore = (value) => {
30
+ var fullstore$1 = (value) => {
31
31
  const data = {
32
32
  value,
33
33
  };
@@ -44,7 +44,7 @@ var fullstore = (value) => {
44
44
  };
45
45
  };
46
46
 
47
- var fullstore$1 = fullstore.default;
47
+ var fullstore$2 = fullstore$1;
48
48
 
49
49
  var global$1 = (typeof global !== "undefined" ? global :
50
50
  typeof self !== "undefined" ? self :
@@ -59310,7 +59310,7 @@ const tokenize = (ast, overrides) => {
59310
59310
  traverse,
59311
59311
  maybe,
59312
59312
  quote,
59313
- store: fullstore$1(),
59313
+ store: fullstore$2(),
59314
59314
  });
59315
59315
 
59316
59316
  const currentTraversers = {
@@ -59470,13 +59470,13 @@ var removeBlankLines$1 = lib.default;
59470
59470
 
59471
59471
  const __json_name$1 = '__putout_processor_json';
59472
59472
  const __yaml_name$1 = '__putout_processor_yaml';
59473
- const __filesystem_name$4 = '__putout_processor_filesystem';
59473
+ const __filesystem_name$3 = '__putout_processor_filesystem';
59474
59474
  const __ignore_name$1 = '__putout_processor_ignore';
59475
59475
 
59476
59476
  const TYPES$1 = [
59477
59477
  __json_name$1,
59478
59478
  __yaml_name$1,
59479
- __filesystem_name$4,
59479
+ __filesystem_name$3,
59480
59480
  __ignore_name$1,
59481
59481
  ];
59482
59482
 
@@ -64693,10 +64693,101 @@ function validateDeclare(declare) {
64693
64693
  throw Error(`☝️ Looks like 'declare' property value is not a 'function', but '${typeof declare}' with value '${stringify(declare)}'.`);
64694
64694
  }
64695
64695
 
64696
- const __filesystem_name$3 = '__putout_processor_filesystem';
64697
- var __filesystem_name_1 = __filesystem_name$3;
64696
+ function fullstore(value) {
64697
+ const data = {
64698
+ value,
64699
+ };
64700
+
64701
+ return (...args) => {
64702
+ const [value] = args;
64703
+
64704
+ if (!args.length)
64705
+ return data.value;
64706
+
64707
+ data.value = value;
64708
+
64709
+ return value;
64710
+ };
64711
+ }
64712
+
64713
+ const cut = (a) => a.slice(0, a.indexOf('('));
64714
+ const createPrefix = (name) => {
64715
+ if (name.includes('('))
64716
+ return `${cut(name)}(`;
64717
+
64718
+ return `${name}(`;
64719
+ };
64720
+
64721
+ const createSuffix = () => ');\n';
64722
+ const maybeNewline = (a) => a.at(-1) === '\n' ? a : `${a}\n`;
64723
+
64724
+ const __json_name = '__putout_processor_json';
64725
+ const __yaml_name = '__putout_processor_yaml';
64726
+ const __toml_name = '__putout_processor_toml';
64727
+ const __filesystem_name$2 = '__putout_processor_filesystem';
64728
+ const __ignore_name = '__putout_processor_ignore';
64729
+
64730
+ const __json = `${__json_name}(__object)`;
64731
+ const __yaml = `${__yaml_name}(__object)`;
64732
+ const __toml = `${__toml_name}(__object)`;
64733
+ const __filesystem = `${__filesystem_name$2}(__object)`;
64734
+ const __ignore = `${__ignore_name}(__array)`;
64735
+
64736
+ const TYPES = [
64737
+ __json_name,
64738
+ __yaml_name,
64739
+ __filesystem_name$2,
64740
+ __ignore_name,
64741
+ ];
64698
64742
 
64699
- const driverStore = fullstore$1();
64743
+ const toJS = (source, name = __json) => {
64744
+ const prefix = createPrefix(name);
64745
+ const suffix = createSuffix();
64746
+
64747
+ return `${prefix}${source}${suffix}`;
64748
+ };
64749
+
64750
+ const fromJS = (source, name = __json) => {
64751
+ source = maybeNewline(source);
64752
+ const shortName = cut(name);
64753
+
64754
+ source = source.slice(source.indexOf(shortName));
64755
+
64756
+ const prefix = createPrefix(name);
64757
+ const suffix = createSuffix();
64758
+ const length = source.length - suffix.length;
64759
+ const sliced = source.slice(prefix.length, length);
64760
+
64761
+ return maybeNewline(removeBlankLines$1(sliced));
64762
+ };
64763
+
64764
+ const isJSON = (source) => {
64765
+ for (const type of TYPES) {
64766
+ if (!source.indexOf(type))
64767
+ return true;
64768
+ }
64769
+
64770
+ return false;
64771
+ };
64772
+
64773
+ var json = /*#__PURE__*/Object.freeze({
64774
+ __proto__: null,
64775
+ __filesystem: __filesystem,
64776
+ __filesystem_name: __filesystem_name$2,
64777
+ __ignore: __ignore,
64778
+ __ignore_name: __ignore_name,
64779
+ __json: __json,
64780
+ __json_name: __json_name,
64781
+ __toml: __toml,
64782
+ __toml_name: __toml_name,
64783
+ __yaml: __yaml,
64784
+ __yaml_name: __yaml_name,
64785
+ fromJS: fromJS,
64786
+ isJSON: isJSON,
64787
+ toJS: toJS
64788
+ });
64789
+
64790
+ const driverStore = fullstore();
64700
64791
 
64701
64792
  const {assign} = Object;
64702
64793
  const noop = () => {};
@@ -65235,83 +65326,6 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(bundle);
65235
65326
 
65236
65327
  var require$$3 = /*@__PURE__*/getAugmentedNamespace(filesystem);
65237
65328
 
65238
- const cut = (a) => a.slice(0, a.indexOf('('));
65239
- const createPrefix = (name) => {
65240
- if (name.includes('('))
65241
- return `${cut(name)}(`;
65242
-
65243
- return `${name}(`;
65244
- };
65245
-
65246
- const createSuffix = () => ');\n';
65247
- const maybeNewline = (a) => a.at(-1) === '\n' ? a : `${a}\n`;
65248
-
65249
- const __json_name = '__putout_processor_json';
65250
- const __yaml_name = '__putout_processor_yaml';
65251
- const __toml_name = '__putout_processor_toml';
65252
- const __filesystem_name$2 = '__putout_processor_filesystem';
65253
- const __ignore_name = '__putout_processor_ignore';
65254
-
65255
- const __json = `${__json_name}(__object)`;
65256
- const __yaml = `${__yaml_name}(__object)`;
65257
- const __toml = `${__toml_name}(__object)`;
65258
- const __filesystem = `${__filesystem_name$2}(__object)`;
65259
- const __ignore = `${__ignore_name}(__array)`;
65260
-
65261
- const TYPES = [
65262
- __json_name,
65263
- __yaml_name,
65264
- __filesystem_name$2,
65265
- __ignore_name,
65266
- ];
65267
-
65268
- const toJS = (source, name = __json) => {
65269
- const prefix = createPrefix(name);
65270
- const suffix = createSuffix();
65271
-
65272
- return `${prefix}${source}${suffix}`;
65273
- };
65274
-
65275
- const fromJS = (source, name = __json) => {
65276
- source = maybeNewline(source);
65277
- const shortName = cut(name);
65278
-
65279
- source = source.slice(source.indexOf(shortName));
65280
-
65281
- const prefix = createPrefix(name);
65282
- const suffix = createSuffix();
65283
- const length = source.length - suffix.length;
65284
- const sliced = source.slice(prefix.length, length);
65285
-
65286
- return maybeNewline(removeBlankLines$1(sliced));
65287
- };
65288
-
65289
- const isJSON = (source) => {
65290
- for (const type of TYPES) {
65291
- if (!source.indexOf(type))
65292
- return true;
65293
- }
65294
-
65295
- return false;
65296
- };
65297
-
65298
- var json = /*#__PURE__*/Object.freeze({
65299
- __proto__: null,
65300
- __filesystem: __filesystem,
65301
- __filesystem_name: __filesystem_name$2,
65302
- __ignore: __ignore,
65303
- __ignore_name: __ignore_name,
65304
- __json: __json,
65305
- __json_name: __json_name,
65306
- __toml: __toml,
65307
- __toml_name: __toml_name,
65308
- __yaml: __yaml,
65309
- __yaml_name: __yaml_name,
65310
- fromJS: fromJS,
65311
- isJSON: isJSON,
65312
- toJS: toJS
65313
- });
65314
-
65315
65329
  var require$$2 = /*@__PURE__*/getAugmentedNamespace(json);
65316
65330
 
65317
65331
  var require$$1 = /*@__PURE__*/getAugmentedNamespace(operate);
@@ -65586,12 +65600,12 @@ const createTrackFile = (fileProgress) => function*(...a) {
65586
65600
  };
65587
65601
 
65588
65602
  const getTraverse = ({scan, rule, progress}) => ({push, options}) => ({
65589
- [`${__filesystem_name_1}(__)`](path) {
65603
+ [`${__filesystem_name$2}(__)`](path) {
65590
65604
  log(rule);
65591
65605
  progress.start(rule);
65592
65606
 
65593
65607
  const rootPath = path.get('arguments.0');
65594
- const isSimple = fullstore$1(false);
65608
+ const isSimple = fullstore(false);
65595
65609
 
65596
65610
  const fileProgress = createFileProgress({
65597
65611
  rule,
@@ -65657,18 +65671,18 @@ function runSimple(plugin, {path, isSimple, shouldConvert = true}) {
65657
65671
  }
65658
65672
 
65659
65673
  function parseVisitor(visitors) {
65660
- const to = visitors[`${__filesystem_name_1}(__object)`];
65661
- const from = visitors[`${__filesystem_name_1}(__array)`];
65674
+ const to = visitors[`${__filesystem_name$2}(__object)`];
65675
+ const from = visitors[`${__filesystem_name$2}(__array)`];
65662
65676
 
65663
65677
  if (to)
65664
65678
  return [
65665
65679
  to,
65666
- `${__filesystem_name_1}(__object)`,
65680
+ `${__filesystem_name$2}(__object)`,
65667
65681
  ];
65668
65682
 
65669
65683
  return [
65670
65684
  from,
65671
- `${__filesystem_name_1}(__array)`,
65685
+ `${__filesystem_name$2}(__array)`,
65672
65686
  ];
65673
65687
  }
65674
65688