@putout/bundle 5.2.0 → 5.2.2
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 +114 -105
- package/bundle/putout.min.js +1 -1
- package/bundle/putout.slim.js +114 -105
- package/package.json +2 -2
package/bundle/putout.slim.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$
|
|
47
|
+
var fullstore$2 = fullstore$1;
|
|
48
48
|
|
|
49
49
|
var global$1 = (typeof global !== "undefined" ? global :
|
|
50
50
|
typeof self !== "undefined" ? self :
|
|
@@ -59106,7 +59106,7 @@ const tokenize = (ast, overrides) => {
|
|
|
59106
59106
|
traverse,
|
|
59107
59107
|
maybe,
|
|
59108
59108
|
quote,
|
|
59109
|
-
store: fullstore$
|
|
59109
|
+
store: fullstore$2(),
|
|
59110
59110
|
});
|
|
59111
59111
|
|
|
59112
59112
|
const currentTraversers = {
|
|
@@ -59266,13 +59266,13 @@ var removeBlankLines$1 = lib.default;
|
|
|
59266
59266
|
|
|
59267
59267
|
const __json_name$1 = '__putout_processor_json';
|
|
59268
59268
|
const __yaml_name$1 = '__putout_processor_yaml';
|
|
59269
|
-
const __filesystem_name$
|
|
59269
|
+
const __filesystem_name$3 = '__putout_processor_filesystem';
|
|
59270
59270
|
const __ignore_name$1 = '__putout_processor_ignore';
|
|
59271
59271
|
|
|
59272
59272
|
const TYPES$1 = [
|
|
59273
59273
|
__json_name$1,
|
|
59274
59274
|
__yaml_name$1,
|
|
59275
|
-
__filesystem_name$
|
|
59275
|
+
__filesystem_name$3,
|
|
59276
59276
|
__ignore_name$1,
|
|
59277
59277
|
];
|
|
59278
59278
|
|
|
@@ -61945,7 +61945,7 @@ const isString$6 = (a) => typeof a === 'string';
|
|
|
61945
61945
|
const isUndefined = (a) => typeof a === 'undefined';
|
|
61946
61946
|
const isEmpty = (obj) => !Object.keys(obj).length;
|
|
61947
61947
|
|
|
61948
|
-
|
|
61948
|
+
function jessy(selector, divider, value) {
|
|
61949
61949
|
if (!value) {
|
|
61950
61950
|
value = divider;
|
|
61951
61951
|
divider = '.';
|
|
@@ -61982,7 +61982,7 @@ var jessy = (selector, divider, value) => {
|
|
|
61982
61982
|
}
|
|
61983
61983
|
|
|
61984
61984
|
return value;
|
|
61985
|
-
}
|
|
61985
|
+
}
|
|
61986
61986
|
|
|
61987
61987
|
function check$7(selector, obj) {
|
|
61988
61988
|
if (!isString$6(selector))
|
|
@@ -61992,14 +61992,12 @@ function check$7(selector, obj) {
|
|
|
61992
61992
|
throw Error('obj should be object!');
|
|
61993
61993
|
}
|
|
61994
61994
|
|
|
61995
|
-
var jessy$1 = jessy.default;
|
|
61996
|
-
|
|
61997
61995
|
const isNumber$1 = (a) => !Number.isNaN(a) && typeof a === 'number';
|
|
61998
61996
|
const isNumberLike = (a, b = Number(a)) => isNumber$1(b);
|
|
61999
61997
|
const isString$5 = (a) => typeof a === 'string';
|
|
62000
61998
|
const notSecure = (a) => /__proto__|prototype/.test(a);
|
|
62001
61999
|
|
|
62002
|
-
|
|
62000
|
+
function nessy(selector, value, divider, obj) {
|
|
62003
62001
|
if (!obj) {
|
|
62004
62002
|
obj = divider || {};
|
|
62005
62003
|
divider = '.';
|
|
@@ -62012,6 +62010,7 @@ var nessy = (selector, value, divider, obj) => {
|
|
|
62012
62010
|
const array = selector
|
|
62013
62011
|
.split(divider)
|
|
62014
62012
|
.filter(Boolean);
|
|
62013
|
+
|
|
62015
62014
|
const n = array.length - 1;
|
|
62016
62015
|
|
|
62017
62016
|
for (const [i, name] of array.entries()) {
|
|
@@ -62025,21 +62024,17 @@ var nessy = (selector, value, divider, obj) => {
|
|
|
62025
62024
|
|
|
62026
62025
|
obj[name] = isNumberLike(nextKey) ? [] : {};
|
|
62027
62026
|
}
|
|
62028
|
-
|
|
62029
62027
|
|
|
62030
62028
|
obj = obj[name];
|
|
62031
62029
|
}
|
|
62032
62030
|
|
|
62033
62031
|
return result;
|
|
62034
|
-
}
|
|
62035
|
-
|
|
62032
|
+
}
|
|
62036
62033
|
function check$6(selector) {
|
|
62037
62034
|
if (!isString$5(selector))
|
|
62038
62035
|
throw Error('selector should be string!');
|
|
62039
62036
|
}
|
|
62040
62037
|
|
|
62041
|
-
var nessy$1 = nessy.default;
|
|
62042
|
-
|
|
62043
62038
|
const TS_MODULE_REG = /\.body\.0\.expression$/;
|
|
62044
62039
|
const CLASS_BODY_REG = /\.body\.0\.key$/;
|
|
62045
62040
|
const BODY_REG = /\.body\.0$/;
|
|
@@ -62499,7 +62494,7 @@ function getValues({waysFrom, node}) {
|
|
|
62499
62494
|
if (isBodyStr(name))
|
|
62500
62495
|
way = prepareBodyWay(way);
|
|
62501
62496
|
|
|
62502
|
-
result[name] = result[name] || extractExpression$1(jessy
|
|
62497
|
+
result[name] = result[name] || extractExpression$1(jessy(way, node));
|
|
62503
62498
|
}
|
|
62504
62499
|
}
|
|
62505
62500
|
|
|
@@ -62534,14 +62529,14 @@ function setValues({waysTo, values, path}) {
|
|
|
62534
62529
|
raw: makeRaw(value),
|
|
62535
62530
|
});
|
|
62536
62531
|
|
|
62537
|
-
nessy
|
|
62532
|
+
nessy(way, element, node);
|
|
62538
62533
|
continue;
|
|
62539
62534
|
}
|
|
62540
62535
|
|
|
62541
62536
|
if (isBodyStr(name))
|
|
62542
62537
|
way = prepareBodyWay(way);
|
|
62543
62538
|
|
|
62544
|
-
const {extra} = jessy
|
|
62539
|
+
const {extra} = jessy(way, node);
|
|
62545
62540
|
|
|
62546
62541
|
if (extra) {
|
|
62547
62542
|
const valueExtra = values[name].extra;
|
|
@@ -62552,7 +62547,7 @@ function setValues({waysTo, values, path}) {
|
|
|
62552
62547
|
};
|
|
62553
62548
|
}
|
|
62554
62549
|
|
|
62555
|
-
nessy
|
|
62550
|
+
nessy(way, values[name], node);
|
|
62556
62551
|
}
|
|
62557
62552
|
}
|
|
62558
62553
|
}
|
|
@@ -64250,10 +64245,101 @@ function validateDeclare(declare) {
|
|
|
64250
64245
|
throw Error(`☝️ Looks like 'declare' property value is not a 'function', but '${typeof declare}' with value '${stringify(declare)}'.`);
|
|
64251
64246
|
}
|
|
64252
64247
|
|
|
64253
|
-
|
|
64254
|
-
|
|
64248
|
+
function fullstore(value) {
|
|
64249
|
+
const data = {
|
|
64250
|
+
value,
|
|
64251
|
+
};
|
|
64252
|
+
|
|
64253
|
+
return (...args) => {
|
|
64254
|
+
const [value] = args;
|
|
64255
|
+
|
|
64256
|
+
if (!args.length)
|
|
64257
|
+
return data.value;
|
|
64258
|
+
|
|
64259
|
+
data.value = value;
|
|
64260
|
+
|
|
64261
|
+
return value;
|
|
64262
|
+
};
|
|
64263
|
+
}
|
|
64264
|
+
|
|
64265
|
+
const cut = (a) => a.slice(0, a.indexOf('('));
|
|
64266
|
+
const createPrefix = (name) => {
|
|
64267
|
+
if (name.includes('('))
|
|
64268
|
+
return `${cut(name)}(`;
|
|
64269
|
+
|
|
64270
|
+
return `${name}(`;
|
|
64271
|
+
};
|
|
64272
|
+
|
|
64273
|
+
const createSuffix = () => ');\n';
|
|
64274
|
+
const maybeNewline = (a) => a.at(-1) === '\n' ? a : `${a}\n`;
|
|
64275
|
+
|
|
64276
|
+
const __json_name = '__putout_processor_json';
|
|
64277
|
+
const __yaml_name = '__putout_processor_yaml';
|
|
64278
|
+
const __toml_name = '__putout_processor_toml';
|
|
64279
|
+
const __filesystem_name$2 = '__putout_processor_filesystem';
|
|
64280
|
+
const __ignore_name = '__putout_processor_ignore';
|
|
64281
|
+
|
|
64282
|
+
const __json = `${__json_name}(__object)`;
|
|
64283
|
+
const __yaml = `${__yaml_name}(__object)`;
|
|
64284
|
+
const __toml = `${__toml_name}(__object)`;
|
|
64285
|
+
const __filesystem = `${__filesystem_name$2}(__object)`;
|
|
64286
|
+
const __ignore = `${__ignore_name}(__array)`;
|
|
64287
|
+
|
|
64288
|
+
const TYPES = [
|
|
64289
|
+
__json_name,
|
|
64290
|
+
__yaml_name,
|
|
64291
|
+
__filesystem_name$2,
|
|
64292
|
+
__ignore_name,
|
|
64293
|
+
];
|
|
64294
|
+
|
|
64295
|
+
const toJS = (source, name = __json) => {
|
|
64296
|
+
const prefix = createPrefix(name);
|
|
64297
|
+
const suffix = createSuffix();
|
|
64298
|
+
|
|
64299
|
+
return `${prefix}${source}${suffix}`;
|
|
64300
|
+
};
|
|
64301
|
+
|
|
64302
|
+
const fromJS = (source, name = __json) => {
|
|
64303
|
+
source = maybeNewline(source);
|
|
64304
|
+
const shortName = cut(name);
|
|
64305
|
+
|
|
64306
|
+
source = source.slice(source.indexOf(shortName));
|
|
64307
|
+
|
|
64308
|
+
const prefix = createPrefix(name);
|
|
64309
|
+
const suffix = createSuffix();
|
|
64310
|
+
const length = source.length - suffix.length;
|
|
64311
|
+
const sliced = source.slice(prefix.length, length);
|
|
64312
|
+
|
|
64313
|
+
return maybeNewline(removeBlankLines$1(sliced));
|
|
64314
|
+
};
|
|
64315
|
+
|
|
64316
|
+
const isJSON = (source) => {
|
|
64317
|
+
for (const type of TYPES) {
|
|
64318
|
+
if (!source.indexOf(type))
|
|
64319
|
+
return true;
|
|
64320
|
+
}
|
|
64321
|
+
|
|
64322
|
+
return false;
|
|
64323
|
+
};
|
|
64324
|
+
|
|
64325
|
+
var json = /*#__PURE__*/Object.freeze({
|
|
64326
|
+
__proto__: null,
|
|
64327
|
+
__filesystem: __filesystem,
|
|
64328
|
+
__filesystem_name: __filesystem_name$2,
|
|
64329
|
+
__ignore: __ignore,
|
|
64330
|
+
__ignore_name: __ignore_name,
|
|
64331
|
+
__json: __json,
|
|
64332
|
+
__json_name: __json_name,
|
|
64333
|
+
__toml: __toml,
|
|
64334
|
+
__toml_name: __toml_name,
|
|
64335
|
+
__yaml: __yaml,
|
|
64336
|
+
__yaml_name: __yaml_name,
|
|
64337
|
+
fromJS: fromJS,
|
|
64338
|
+
isJSON: isJSON,
|
|
64339
|
+
toJS: toJS
|
|
64340
|
+
});
|
|
64255
64341
|
|
|
64256
|
-
const driverStore = fullstore
|
|
64342
|
+
const driverStore = fullstore();
|
|
64257
64343
|
|
|
64258
64344
|
const {assign} = Object;
|
|
64259
64345
|
const noop = () => {};
|
|
@@ -64792,83 +64878,6 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(bundle);
|
|
|
64792
64878
|
|
|
64793
64879
|
var require$$3 = /*@__PURE__*/getAugmentedNamespace(filesystem);
|
|
64794
64880
|
|
|
64795
|
-
const cut = (a) => a.slice(0, a.indexOf('('));
|
|
64796
|
-
const createPrefix = (name) => {
|
|
64797
|
-
if (name.includes('('))
|
|
64798
|
-
return `${cut(name)}(`;
|
|
64799
|
-
|
|
64800
|
-
return `${name}(`;
|
|
64801
|
-
};
|
|
64802
|
-
|
|
64803
|
-
const createSuffix = () => ');\n';
|
|
64804
|
-
const maybeNewline = (a) => a.at(-1) === '\n' ? a : `${a}\n`;
|
|
64805
|
-
|
|
64806
|
-
const __json_name = '__putout_processor_json';
|
|
64807
|
-
const __yaml_name = '__putout_processor_yaml';
|
|
64808
|
-
const __toml_name = '__putout_processor_toml';
|
|
64809
|
-
const __filesystem_name$2 = '__putout_processor_filesystem';
|
|
64810
|
-
const __ignore_name = '__putout_processor_ignore';
|
|
64811
|
-
|
|
64812
|
-
const __json = `${__json_name}(__object)`;
|
|
64813
|
-
const __yaml = `${__yaml_name}(__object)`;
|
|
64814
|
-
const __toml = `${__toml_name}(__object)`;
|
|
64815
|
-
const __filesystem = `${__filesystem_name$2}(__object)`;
|
|
64816
|
-
const __ignore = `${__ignore_name}(__array)`;
|
|
64817
|
-
|
|
64818
|
-
const TYPES = [
|
|
64819
|
-
__json_name,
|
|
64820
|
-
__yaml_name,
|
|
64821
|
-
__filesystem_name$2,
|
|
64822
|
-
__ignore_name,
|
|
64823
|
-
];
|
|
64824
|
-
|
|
64825
|
-
const toJS = (source, name = __json) => {
|
|
64826
|
-
const prefix = createPrefix(name);
|
|
64827
|
-
const suffix = createSuffix();
|
|
64828
|
-
|
|
64829
|
-
return `${prefix}${source}${suffix}`;
|
|
64830
|
-
};
|
|
64831
|
-
|
|
64832
|
-
const fromJS = (source, name = __json) => {
|
|
64833
|
-
source = maybeNewline(source);
|
|
64834
|
-
const shortName = cut(name);
|
|
64835
|
-
|
|
64836
|
-
source = source.slice(source.indexOf(shortName));
|
|
64837
|
-
|
|
64838
|
-
const prefix = createPrefix(name);
|
|
64839
|
-
const suffix = createSuffix();
|
|
64840
|
-
const length = source.length - suffix.length;
|
|
64841
|
-
const sliced = source.slice(prefix.length, length);
|
|
64842
|
-
|
|
64843
|
-
return maybeNewline(removeBlankLines$1(sliced));
|
|
64844
|
-
};
|
|
64845
|
-
|
|
64846
|
-
const isJSON = (source) => {
|
|
64847
|
-
for (const type of TYPES) {
|
|
64848
|
-
if (!source.indexOf(type))
|
|
64849
|
-
return true;
|
|
64850
|
-
}
|
|
64851
|
-
|
|
64852
|
-
return false;
|
|
64853
|
-
};
|
|
64854
|
-
|
|
64855
|
-
var json = /*#__PURE__*/Object.freeze({
|
|
64856
|
-
__proto__: null,
|
|
64857
|
-
__filesystem: __filesystem,
|
|
64858
|
-
__filesystem_name: __filesystem_name$2,
|
|
64859
|
-
__ignore: __ignore,
|
|
64860
|
-
__ignore_name: __ignore_name,
|
|
64861
|
-
__json: __json,
|
|
64862
|
-
__json_name: __json_name,
|
|
64863
|
-
__toml: __toml,
|
|
64864
|
-
__toml_name: __toml_name,
|
|
64865
|
-
__yaml: __yaml,
|
|
64866
|
-
__yaml_name: __yaml_name,
|
|
64867
|
-
fromJS: fromJS,
|
|
64868
|
-
isJSON: isJSON,
|
|
64869
|
-
toJS: toJS
|
|
64870
|
-
});
|
|
64871
|
-
|
|
64872
64881
|
var require$$2 = /*@__PURE__*/getAugmentedNamespace(json);
|
|
64873
64882
|
|
|
64874
64883
|
var require$$1 = /*@__PURE__*/getAugmentedNamespace(operate);
|
|
@@ -65143,12 +65152,12 @@ const createTrackFile = (fileProgress) => function*(...a) {
|
|
|
65143
65152
|
};
|
|
65144
65153
|
|
|
65145
65154
|
const getTraverse = ({scan, rule, progress}) => ({push, options}) => ({
|
|
65146
|
-
[`${
|
|
65155
|
+
[`${__filesystem_name$2}(__)`](path) {
|
|
65147
65156
|
log(rule);
|
|
65148
65157
|
progress.start(rule);
|
|
65149
65158
|
|
|
65150
65159
|
const rootPath = path.get('arguments.0');
|
|
65151
|
-
const isSimple = fullstore
|
|
65160
|
+
const isSimple = fullstore(false);
|
|
65152
65161
|
|
|
65153
65162
|
const fileProgress = createFileProgress({
|
|
65154
65163
|
rule,
|
|
@@ -65214,18 +65223,18 @@ function runSimple(plugin, {path, isSimple, shouldConvert = true}) {
|
|
|
65214
65223
|
}
|
|
65215
65224
|
|
|
65216
65225
|
function parseVisitor(visitors) {
|
|
65217
|
-
const to = visitors[`${
|
|
65218
|
-
const from = visitors[`${
|
|
65226
|
+
const to = visitors[`${__filesystem_name$2}(__object)`];
|
|
65227
|
+
const from = visitors[`${__filesystem_name$2}(__array)`];
|
|
65219
65228
|
|
|
65220
65229
|
if (to)
|
|
65221
65230
|
return [
|
|
65222
65231
|
to,
|
|
65223
|
-
`${
|
|
65232
|
+
`${__filesystem_name$2}(__object)`,
|
|
65224
65233
|
];
|
|
65225
65234
|
|
|
65226
65235
|
return [
|
|
65227
65236
|
from,
|
|
65228
|
-
`${
|
|
65237
|
+
`${__filesystem_name$2}(__array)`,
|
|
65229
65238
|
];
|
|
65230
65239
|
}
|
|
65231
65240
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/bundle",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout bundle suitable for Deno and Browsers",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"hermes-parser": "^0.33.0",
|
|
64
64
|
"madrun": "^12.0.0",
|
|
65
65
|
"nodemon": "^3.0.1",
|
|
66
|
-
"putout": "^41.6.
|
|
66
|
+
"putout": "^41.6.5",
|
|
67
67
|
"rollup": "^4.24.2",
|
|
68
68
|
"rollup-plugin-node-externals": "^8.0.0",
|
|
69
69
|
"rollup-plugin-polyfill-node": "^0.13.0",
|