@betorigami/guard 1.0.0 → 1.0.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/index.cjs +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var{defineProperty:a,getOwnPropertyNames:u,getOwnPropertyDescriptor:
|
|
1
|
+
var{defineProperty:a,getOwnPropertyNames:u,getOwnPropertyDescriptor:l}=Object,f=Object.prototype.hasOwnProperty;var e=new WeakMap,o=(i)=>{var t=e.get(i),n;if(t)return t;if(t=a({},"__esModule",{value:!0}),i&&typeof i==="object"||typeof i==="function")u(i).map((s)=>!f.call(t,s)&&a(t,s,{get:()=>i[s],enumerable:!(n=l(i,s))||n.enumerable}));return e.set(i,t),t};var c=(i,t)=>{for(var n in t)a(i,n,{get:t[n],enumerable:!0,configurable:!0,set:(s)=>t[n]=()=>s})};var g={};c(g,{Guard:()=>r});module.exports=o(g);class r{static againstNullOrUndefined(i,t){if(!i){if(typeof t==="function")throw t();throw new Error(t)}}static againstNull(i,t){r.againstNullOrUndefined(i,t)}static againstUndefined(i,t){r.againstNullOrUndefined(i,t)}static againstEmptyArray(i,t){if(i.length===0){if(typeof t==="function")throw t();throw new Error(t)}}static againstNonInteger(i,t){if(!Number.isInteger(i)){if(typeof t==="function")throw t();throw new Error(t)}}static againstNegativeNumber(i,t){if(i<0){if(typeof t==="function")throw t();throw new Error(t)}}}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
3
|
export declare abstract class Guard {
|
|
4
|
-
static
|
|
5
|
-
static
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
static
|
|
4
|
+
static againstNullOrUndefined<T>(value: T | null | undefined, error: string | (() => Error)): asserts value is T;
|
|
5
|
+
static againstNull<T>(value: T | null, error: string | (() => Error)): asserts value is T;
|
|
6
|
+
static againstUndefined<T>(value: T | undefined, error: string | (() => Error)): asserts value is T;
|
|
7
|
+
static againstEmptyArray<T>(value: T[], error: string | (() => Error)): asserts value is T[];
|
|
8
|
+
static againstNonInteger(value: number, error: string | (() => Error)): asserts value is number;
|
|
9
|
+
static againstNegativeNumber(value: number, error: string | (() => Error)): asserts value is number;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export {};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class
|
|
1
|
+
class n{static againstNullOrUndefined(i,t){if(!i){if(typeof t==="function")throw t();throw new Error(t)}}static againstNull(i,t){n.againstNullOrUndefined(i,t)}static againstUndefined(i,t){n.againstNullOrUndefined(i,t)}static againstEmptyArray(i,t){if(i.length===0){if(typeof t==="function")throw t();throw new Error(t)}}static againstNonInteger(i,t){if(!Number.isInteger(i)){if(typeof t==="function")throw t();throw new Error(t)}}static againstNegativeNumber(i,t){if(i<0){if(typeof t==="function")throw t();throw new Error(t)}}}export{n as Guard};
|