n4s 4.1.8-dev-ae93bf → 4.1.9-dev-9b46fb
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/cjs/compose.development.js +1 -1
- package/dist/cjs/compose.production.js +1 -1
- package/dist/cjs/compounds.development.js +1 -1
- package/dist/cjs/compounds.production.js +1 -1
- package/dist/cjs/n4s.development.js +17 -0
- package/dist/cjs/schema.development.js +1 -1
- package/dist/cjs/schema.production.js +1 -1
- package/dist/es/compose.development.js +1 -1
- package/dist/es/compose.production.js +1 -1
- package/dist/es/compounds.development.js +1 -1
- package/dist/es/compounds.production.js +1 -1
- package/dist/es/n4s.development.js +17 -0
- package/dist/es/schema.development.js +1 -1
- package/dist/es/schema.production.js +1 -1
- package/dist/umd/n4s.development.js +17 -0
- package/package.json +3 -3
- package/types/compose.d.ts +3 -2
- package/types/compounds.d.ts +3 -2
- package/types/n4s.d.ts +3 -2
- package/types/schema.d.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=require("
|
|
1
|
+
"use strict";var n=require("vest-utils"),t=require("n4s");function r(n,t){return n={pass:n},t&&(n.message=t),n}function u(t){return n.defaultTo(t,r(!0))}function e(n,t){try{return n.run(t)}catch(n){return r(!1)}}module.exports=function(){function r(r){return t.ctx.run({value:r},(function(){return u(n.mapFirst(s,(function(n,t){t(!(n=e(n,r)).pass,n)})))}))}for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];return n.assign((function(t){t=r(t),n.invariant(t.pass,n.StringObject(t.message))}),{run:r,test:function(n){return r(n).pass}})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=require("
|
|
1
|
+
"use strict";var n=require("vest-utils"),r=require("n4s");function t(n,r){return n={pass:n},r&&(n.message=r),n}function e(){return t(!1)}function u(r){return n.defaultTo(r,e())}function f(r){return n.defaultTo(r,t(!0))}function o(n,r){try{return n.run(r)}catch(n){return e()}}function i(n,r){return n===r}n.bindNot(i);r.enforce.extend({allOf:function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return f(n.mapFirst(t,(function(n,t){t(!(n=o(n,r)).pass,n)})))},anyOf:function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return u(n.mapFirst(t,(function(n,t){t((n=o(n,r)).pass,n)})))},noneOf:function(r){for(var t=[],u=1;u<arguments.length;u++)t[u-1]=arguments[u];return f(n.mapFirst(t,(function(n,t){t((n=o(n,r)).pass,e())})))},oneOf:function(r){for(var e=[],u=1;u<arguments.length;u++)e[u-1]=arguments[u];var f=0;return e.some((function(t){if(o(t,r).pass&&f++,n.greaterThan(f,1))return!1})),t(i(f,1))}});
|
|
@@ -333,30 +333,47 @@ function validateResult(result) {
|
|
|
333
333
|
|
|
334
334
|
function enforceEager(value) {
|
|
335
335
|
var target = {};
|
|
336
|
+
// This condition is for when we don't have proxy support (ES5).
|
|
337
|
+
// In this case, we need to manually assign the rules to the target object on runtime.
|
|
338
|
+
// The follow up proxy block is used in case we do have proxy support, and we can assign each rule upon invocation.
|
|
336
339
|
if (!isProxySupported()) {
|
|
340
|
+
// We iterate over each of the rules, and add them to the target object being return by enforce
|
|
337
341
|
eachEnforceRule(function (ruleName, ruleFn) {
|
|
342
|
+
// We then wrap the rule with `genRuleCall` that adds the base enforce behavior
|
|
338
343
|
target[ruleName] = genRuleCall(target, ruleFn, ruleName);
|
|
339
344
|
});
|
|
340
345
|
return target;
|
|
341
346
|
}
|
|
347
|
+
// We create a proxy intercepting access to the target object (which is empty).
|
|
342
348
|
var proxy = new Proxy(target, {
|
|
343
349
|
get: function (_, ruleName) {
|
|
350
|
+
// On property access, we identify if it is a rule or not.
|
|
344
351
|
var rule = getRule(ruleName);
|
|
352
|
+
// If it is a rule, we wrap it with `genRuleCall` that adds the base enforce behavior
|
|
345
353
|
if (rule) {
|
|
346
354
|
return genRuleCall(proxy, rule, ruleName);
|
|
347
355
|
}
|
|
348
356
|
}
|
|
349
357
|
});
|
|
350
358
|
return proxy;
|
|
359
|
+
// This function is used to wrap a rule with the base enforce behavior
|
|
360
|
+
// It takes the target object, the rule function, and the rule name
|
|
361
|
+
// It then returns the rule, in a manner that can be used by enforce
|
|
351
362
|
function genRuleCall(target, rule, ruleName) {
|
|
352
363
|
return function ruleCall() {
|
|
353
364
|
var args = [];
|
|
354
365
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
355
366
|
args[_i] = arguments[_i];
|
|
356
367
|
}
|
|
368
|
+
// Order of operation:
|
|
369
|
+
// 1. Create a context with the value being enforced
|
|
370
|
+
// 2. Call the rule within the context, and pass over the arguments passed to it
|
|
371
|
+
// 3. Transform the result to the correct output format
|
|
357
372
|
var transformedResult = ctx.run({ value: value }, function () {
|
|
358
373
|
return transformResult.apply(void 0, __spreadArray([rule.apply(void 0, __spreadArray([value], args, false)), ruleName, value], args, false));
|
|
359
374
|
});
|
|
375
|
+
// On rule failure (the result is false), we either throw an error
|
|
376
|
+
// or throw a string value if the rule has a message defined in it.
|
|
360
377
|
vestUtils.invariant(transformedResult.pass, vestUtils.isNullish(transformedResult.message)
|
|
361
378
|
? "enforce/".concat(ruleName, " failed with ").concat(JSON.stringify(value))
|
|
362
379
|
: vestUtils.StringObject(transformedResult.message));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("vest-utils"),n=require("n4s");function e(r,n){return r={pass:r},n&&(r.message=n),r}function t(){return e(!1)}function u(){return e(!0)}function i(r,n){try{return r.run(n)}catch(r){return t()}}function o(r,e){var t,o=function(t){var u=r[t],o=e[t];if(!(t=n.ctx.run({value:u,set:!0,meta:{key:t}},(function(){return i(o,u)}))).pass)return{value:t}};for(t in e){var a=o(t);if("object"==typeof a)return a.value}return u()}n.enforce.extend({isArrayOf:function(e,t){return function(n){return r.defaultTo(n,u())}(r.mapFirst(e,(function(r,e,u){e(!(u=n.ctx.run({value:r,set:!0,meta:{index:u}},(function(){return i(t,r)}))).pass,u)})))},loose:o,optional:function(n,e){return r.isNullish(n)?u():i(e,n)},shape:function(n,e){var i=o(n,e);if(!i.pass)return i;for(var a in n)if(!r.hasOwnProperty(e,a))return t();return u()}}),exports.partial=function(r){var e,t={};for(e in r)t[e]=n.enforce.optional(r[e]);return t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defaultTo as
|
|
1
|
+
import{ctx as n}from"n4s";import{defaultTo as t,assign as r,mapFirst as u,invariant as s,StringObject as e}from"vest-utils";function o(n,t){return n={pass:n},t&&(n.message=t),n}export default function(){function a(r){return n.run({value:r},(function(){return t(u(f,(function(n,t){try{var u=n.run(r)}catch(n){u=o(!1)}t(!u.pass,u)})),o(!0))}))}for(var f=[],i=0;i<arguments.length;i++)f[i]=arguments[i];return r((function(n){n=a(n),s(n.pass,e(n.message))}),{run:a,test:function(n){return a(n).pass}})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defaultTo as
|
|
1
|
+
import{enforce as n}from"n4s";import{defaultTo as r,mapFirst as t,bindNot as f,greaterThan as o}from"vest-utils";function u(n,r){return n={pass:n},r&&(n.message=r),n}function e(n,r){try{return n.run(r)}catch(n){return u(!1)}}f((function(n,r){return n===r})),n.extend({allOf:function(n){for(var f=[],o=1;o<arguments.length;o++)f[o-1]=arguments[o];return r(t(f,(function(r,t){t(!(r=e(r,n)).pass,r)})),u(!0))},anyOf:function(n){for(var f=[],o=1;o<arguments.length;o++)f[o-1]=arguments[o];return r(t(f,(function(r,t){t((r=e(r,n)).pass,r)})),u(!1))},noneOf:function(n){for(var f=[],o=1;o<arguments.length;o++)f[o-1]=arguments[o];return r(t(f,(function(r,t){t((r=e(r,n)).pass,u(!1))})),u(!0))},oneOf:function(n){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var f=0;return r.some((function(r){if(e(r,n).pass&&f++,o(f,1))return!1})),u(1===f)}});
|
|
@@ -329,30 +329,47 @@ function validateResult(result) {
|
|
|
329
329
|
|
|
330
330
|
function enforceEager(value) {
|
|
331
331
|
var target = {};
|
|
332
|
+
// This condition is for when we don't have proxy support (ES5).
|
|
333
|
+
// In this case, we need to manually assign the rules to the target object on runtime.
|
|
334
|
+
// The follow up proxy block is used in case we do have proxy support, and we can assign each rule upon invocation.
|
|
332
335
|
if (!isProxySupported()) {
|
|
336
|
+
// We iterate over each of the rules, and add them to the target object being return by enforce
|
|
333
337
|
eachEnforceRule(function (ruleName, ruleFn) {
|
|
338
|
+
// We then wrap the rule with `genRuleCall` that adds the base enforce behavior
|
|
334
339
|
target[ruleName] = genRuleCall(target, ruleFn, ruleName);
|
|
335
340
|
});
|
|
336
341
|
return target;
|
|
337
342
|
}
|
|
343
|
+
// We create a proxy intercepting access to the target object (which is empty).
|
|
338
344
|
var proxy = new Proxy(target, {
|
|
339
345
|
get: function (_, ruleName) {
|
|
346
|
+
// On property access, we identify if it is a rule or not.
|
|
340
347
|
var rule = getRule(ruleName);
|
|
348
|
+
// If it is a rule, we wrap it with `genRuleCall` that adds the base enforce behavior
|
|
341
349
|
if (rule) {
|
|
342
350
|
return genRuleCall(proxy, rule, ruleName);
|
|
343
351
|
}
|
|
344
352
|
}
|
|
345
353
|
});
|
|
346
354
|
return proxy;
|
|
355
|
+
// This function is used to wrap a rule with the base enforce behavior
|
|
356
|
+
// It takes the target object, the rule function, and the rule name
|
|
357
|
+
// It then returns the rule, in a manner that can be used by enforce
|
|
347
358
|
function genRuleCall(target, rule, ruleName) {
|
|
348
359
|
return function ruleCall() {
|
|
349
360
|
var args = [];
|
|
350
361
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
351
362
|
args[_i] = arguments[_i];
|
|
352
363
|
}
|
|
364
|
+
// Order of operation:
|
|
365
|
+
// 1. Create a context with the value being enforced
|
|
366
|
+
// 2. Call the rule within the context, and pass over the arguments passed to it
|
|
367
|
+
// 3. Transform the result to the correct output format
|
|
353
368
|
var transformedResult = ctx.run({ value: value }, function () {
|
|
354
369
|
return transformResult.apply(void 0, __spreadArray([rule.apply(void 0, __spreadArray([value], args, false)), ruleName, value], args, false));
|
|
355
370
|
});
|
|
371
|
+
// On rule failure (the result is false), we either throw an error
|
|
372
|
+
// or throw a string value if the rule has a message defined in it.
|
|
356
373
|
invariant(transformedResult.pass, isNullish(transformedResult.message)
|
|
357
374
|
? "enforce/".concat(ruleName, " failed with ").concat(JSON.stringify(value))
|
|
358
375
|
: StringObject(transformedResult.message));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ctx as r,enforce as n}from"n4s";import{defaultTo as t,mapFirst as e,isNullish as u,hasOwnProperty as o}from"vest-utils";function i(r,n){return r={pass:r},n&&(r.message=n),r}function a(r,n){try{return r.run(n)}catch(r){return i(!1)}}function f(n,t){function e(e){var u=n[e],o=t[e];if(!(e=r.run({value:u,set:!0,meta:{key:e}},(function(){return a(o,u)}))).pass)return{value:e}}for(var u in t){var o=e(u);if("object"==typeof o)return o.value}return i(!0)}n.extend({isArrayOf:function(n,u){return t(e(n,(function(n,t,e){t(!(e=r.run({value:n,set:!0,meta:{index:e}},(function(){return a(u,n)}))).pass,e)})),i(!0))},loose:f,optional:function(r,n){return u(r)?i(!0):a(n,r)},shape:function(r,n){var t=f(r,n);if(!t.pass)return t;for(var e in r)if(!o(n,e))return i(!1);return i(!0)}});export function partial(r){var t,e={};for(t in r)e[t]=n.optional(r[t]);return e}
|
|
@@ -529,30 +529,47 @@
|
|
|
529
529
|
|
|
530
530
|
function enforceEager(value) {
|
|
531
531
|
var target = {};
|
|
532
|
+
// This condition is for when we don't have proxy support (ES5).
|
|
533
|
+
// In this case, we need to manually assign the rules to the target object on runtime.
|
|
534
|
+
// The follow up proxy block is used in case we do have proxy support, and we can assign each rule upon invocation.
|
|
532
535
|
if (!isProxySupported()) {
|
|
536
|
+
// We iterate over each of the rules, and add them to the target object being return by enforce
|
|
533
537
|
eachEnforceRule(function (ruleName, ruleFn) {
|
|
538
|
+
// We then wrap the rule with `genRuleCall` that adds the base enforce behavior
|
|
534
539
|
target[ruleName] = genRuleCall(target, ruleFn, ruleName);
|
|
535
540
|
});
|
|
536
541
|
return target;
|
|
537
542
|
}
|
|
543
|
+
// We create a proxy intercepting access to the target object (which is empty).
|
|
538
544
|
var proxy = new Proxy(target, {
|
|
539
545
|
get: function (_, ruleName) {
|
|
546
|
+
// On property access, we identify if it is a rule or not.
|
|
540
547
|
var rule = getRule(ruleName);
|
|
548
|
+
// If it is a rule, we wrap it with `genRuleCall` that adds the base enforce behavior
|
|
541
549
|
if (rule) {
|
|
542
550
|
return genRuleCall(proxy, rule, ruleName);
|
|
543
551
|
}
|
|
544
552
|
}
|
|
545
553
|
});
|
|
546
554
|
return proxy;
|
|
555
|
+
// This function is used to wrap a rule with the base enforce behavior
|
|
556
|
+
// It takes the target object, the rule function, and the rule name
|
|
557
|
+
// It then returns the rule, in a manner that can be used by enforce
|
|
547
558
|
function genRuleCall(target, rule, ruleName) {
|
|
548
559
|
return function ruleCall() {
|
|
549
560
|
var args = [];
|
|
550
561
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
551
562
|
args[_i] = arguments[_i];
|
|
552
563
|
}
|
|
564
|
+
// Order of operation:
|
|
565
|
+
// 1. Create a context with the value being enforced
|
|
566
|
+
// 2. Call the rule within the context, and pass over the arguments passed to it
|
|
567
|
+
// 3. Transform the result to the correct output format
|
|
553
568
|
var transformedResult = ctx.run({ value: value }, function () {
|
|
554
569
|
return transformResult.apply(void 0, __spreadArray([rule.apply(void 0, __spreadArray([value], args, false)), ruleName, value], args, false));
|
|
555
570
|
});
|
|
571
|
+
// On rule failure (the result is false), we either throw an error
|
|
572
|
+
// or throw a string value if the rule has a message defined in it.
|
|
556
573
|
invariant(transformedResult.pass, isNullish(transformedResult.message)
|
|
557
574
|
? "enforce/".concat(ruleName, " failed with ").concat(JSON.stringify(value))
|
|
558
575
|
: StringObject(transformedResult.message));
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.1.
|
|
2
|
+
"version": "4.1.9-dev-9b46fb",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "./dist/cjs/n4s.js",
|
|
5
5
|
"types": "./types/n4s.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"release": "vx release"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"context": "^2.0.
|
|
14
|
-
"vest-utils": "^0.0.
|
|
13
|
+
"context": "^2.0.8-dev-9b46fb",
|
|
14
|
+
"vest-utils": "^0.0.2-dev-9b46fb"
|
|
15
15
|
},
|
|
16
16
|
"module": "./dist/es/n4s.production.js",
|
|
17
17
|
"exports": {
|
package/types/compose.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ type DropFirst<T extends unknown[]> = T extends [
|
|
|
3
3
|
...infer U
|
|
4
4
|
] ? U : never;
|
|
5
5
|
type Stringable = string | ((...args: any[]) => string);
|
|
6
|
+
type CB = (...args: any[]) => any;
|
|
6
7
|
type RuleReturn = boolean | {
|
|
7
8
|
pass: boolean;
|
|
8
9
|
message?: Stringable;
|
|
@@ -97,7 +98,7 @@ declare const baseRules: {
|
|
|
97
98
|
shorterThanOrEquals: typeof shorterThanOrEquals;
|
|
98
99
|
startsWith: typeof startsWith;
|
|
99
100
|
};
|
|
100
|
-
type Rules<E =
|
|
101
|
+
type Rules<E> = n4s.EnforceCustomMatchers<Rules<E> & E> & Record<string, (...args: Args) => Rules<E> & E> & {
|
|
101
102
|
[P in KBaseRules]: (...args: DropFirst<Parameters<BaseRules[P]>> | Args) => Rules<E> & E;
|
|
102
103
|
};
|
|
103
104
|
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-empty-interface */
|
|
@@ -111,7 +112,7 @@ type LazyRules = n4s.IRules<LazyRuleMethods>;
|
|
|
111
112
|
type Lazy = LazyRules & LazyRuleMethods &
|
|
112
113
|
// This is a "catch all" hack to make TS happy while not
|
|
113
114
|
// losing type hints
|
|
114
|
-
Record<string,
|
|
115
|
+
Record<string, CB>;
|
|
115
116
|
type LazyRuleMethods = LazyRuleRunners & {
|
|
116
117
|
message: (message: LazyMessage) => Lazy;
|
|
117
118
|
};
|
package/types/compounds.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ type DropFirst<T extends unknown[]> = T extends [
|
|
|
3
3
|
...infer U
|
|
4
4
|
] ? U : never;
|
|
5
5
|
type Stringable = string | ((...args: any[]) => string);
|
|
6
|
+
type CB = (...args: any[]) => any;
|
|
6
7
|
type RuleReturn = boolean | {
|
|
7
8
|
pass: boolean;
|
|
8
9
|
message?: Stringable;
|
|
@@ -97,7 +98,7 @@ declare const baseRules: {
|
|
|
97
98
|
shorterThanOrEquals: typeof shorterThanOrEquals;
|
|
98
99
|
startsWith: typeof startsWith;
|
|
99
100
|
};
|
|
100
|
-
type Rules<E =
|
|
101
|
+
type Rules<E> = n4s.EnforceCustomMatchers<Rules<E> & E> & Record<string, (...args: Args) => Rules<E> & E> & {
|
|
101
102
|
[P in KBaseRules]: (...args: DropFirst<Parameters<BaseRules[P]>> | Args) => Rules<E> & E;
|
|
102
103
|
};
|
|
103
104
|
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-empty-interface */
|
|
@@ -111,7 +112,7 @@ type LazyRules = n4s.IRules<LazyRuleMethods>;
|
|
|
111
112
|
type Lazy = LazyRules & LazyRuleMethods &
|
|
112
113
|
// This is a "catch all" hack to make TS happy while not
|
|
113
114
|
// losing type hints
|
|
114
|
-
Record<string,
|
|
115
|
+
Record<string, CB>;
|
|
115
116
|
type LazyRuleMethods = LazyRuleRunners & {
|
|
116
117
|
message: (message: LazyMessage) => Lazy;
|
|
117
118
|
};
|
package/types/n4s.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ type DropFirst<T extends unknown[]> = T extends [
|
|
|
20
20
|
...infer U
|
|
21
21
|
] ? U : never;
|
|
22
22
|
type Stringable = string | ((...args: any[]) => string);
|
|
23
|
+
type CB = (...args: any[]) => any;
|
|
23
24
|
type RuleReturn = boolean | {
|
|
24
25
|
pass: boolean;
|
|
25
26
|
message?: Stringable;
|
|
@@ -117,7 +118,7 @@ declare const baseRules: {
|
|
|
117
118
|
shorterThanOrEquals: typeof shorterThanOrEquals;
|
|
118
119
|
startsWith: typeof startsWith;
|
|
119
120
|
};
|
|
120
|
-
type Rules<E =
|
|
121
|
+
type Rules<E> = n4s.EnforceCustomMatchers<Rules<E> & E> & Record<string, (...args: Args) => Rules<E> & E> & {
|
|
121
122
|
[P in KBaseRules]: (...args: DropFirst<Parameters<BaseRules[P]>> | Args) => Rules<E> & E;
|
|
122
123
|
};
|
|
123
124
|
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-empty-interface */
|
|
@@ -134,7 +135,7 @@ type LazyRules = n4s.IRules<LazyRuleMethods>;
|
|
|
134
135
|
type Lazy = LazyRules & LazyRuleMethods &
|
|
135
136
|
// This is a "catch all" hack to make TS happy while not
|
|
136
137
|
// losing type hints
|
|
137
|
-
Record<string,
|
|
138
|
+
Record<string, CB>;
|
|
138
139
|
type LazyRuleMethods = LazyRuleRunners & {
|
|
139
140
|
message: (message: LazyMessage) => Lazy;
|
|
140
141
|
};
|
package/types/schema.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ type DropFirst<T extends unknown[]> = T extends [
|
|
|
3
3
|
...infer U
|
|
4
4
|
] ? U : never;
|
|
5
5
|
type Stringable = string | ((...args: any[]) => string);
|
|
6
|
+
type CB = (...args: any[]) => any;
|
|
6
7
|
type RuleReturn = boolean | {
|
|
7
8
|
pass: boolean;
|
|
8
9
|
message?: Stringable;
|
|
@@ -97,7 +98,7 @@ declare const baseRules: {
|
|
|
97
98
|
shorterThanOrEquals: typeof shorterThanOrEquals;
|
|
98
99
|
startsWith: typeof startsWith;
|
|
99
100
|
};
|
|
100
|
-
type Rules<E =
|
|
101
|
+
type Rules<E> = n4s.EnforceCustomMatchers<Rules<E> & E> & Record<string, (...args: Args) => Rules<E> & E> & {
|
|
101
102
|
[P in KBaseRules]: (...args: DropFirst<Parameters<BaseRules[P]>> | Args) => Rules<E> & E;
|
|
102
103
|
};
|
|
103
104
|
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-empty-interface */
|
|
@@ -111,7 +112,7 @@ type LazyRules = n4s.IRules<LazyRuleMethods>;
|
|
|
111
112
|
type Lazy = LazyRules & LazyRuleMethods &
|
|
112
113
|
// This is a "catch all" hack to make TS happy while not
|
|
113
114
|
// losing type hints
|
|
114
|
-
Record<string,
|
|
115
|
+
Record<string, CB>;
|
|
115
116
|
type LazyRuleMethods = LazyRuleRunners & {
|
|
116
117
|
message: (message: LazyMessage) => Lazy;
|
|
117
118
|
};
|