@routier/core 0.1.0-rc.0 → 0.1.0-rc.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/dist/capabilities/index.js +71 -22
- package/dist/capabilities/index.js.map +1 -1
- package/dist/collections/MemoryDataCollection.d.ts +1 -0
- package/dist/collections/index.js +19 -3
- package/dist/collections/index.js.map +1 -1
- package/dist/expressions/index.js +48 -1
- package/dist/expressions/index.js.map +1 -1
- package/dist/index.js +171 -188
- package/dist/index.js.map +1 -1
- package/dist/performance/index.js +78 -3
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/TrampolinePipeline.d.ts +0 -8
- package/dist/pipeline/index.js +60 -140
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/index.js +143 -157
- package/dist/plugins/index.js.map +1 -1
- package/dist/schema/index.js +54 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/types/SchemaNumber.d.ts +1 -0
- package/dist/schema/property/types/SchemaString.d.ts +1 -0
- package/dist/schema/testSchemas.test.d.ts +24 -3
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/index.js +50 -1
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/logger.d.ts +8 -0
- package/package.json +3 -2
package/dist/schema/index.js
CHANGED
|
@@ -2929,6 +2929,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
2929
2929
|
measure: () => (measure),
|
|
2930
2930
|
now: () => (now)
|
|
2931
2931
|
});
|
|
2932
|
+
/* ESM import */var _utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities */ "./src/utilities/logger.ts");
|
|
2933
|
+
|
|
2932
2934
|
const measurements = {};
|
|
2933
2935
|
const now = () => {
|
|
2934
2936
|
if (typeof performance !== 'undefined' && performance.now) {
|
|
@@ -2946,7 +2948,7 @@ const measure = {
|
|
|
2946
2948
|
const start = measurements[name];
|
|
2947
2949
|
delete measurements[name];
|
|
2948
2950
|
const delta = now() - start;
|
|
2949
|
-
|
|
2951
|
+
_utilities__WEBPACK_IMPORTED_MODULE_0__.logger.log(`[ROUTIER] - Performance: ${name} took ${delta}`);
|
|
2950
2952
|
}
|
|
2951
2953
|
};
|
|
2952
2954
|
|
|
@@ -4819,6 +4821,9 @@ class SchemaNumber extends _base_SchemaBase__WEBPACK_IMPORTED_MODULE_0__.SchemaB
|
|
|
4819
4821
|
instance;
|
|
4820
4822
|
type = _types__WEBPACK_IMPORTED_MODULE_1__.SchemaTypes.Number;
|
|
4821
4823
|
_schemaNumber = true;
|
|
4824
|
+
constrain() {
|
|
4825
|
+
return new SchemaNumber(this);
|
|
4826
|
+
}
|
|
4822
4827
|
from(propertyName) {
|
|
4823
4828
|
return new _modifiers_SchemaFrom__WEBPACK_IMPORTED_MODULE_2__.SchemaFrom(propertyName, this);
|
|
4824
4829
|
}
|
|
@@ -4958,6 +4963,9 @@ class SchemaString extends _base_SchemaBase__WEBPACK_IMPORTED_MODULE_0__.SchemaB
|
|
|
4958
4963
|
from(propertyName) {
|
|
4959
4964
|
return new _modifiers_SchemaFrom__WEBPACK_IMPORTED_MODULE_2__.SchemaFrom(propertyName, this);
|
|
4960
4965
|
}
|
|
4966
|
+
constrain() {
|
|
4967
|
+
return new SchemaString(this);
|
|
4968
|
+
}
|
|
4961
4969
|
optional() {
|
|
4962
4970
|
return new _modifiers_SchemaOptional__WEBPACK_IMPORTED_MODULE_3__.SchemaOptional(this);
|
|
4963
4971
|
}
|
|
@@ -5129,6 +5137,51 @@ var HashType;
|
|
|
5129
5137
|
})(HashType || (HashType = {}));
|
|
5130
5138
|
|
|
5131
5139
|
|
|
5140
|
+
}),
|
|
5141
|
+
"./src/utilities/logger.ts":
|
|
5142
|
+
/*!*********************************!*\
|
|
5143
|
+
!*** ./src/utilities/logger.ts ***!
|
|
5144
|
+
\*********************************/
|
|
5145
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5146
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5147
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
5148
|
+
logger: () => (logger)
|
|
5149
|
+
});
|
|
5150
|
+
const isDevelopment = () => {
|
|
5151
|
+
if (typeof process === 'undefined' || process.env == null) {
|
|
5152
|
+
return false;
|
|
5153
|
+
}
|
|
5154
|
+
const env = "development"?.toLowerCase();
|
|
5155
|
+
return env === 'dev' || env === 'development' || env === 'test';
|
|
5156
|
+
};
|
|
5157
|
+
const shouldLog = isDevelopment();
|
|
5158
|
+
const tryLog = (type, ...args) => {
|
|
5159
|
+
if (shouldLog) {
|
|
5160
|
+
console[type](...args);
|
|
5161
|
+
}
|
|
5162
|
+
};
|
|
5163
|
+
const logger = {
|
|
5164
|
+
log: (...args) => {
|
|
5165
|
+
tryLog("log", ...args);
|
|
5166
|
+
},
|
|
5167
|
+
info: (...args) => {
|
|
5168
|
+
tryLog("info", ...args);
|
|
5169
|
+
},
|
|
5170
|
+
warn: (...args) => {
|
|
5171
|
+
tryLog("warn", ...args);
|
|
5172
|
+
},
|
|
5173
|
+
error: (...args) => {
|
|
5174
|
+
tryLog("error", ...args);
|
|
5175
|
+
},
|
|
5176
|
+
debug: (...args) => {
|
|
5177
|
+
tryLog("debug", ...args);
|
|
5178
|
+
},
|
|
5179
|
+
table: (...args) => {
|
|
5180
|
+
tryLog("table", ...args);
|
|
5181
|
+
},
|
|
5182
|
+
};
|
|
5183
|
+
|
|
5184
|
+
|
|
5132
5185
|
}),
|
|
5133
5186
|
"./src/utilities/strings.ts":
|
|
5134
5187
|
/*!**********************************!*\
|