@quilted/deno 0.1.1 → 0.2.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.
Files changed (84) hide show
  1. package/.quilt/jest/cache/haste-map-0d1fc0b2d0d6281bd555d7e706dc9986-33077ddc4445b8892d3a131c692f283d-2476e5caf667965f67e0306dc239f39f +0 -0
  2. package/.quilt/jest/cache/haste-map-39c473e25d2c113fabcf6ef63ff713e6-33077ddc4445b8892d3a131c692f283d-e7be052fff861377dbd13fb6283a7ebd +0 -0
  3. package/.quilt/jest/cache/haste-map-91c110a0020c6344757e7ecd75abc315-33077ddc4445b8892d3a131c692f283d-e8dbeaae2ab6a61a73f4f5dd75e91d8a +0 -0
  4. package/CHANGELOG.md +25 -0
  5. package/build/cjs/craft.cjs +1 -1
  6. package/build/cjs/request-router.cjs +1 -1
  7. package/build/esm/request-router.mjs +2 -2
  8. package/build/esnext/request-router.esnext +3 -8
  9. package/build/tsconfig.tsbuildinfo +1 -1
  10. package/build/typescript/request-router.d.ts.map +1 -1
  11. package/configuration/rollup.config.js +3 -0
  12. package/package.json +7 -22
  13. package/source/request-router.tsx +3 -2
  14. package/tsconfig.json +1 -1
  15. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/TemplateTag/TemplateTag.cjs +0 -168
  16. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaLists/commaLists.cjs +0 -8
  17. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaListsAnd/commaListsAnd.cjs +0 -8
  18. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaListsOr/commaListsOr.cjs +0 -8
  19. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/html/html.cjs +0 -10
  20. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/inlineArrayTransformer/inlineArrayTransformer.cjs +0 -48
  21. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/inlineLists/inlineLists.cjs +0 -8
  22. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLine/oneLine.cjs +0 -7
  23. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaLists/oneLineCommaLists.cjs +0 -8
  24. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaListsAnd/oneLineCommaListsAnd.cjs +0 -8
  25. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaListsOr/oneLineCommaListsOr.cjs +0 -8
  26. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineInlineLists/oneLineInlineLists.cjs +0 -8
  27. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineTrim/oneLineTrim.cjs +0 -7
  28. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/removeNonPrintingValuesTransformer/removeNonPrintingValuesTransformer.cjs +0 -23
  29. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/replaceResultTransformer/replaceResultTransformer.cjs +0 -22
  30. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/replaceSubstitutionTransformer/replaceSubstitutionTransformer.cjs +0 -22
  31. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/safeHtml/safeHtml.cjs +0 -10
  32. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.cjs +0 -20
  33. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndent/stripIndent.cjs +0 -11
  34. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndentTransformer/stripIndentTransformer.cjs +0 -37
  35. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndents/stripIndents.cjs +0 -7
  36. package/build/cjs/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/trimResultTransformer/trimResultTransformer.cjs +0 -33
  37. package/build/esm/craft.mjs +0 -104
  38. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/TemplateTag/TemplateTag.mjs +0 -164
  39. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaLists/commaLists.mjs +0 -6
  40. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaListsAnd/commaListsAnd.mjs +0 -6
  41. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaListsOr/commaListsOr.mjs +0 -6
  42. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/html/html.mjs +0 -8
  43. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/inlineArrayTransformer/inlineArrayTransformer.mjs +0 -44
  44. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/inlineLists/inlineLists.mjs +0 -6
  45. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLine/oneLine.mjs +0 -5
  46. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaLists/oneLineCommaLists.mjs +0 -6
  47. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaListsAnd/oneLineCommaListsAnd.mjs +0 -6
  48. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaListsOr/oneLineCommaListsOr.mjs +0 -6
  49. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineInlineLists/oneLineInlineLists.mjs +0 -6
  50. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineTrim/oneLineTrim.mjs +0 -5
  51. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/removeNonPrintingValuesTransformer/removeNonPrintingValuesTransformer.mjs +0 -19
  52. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/replaceResultTransformer/replaceResultTransformer.mjs +0 -18
  53. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/replaceSubstitutionTransformer/replaceSubstitutionTransformer.mjs +0 -18
  54. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/safeHtml/safeHtml.mjs +0 -8
  55. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.mjs +0 -16
  56. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndent/stripIndent.mjs +0 -7
  57. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndentTransformer/stripIndentTransformer.mjs +0 -33
  58. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndents/stripIndents.mjs +0 -5
  59. package/build/esm/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/trimResultTransformer/trimResultTransformer.mjs +0 -29
  60. package/build/esnext/craft.esnext +0 -104
  61. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/TemplateTag/TemplateTag.esnext +0 -164
  62. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaLists/commaLists.esnext +0 -6
  63. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaListsAnd/commaListsAnd.esnext +0 -6
  64. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaListsOr/commaListsOr.esnext +0 -6
  65. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/html/html.esnext +0 -8
  66. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/inlineArrayTransformer/inlineArrayTransformer.esnext +0 -44
  67. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/inlineLists/inlineLists.esnext +0 -6
  68. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLine/oneLine.esnext +0 -5
  69. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaLists/oneLineCommaLists.esnext +0 -6
  70. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaListsAnd/oneLineCommaListsAnd.esnext +0 -6
  71. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaListsOr/oneLineCommaListsOr.esnext +0 -6
  72. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineInlineLists/oneLineInlineLists.esnext +0 -6
  73. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineTrim/oneLineTrim.esnext +0 -5
  74. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/removeNonPrintingValuesTransformer/removeNonPrintingValuesTransformer.esnext +0 -19
  75. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/replaceResultTransformer/replaceResultTransformer.esnext +0 -18
  76. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/replaceSubstitutionTransformer/replaceSubstitutionTransformer.esnext +0 -18
  77. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/safeHtml/safeHtml.esnext +0 -8
  78. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.esnext +0 -16
  79. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndent/stripIndent.esnext +0 -7
  80. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndentTransformer/stripIndentTransformer.esnext +0 -33
  81. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndents/stripIndents.esnext +0 -5
  82. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/trimResultTransformer/trimResultTransformer.esnext +0 -29
  83. package/quilt.project.ts +0 -5
  84. package/source/craft.ts +0 -128
@@ -1,168 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
6
-
7
- var _templateObject = _taggedTemplateLiteral(['', ''], ['', '']);
8
-
9
- function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
10
-
11
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
-
13
- /**
14
- * @class TemplateTag
15
- * @classdesc Consumes a pipeline of composable transformer plugins and produces a template tag.
16
- */
17
- var TemplateTag = function () {
18
- /**
19
- * constructs a template tag
20
- * @constructs TemplateTag
21
- * @param {...Object} [...transformers] - an array or arguments list of transformers
22
- * @return {Function} - a template tag
23
- */
24
- function TemplateTag() {
25
- var _this = this;
26
-
27
- for (var _len = arguments.length, transformers = Array(_len), _key = 0; _key < _len; _key++) {
28
- transformers[_key] = arguments[_key];
29
- }
30
-
31
- _classCallCheck(this, TemplateTag);
32
-
33
- this.tag = function (strings) {
34
- for (var _len2 = arguments.length, expressions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
35
- expressions[_key2 - 1] = arguments[_key2];
36
- }
37
-
38
- if (typeof strings === 'function') {
39
- // if the first argument passed is a function, assume it is a template tag and return
40
- // an intermediary tag that processes the template using the aforementioned tag, passing the
41
- // result to our tag
42
- return _this.interimTag.bind(_this, strings);
43
- }
44
-
45
- if (typeof strings === 'string') {
46
- // if the first argument passed is a string, just transform it
47
- return _this.transformEndResult(strings);
48
- }
49
-
50
- // else, return a transformed end result of processing the template with our tag
51
- strings = strings.map(_this.transformString.bind(_this));
52
- return _this.transformEndResult(strings.reduce(_this.processSubstitutions.bind(_this, expressions)));
53
- };
54
-
55
- // if first argument is an array, extrude it as a list of transformers
56
- if (transformers.length > 0 && Array.isArray(transformers[0])) {
57
- transformers = transformers[0];
58
- }
59
-
60
- // if any transformers are functions, this means they are not initiated - automatically initiate them
61
- this.transformers = transformers.map(function (transformer) {
62
- return typeof transformer === 'function' ? transformer() : transformer;
63
- });
64
-
65
- // return an ES2015 template tag
66
- return this.tag;
67
- }
68
-
69
- /**
70
- * Applies all transformers to a template literal tagged with this method.
71
- * If a function is passed as the first argument, assumes the function is a template tag
72
- * and applies it to the template, returning a template tag.
73
- * @param {(Function|String|Array<String>)} strings - Either a template tag or an array containing template strings separated by identifier
74
- * @param {...*} ...expressions - Optional list of substitution values.
75
- * @return {(String|Function)} - Either an intermediary tag function or the results of processing the template.
76
- */
77
-
78
-
79
- _createClass(TemplateTag, [{
80
- key: 'interimTag',
81
-
82
-
83
- /**
84
- * An intermediary template tag that receives a template tag and passes the result of calling the template with the received
85
- * template tag to our own template tag.
86
- * @param {Function} nextTag - the received template tag
87
- * @param {Array<String>} template - the template to process
88
- * @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template
89
- * @return {*} - the final processed value
90
- */
91
- value: function interimTag(previousTag, template) {
92
- for (var _len3 = arguments.length, substitutions = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
93
- substitutions[_key3 - 2] = arguments[_key3];
94
- }
95
-
96
- return this.tag(_templateObject, previousTag.apply(undefined, [template].concat(substitutions)));
97
- }
98
-
99
- /**
100
- * Performs bulk processing on the tagged template, transforming each substitution and then
101
- * concatenating the resulting values into a string.
102
- * @param {Array<*>} substitutions - an array of all remaining substitutions present in this template
103
- * @param {String} resultSoFar - this iteration's result string so far
104
- * @param {String} remainingPart - the template chunk after the current substitution
105
- * @return {String} - the result of joining this iteration's processed substitution with the result
106
- */
107
-
108
- }, {
109
- key: 'processSubstitutions',
110
- value: function processSubstitutions(substitutions, resultSoFar, remainingPart) {
111
- var substitution = this.transformSubstitution(substitutions.shift(), resultSoFar);
112
- return ''.concat(resultSoFar, substitution, remainingPart);
113
- }
114
-
115
- /**
116
- * Iterate through each transformer, applying the transformer's `onString` method to the template
117
- * strings before all substitutions are processed.
118
- * @param {String} str - The input string
119
- * @return {String} - The final results of processing each transformer
120
- */
121
-
122
- }, {
123
- key: 'transformString',
124
- value: function transformString(str) {
125
- var cb = function cb(res, transform) {
126
- return transform.onString ? transform.onString(res) : res;
127
- };
128
- return this.transformers.reduce(cb, str);
129
- }
130
-
131
- /**
132
- * When a substitution is encountered, iterates through each transformer and applies the transformer's
133
- * `onSubstitution` method to the substitution.
134
- * @param {*} substitution - The current substitution
135
- * @param {String} resultSoFar - The result up to and excluding this substitution.
136
- * @return {*} - The final result of applying all substitution transformations.
137
- */
138
-
139
- }, {
140
- key: 'transformSubstitution',
141
- value: function transformSubstitution(substitution, resultSoFar) {
142
- var cb = function cb(res, transform) {
143
- return transform.onSubstitution ? transform.onSubstitution(res, resultSoFar) : res;
144
- };
145
- return this.transformers.reduce(cb, substitution);
146
- }
147
-
148
- /**
149
- * Iterates through each transformer, applying the transformer's `onEndResult` method to the
150
- * template literal after all substitutions have finished processing.
151
- * @param {String} endResult - The processed template, just before it is returned from the tag
152
- * @return {String} - The final results of processing each transformer
153
- */
154
-
155
- }, {
156
- key: 'transformEndResult',
157
- value: function transformEndResult(endResult) {
158
- var cb = function cb(res, transform) {
159
- return transform.onEndResult ? transform.onEndResult(res) : res;
160
- };
161
- return this.transformers.reduce(cb, endResult);
162
- }
163
- }]);
164
-
165
- return TemplateTag;
166
- }();
167
-
168
- exports["default"] = TemplateTag;
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var stripIndentTransformer = require('../stripIndentTransformer/stripIndentTransformer.cjs');
5
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
6
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
7
-
8
- new TemplateTag["default"](inlineArrayTransformer["default"]({ separator: ',' }), stripIndentTransformer["default"], trimResultTransformer["default"]);
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var stripIndentTransformer = require('../stripIndentTransformer/stripIndentTransformer.cjs');
5
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
6
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
7
-
8
- new TemplateTag["default"](inlineArrayTransformer["default"]({ separator: ',', conjunction: 'and' }), stripIndentTransformer["default"], trimResultTransformer["default"]);
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var stripIndentTransformer = require('../stripIndentTransformer/stripIndentTransformer.cjs');
5
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
6
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
7
-
8
- new TemplateTag["default"](inlineArrayTransformer["default"]({ separator: ',', conjunction: 'or' }), stripIndentTransformer["default"], trimResultTransformer["default"]);
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var stripIndentTransformer = require('../stripIndentTransformer/stripIndentTransformer.cjs');
5
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
6
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
7
- var splitStringTransformer = require('../splitStringTransformer/splitStringTransformer.cjs');
8
- var removeNonPrintingValuesTransformer = require('../removeNonPrintingValuesTransformer/removeNonPrintingValuesTransformer.cjs');
9
-
10
- new TemplateTag["default"](splitStringTransformer["default"]('\n'), removeNonPrintingValuesTransformer["default"], inlineArrayTransformer["default"], stripIndentTransformer["default"], trimResultTransformer["default"]);
@@ -1,48 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var defaults = {
6
- separator: '',
7
- conjunction: '',
8
- serial: false
9
- };
10
-
11
- /**
12
- * Converts an array substitution to a string containing a list
13
- * @param {String} [opts.separator = ''] - the character that separates each item
14
- * @param {String} [opts.conjunction = ''] - replace the last separator with this
15
- * @param {Boolean} [opts.serial = false] - include the separator before the conjunction? (Oxford comma use-case)
16
- *
17
- * @return {Object} - a TemplateTag transformer
18
- */
19
- var inlineArrayTransformer = function inlineArrayTransformer() {
20
- var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaults;
21
- return {
22
- onSubstitution: function onSubstitution(substitution, resultSoFar) {
23
- // only operate on arrays
24
- if (Array.isArray(substitution)) {
25
- var arrayLength = substitution.length;
26
- var separator = opts.separator;
27
- var conjunction = opts.conjunction;
28
- var serial = opts.serial;
29
- // join each item in the array into a string where each item is separated by separator
30
- // be sure to maintain indentation
31
- var indent = resultSoFar.match(/(\n?[^\S\n]+)$/);
32
- if (indent) {
33
- substitution = substitution.join(separator + indent[1]);
34
- } else {
35
- substitution = substitution.join(separator + ' ');
36
- }
37
- // if conjunction is set, replace the last separator with conjunction, but only if there is more than one substitution
38
- if (conjunction && arrayLength > 1) {
39
- var separatorIndex = substitution.lastIndexOf(separator);
40
- substitution = substitution.slice(0, separatorIndex) + (serial ? separator : '') + ' ' + conjunction + substitution.slice(separatorIndex + 1);
41
- }
42
- }
43
- return substitution;
44
- }
45
- };
46
- };
47
-
48
- exports["default"] = inlineArrayTransformer;
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var stripIndentTransformer = require('../stripIndentTransformer/stripIndentTransformer.cjs');
5
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
6
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
7
-
8
- new TemplateTag["default"](inlineArrayTransformer["default"], stripIndentTransformer["default"], trimResultTransformer["default"]);
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
5
- var replaceResultTransformer = require('../replaceResultTransformer/replaceResultTransformer.cjs');
6
-
7
- new TemplateTag["default"](replaceResultTransformer["default"](/(?:\n(?:\s*))+/g, ' '), trimResultTransformer["default"]);
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
5
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
6
- var replaceResultTransformer = require('../replaceResultTransformer/replaceResultTransformer.cjs');
7
-
8
- new TemplateTag["default"](inlineArrayTransformer["default"]({ separator: ',' }), replaceResultTransformer["default"](/(?:\s+)/g, ' '), trimResultTransformer["default"]);
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
5
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
6
- var replaceResultTransformer = require('../replaceResultTransformer/replaceResultTransformer.cjs');
7
-
8
- new TemplateTag["default"](inlineArrayTransformer["default"]({ separator: ',', conjunction: 'and' }), replaceResultTransformer["default"](/(?:\s+)/g, ' '), trimResultTransformer["default"]);
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
5
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
6
- var replaceResultTransformer = require('../replaceResultTransformer/replaceResultTransformer.cjs');
7
-
8
- new TemplateTag["default"](inlineArrayTransformer["default"]({ separator: ',', conjunction: 'or' }), replaceResultTransformer["default"](/(?:\s+)/g, ' '), trimResultTransformer["default"]);
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
5
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
6
- var replaceResultTransformer = require('../replaceResultTransformer/replaceResultTransformer.cjs');
7
-
8
- new TemplateTag["default"](inlineArrayTransformer["default"], replaceResultTransformer["default"](/(?:\s+)/g, ' '), trimResultTransformer["default"]);
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
5
- var replaceResultTransformer = require('../replaceResultTransformer/replaceResultTransformer.cjs');
6
-
7
- new TemplateTag["default"](replaceResultTransformer["default"](/(?:\n\s*)/g, ''), trimResultTransformer["default"]);
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var isValidValue = function isValidValue(x) {
6
- return x != null && !Number.isNaN(x) && typeof x !== 'boolean';
7
- };
8
-
9
- var removeNonPrintingValuesTransformer = function removeNonPrintingValuesTransformer() {
10
- return {
11
- onSubstitution: function onSubstitution(substitution) {
12
- if (Array.isArray(substitution)) {
13
- return substitution.filter(isValidValue);
14
- }
15
- if (isValidValue(substitution)) {
16
- return substitution;
17
- }
18
- return '';
19
- }
20
- };
21
- };
22
-
23
- exports["default"] = removeNonPrintingValuesTransformer;
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- /**
6
- * Replaces tabs, newlines and spaces with the chosen value when they occur in sequences
7
- * @param {(String|RegExp)} replaceWhat - the value or pattern that should be replaced
8
- * @param {*} replaceWith - the replacement value
9
- * @return {Object} - a TemplateTag transformer
10
- */
11
- var replaceResultTransformer = function replaceResultTransformer(replaceWhat, replaceWith) {
12
- return {
13
- onEndResult: function onEndResult(endResult) {
14
- if (replaceWhat == null || replaceWith == null) {
15
- throw new Error('replaceResultTransformer requires at least 2 arguments.');
16
- }
17
- return endResult.replace(replaceWhat, replaceWith);
18
- }
19
- };
20
- };
21
-
22
- exports["default"] = replaceResultTransformer;
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var replaceSubstitutionTransformer = function replaceSubstitutionTransformer(replaceWhat, replaceWith) {
6
- return {
7
- onSubstitution: function onSubstitution(substitution, resultSoFar) {
8
- if (replaceWhat == null || replaceWith == null) {
9
- throw new Error('replaceSubstitutionTransformer requires at least 2 arguments.');
10
- }
11
-
12
- // Do not touch if null or undefined
13
- if (substitution == null) {
14
- return substitution;
15
- } else {
16
- return substitution.toString().replace(replaceWhat, replaceWith);
17
- }
18
- }
19
- };
20
- };
21
-
22
- exports["default"] = replaceSubstitutionTransformer;
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var stripIndentTransformer = require('../stripIndentTransformer/stripIndentTransformer.cjs');
5
- var inlineArrayTransformer = require('../inlineArrayTransformer/inlineArrayTransformer.cjs');
6
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
7
- var splitStringTransformer = require('../splitStringTransformer/splitStringTransformer.cjs');
8
- var replaceSubstitutionTransformer = require('../replaceSubstitutionTransformer/replaceSubstitutionTransformer.cjs');
9
-
10
- new TemplateTag["default"](splitStringTransformer["default"]('\n'), inlineArrayTransformer["default"], stripIndentTransformer["default"], trimResultTransformer["default"], replaceSubstitutionTransformer["default"](/&/g, '&amp;'), replaceSubstitutionTransformer["default"](/</g, '&lt;'), replaceSubstitutionTransformer["default"](/>/g, '&gt;'), replaceSubstitutionTransformer["default"](/"/g, '&quot;'), replaceSubstitutionTransformer["default"](/'/g, '&#x27;'), replaceSubstitutionTransformer["default"](/`/g, '&#x60;'));
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var splitStringTransformer = function splitStringTransformer(splitBy) {
6
- return {
7
- onSubstitution: function onSubstitution(substitution, resultSoFar) {
8
- if (splitBy != null && typeof splitBy === 'string') {
9
- if (typeof substitution === 'string' && substitution.includes(splitBy)) {
10
- substitution = substitution.split(splitBy);
11
- }
12
- } else {
13
- throw new Error('You need to specify a string character to split by.');
14
- }
15
- return substitution;
16
- }
17
- };
18
- };
19
-
20
- exports["default"] = splitStringTransformer;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
6
- var stripIndentTransformer = require('../stripIndentTransformer/stripIndentTransformer.cjs');
7
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
8
-
9
- var stripIndent = new TemplateTag["default"](stripIndentTransformer["default"], trimResultTransformer["default"]);
10
-
11
- exports["default"] = stripIndent;
@@ -1,37 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
6
-
7
- /**
8
- * strips indentation from a template literal
9
- * @param {String} type = 'initial' - whether to remove all indentation or just leading indentation. can be 'all' or 'initial'
10
- * @return {Object} - a TemplateTag transformer
11
- */
12
- var stripIndentTransformer = function stripIndentTransformer() {
13
- var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initial';
14
- return {
15
- onEndResult: function onEndResult(endResult) {
16
- if (type === 'initial') {
17
- // remove the shortest leading indentation from each line
18
- var match = endResult.match(/^[^\S\n]*(?=\S)/gm);
19
- var indent = match && Math.min.apply(Math, _toConsumableArray(match.map(function (el) {
20
- return el.length;
21
- })));
22
- if (indent) {
23
- var regexp = new RegExp('^.{' + indent + '}', 'gm');
24
- return endResult.replace(regexp, '');
25
- }
26
- return endResult;
27
- }
28
- if (type === 'all') {
29
- // remove all indentation from each line
30
- return endResult.replace(/^[^\S\n]+/gm, '');
31
- }
32
- throw new Error('Unknown type: ' + type);
33
- }
34
- };
35
- };
36
-
37
- exports["default"] = stripIndentTransformer;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var TemplateTag = require('../TemplateTag/TemplateTag.cjs');
4
- var stripIndentTransformer = require('../stripIndentTransformer/stripIndentTransformer.cjs');
5
- var trimResultTransformer = require('../trimResultTransformer/trimResultTransformer.cjs');
6
-
7
- new TemplateTag["default"](stripIndentTransformer["default"]('all'), trimResultTransformer["default"]);
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- /**
6
- * TemplateTag transformer that trims whitespace on the end result of a tagged template
7
- * @param {String} side = '' - The side of the string to trim. Can be 'start' or 'end' (alternatively 'left' or 'right')
8
- * @return {Object} - a TemplateTag transformer
9
- */
10
- var trimResultTransformer = function trimResultTransformer() {
11
- var side = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
12
- return {
13
- onEndResult: function onEndResult(endResult) {
14
- if (side === '') {
15
- return endResult.trim();
16
- }
17
-
18
- side = side.toLowerCase();
19
-
20
- if (side === 'start' || side === 'left') {
21
- return endResult.replace(/^\s*/, '');
22
- }
23
-
24
- if (side === 'end' || side === 'right') {
25
- return endResult.replace(/\s*$/, '');
26
- }
27
-
28
- throw new Error('Side not supported: ' + side);
29
- }
30
- };
31
- };
32
-
33
- exports["default"] = trimResultTransformer;
@@ -1,104 +0,0 @@
1
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/TemplateTag/TemplateTag.mjs';
2
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaLists/commaLists.mjs';
3
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaListsAnd/commaListsAnd.mjs';
4
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/commaListsOr/commaListsOr.mjs';
5
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/html/html.mjs';
6
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/safeHtml/safeHtml.mjs';
7
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLine/oneLine.mjs';
8
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineTrim/oneLineTrim.mjs';
9
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaLists/oneLineCommaLists.mjs';
10
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaListsOr/oneLineCommaListsOr.mjs';
11
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineCommaListsAnd/oneLineCommaListsAnd.mjs';
12
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/inlineLists/inlineLists.mjs';
13
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/oneLineInlineLists/oneLineInlineLists.mjs';
14
- import stripIndent from './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndent/stripIndent.mjs';
15
- import './node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/stripIndents/stripIndents.mjs';
16
- import { createProjectPlugin, MAGIC_MODULE_REQUEST_ROUTER } from '@quilted/craft';
17
-
18
- /**
19
- * Configures any code generated for this project to run on Deno.
20
- */
21
- function deno(_ = {}) {
22
- return createProjectPlugin({
23
- name: 'Quilt.Deno',
24
- build({
25
- project,
26
- configure
27
- }) {
28
- configure(addConfiguration({
29
- project,
30
- mode: 'production'
31
- }));
32
- }
33
- // develop({project, configure, hooks}) {
34
- // hooks<DenoDevelopHooks>(() => ({}));
35
-
36
- // configure(
37
- // addConfiguration({
38
- // project,
39
- // mode: 'development',
40
- // }),
41
- // );
42
- // },
43
- });
44
- }
45
-
46
- function addConfiguration({
47
- mode
48
- }) {
49
- return ({
50
- runtimes,
51
- browserslistTargets,
52
- rollupPlugins,
53
- rollupNodeBundle,
54
- quiltRequestRouterPort,
55
- quiltRequestRouterHost,
56
- quiltServiceOutputFormat,
57
- quiltAppServerOutputFormat,
58
- quiltRequestRouterRuntimeContent,
59
- quiltPolyfillFeaturesForEnvironment,
60
- quiltRuntimeEnvironmentVariables
61
- }, options) => {
62
- if (!options.quiltAppServer && !options.quiltService) {
63
- return;
64
- }
65
- runtimes?.(() => [{
66
- target: 'deno'
67
- }]);
68
- browserslistTargets?.(() => ['last 1 chrome version']);
69
- rollupPlugins?.(async plugins => {
70
- const {
71
- rollupReplaceProcessEnv
72
- } = await import('@quilted/craft/rollup');
73
- return [...plugins, await rollupReplaceProcessEnv({
74
- mode,
75
- preserve: false
76
- })];
77
- });
78
- rollupNodeBundle?.(() => true);
79
- quiltRuntimeEnvironmentVariables?.(() => `Deno.env.toObject()`);
80
- quiltServiceOutputFormat?.(() => 'module');
81
- quiltAppServerOutputFormat?.(() => 'module');
82
- const polyfillsWithNativeWorkersSupport = new Set(['crypto', 'fetch', 'abort-controller']);
83
- quiltPolyfillFeaturesForEnvironment?.(features => {
84
- return features.filter(feature => !polyfillsWithNativeWorkersSupport.has(feature));
85
- });
86
-
87
- // @see https://deno.land/api@v1.37.0?s=Deno.ServeOptions
88
- quiltRequestRouterRuntimeContent?.(async () => {
89
- const [port, host] = await Promise.all([quiltRequestRouterPort.run(undefined), quiltRequestRouterHost.run(undefined)]);
90
- return stripIndent`
91
- import {createServeHandler} from '@quilted/deno/request-router';
92
- import RequestRouter from ${JSON.stringify(MAGIC_MODULE_REQUEST_ROUTER)};
93
-
94
- const port = ${port ?? `Number.parseInt(Deno.env.get('PORT') ?? '8080', 10)`};
95
- const hostname = ${host ? JSON.stringify(host) : 'undefined'};
96
- const handleRequest = createServeHandler(RequestRouter);
97
-
98
- Deno.serve({port, hostname}, handleRequest);
99
- `;
100
- });
101
- };
102
- }
103
-
104
- export { deno };