@thi.ng/api
Advanced tools
Comparing version 6.5.0 to 6.6.0
@@ -10,3 +10,4 @@ import { TypedArray } from "./api/typedarray"; | ||
export declare type Nullable<T> = T | null | undefined; | ||
export declare type Primitive = number | string | boolean | symbol; | ||
export declare type NumOrString = number | string; | ||
export declare type Primitive = NumOrString | boolean | symbol; | ||
/** | ||
@@ -13,0 +14,0 @@ * Lookup path for nested data structures. |
@@ -7,2 +7,5 @@ export declare type Keys<T> = keyof T; | ||
export declare type Keys5<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>> = Keys4<T[A], B, C, D, E>; | ||
export declare type Keys6<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>> = Keys5<T[A], B, C, D, E, F>; | ||
export declare type Keys7<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, G extends Keys6<T, A, B, C, D, E, F>> = Keys6<T[A], B, C, D, E, F, G>; | ||
export declare type Keys8<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, G extends Keys6<T, A, B, C, D, E, F>, H extends Keys7<T, A, B, C, D, E, F, G>> = Keys7<T[A], B, C, D, E, F, G, H>; | ||
export declare type Val1<T, A extends Keys<T>> = T[A]; | ||
@@ -13,1 +16,56 @@ export declare type Val2<T, A extends Keys<T>, B extends Keys1<T, A>> = Val1<T, A>[B]; | ||
export declare type Val5<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>> = Val4<T, A, B, C, D>[E]; | ||
export declare type Val6<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>> = Val5<T, A, B, C, D, E>[F]; | ||
export declare type Val7<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, G extends Keys6<T, A, B, C, D, E, F>> = Val6<T, A, B, C, D, E, F>[G]; | ||
export declare type Val8<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, G extends Keys6<T, A, B, C, D, E, F>, H extends Keys7<T, A, B, C, D, E, F, G>> = Val7<T, A, B, C, D, E, F, G>[H]; | ||
/** | ||
* Utilities for constructing types with nested keys removed. | ||
*/ | ||
export declare type Without<T, A extends Keys<T>> = Omit<T, A>; | ||
export declare type Without2<T, A extends Keys<T>, B extends Keys1<T, A>> = Without<T, A> & { | ||
[id in A]: Without<Val1<T, A>, B>; | ||
}; | ||
export declare type Without3<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>> = Without<T, A> & { | ||
[id in A]: Without2<Val1<T, A>, B, C>; | ||
}; | ||
export declare type Without4<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>> = Without<T, A> & { | ||
[id in A]: Without3<Val1<T, A>, B, C, D>; | ||
}; | ||
export declare type Without5<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>> = Without<T, A> & { | ||
[id in A]: Without4<Val1<T, A>, B, C, D, E>; | ||
}; | ||
export declare type Without6<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>> = Without<T, A> & { | ||
[id in A]: Without5<Val1<T, A>, B, C, D, E, F>; | ||
}; | ||
export declare type Without7<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, G extends Keys6<T, A, B, C, D, E, F>> = Without<T, A> & { | ||
[id in A]: Without6<Val1<T, A>, B, C, D, E, F, G>; | ||
}; | ||
export declare type Without8<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, G extends Keys6<T, A, B, C, D, E, F>, H extends Keys7<T, A, B, C, D, E, F, G>> = Without<T, A> & { | ||
[id in A]: Without7<Val1<T, A>, B, C, D, E, F, G, H>; | ||
}; | ||
/** | ||
* Utilities for replacing types of nested keys. | ||
*/ | ||
export declare type Replace<T, A extends Keys<T>, V> = Without<T, A> & { | ||
[id in A]: V; | ||
}; | ||
export declare type Replace2<T, A extends Keys<T>, B extends Keys1<T, A>, V> = Without<T, A> & { | ||
[id in A]: Replace<Val1<T, A>, B, V>; | ||
}; | ||
export declare type Replace3<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, V> = Without<T, A> & { | ||
[id in A]: Replace2<Val1<T, A>, B, C, V>; | ||
}; | ||
export declare type Replace4<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, V> = Without<T, A> & { | ||
[id in A]: Replace3<Val1<T, A>, B, C, D, V>; | ||
}; | ||
export declare type Replace5<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, V> = Without<T, A> & { | ||
[id in A]: Replace4<Val1<T, A>, B, C, D, E, V>; | ||
}; | ||
export declare type Replace6<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, V> = Without<T, A> & { | ||
[id in A]: Replace5<Val1<T, A>, B, C, D, E, F, V>; | ||
}; | ||
export declare type Replace7<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, G extends Keys6<T, A, B, C, D, E, F>, V> = Without<T, A> & { | ||
[id in A]: Replace6<Val1<T, A>, B, C, D, E, F, G, V>; | ||
}; | ||
export declare type Replace8<T, A extends Keys<T>, B extends Keys1<T, A>, C extends Keys2<T, A, B>, D extends Keys3<T, A, B, C>, E extends Keys4<T, A, B, C, D>, F extends Keys5<T, A, B, C, D, E>, G extends Keys6<T, A, B, C, D, E, F>, H extends Keys7<T, A, B, C, D, E, F, G>, V> = Without<T, A> & { | ||
[id in A]: Replace7<Val1<T, A>, B, C, D, E, F, G, H, V>; | ||
}; |
@@ -24,2 +24,5 @@ export declare type TypedArray = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array; | ||
} | ||
export declare type UintType = Type.U8 | Type.U16 | Type.U32; | ||
export declare type IntType = Type.I8 | Type.I16 | Type.I32; | ||
export declare type FloatType = Type.F32 | Type.F64; | ||
/** | ||
@@ -97,1 +100,15 @@ * WebGL numeric type constants. Use `GL2TYPE` to convert, if needed. | ||
export declare function typedArray<T extends Type | GLType>(type: T, buf: ArrayBufferLike, byteOffset: number, length?: number): TypedArrayTypeMap[T]; | ||
/** | ||
* Returns the smallest possible *unsigned* int type enum for given `x`. | ||
* E.g. if `x <= 256`, the function returns `Type.U8`. | ||
* | ||
* @param x | ||
*/ | ||
export declare const uintType: (x: number) => UintType; | ||
/** | ||
* Returns the smallest possible *signed* int type enum for given `x`. | ||
* E.g. if `x >= -128 && x < 128`, the function returns `Type.I8`. | ||
* | ||
* @param x | ||
*/ | ||
export declare const intType: (x: number) => IntType; |
@@ -105,1 +105,19 @@ /** | ||
} | ||
/** | ||
* Returns the smallest possible *unsigned* int type enum for given `x`. | ||
* E.g. if `x <= 256`, the function returns `Type.U8`. | ||
* | ||
* @param x | ||
*/ | ||
export const uintType = (x) => x <= 0x100 ? 0 /* U8 */ : x <= 0x10000 ? 3 /* U16 */ : 5 /* U32 */; | ||
/** | ||
* Returns the smallest possible *signed* int type enum for given `x`. | ||
* E.g. if `x >= -128 && x < 128`, the function returns `Type.I8`. | ||
* | ||
* @param x | ||
*/ | ||
export const intType = (x) => x >= -0x80 && x < 0x80 | ||
? 2 /* I8 */ | ||
: x >= -0x8000 && x < 0x8000 | ||
? 4 /* I16 */ | ||
: 6 /* I32 */; |
@@ -6,2 +6,15 @@ # Change Log | ||
# [6.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.5.0...@thi.ng/api@6.6.0) (2019-11-30) | ||
### Features | ||
* **api:** add ISeq, ISeqable ([541e9c8](https://github.com/thi-ng/umbrella/commit/541e9c8bdf95ece80b74e630eeb428876b7d7bc9)) | ||
* **api:** add Uint/Int/FloatType & helpers ([1d3c824](https://github.com/thi-ng/umbrella/commit/1d3c824f3647cbc7ced7f3289b184474f3281674)) | ||
* **api:** add WithoutX & ReplaceX types, update KeysX/ValX ([7707370](https://github.com/thi-ng/umbrella/commit/7707370741dc0835218f4a9302e6076e70bf8fba)) | ||
# [6.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.4.0...@thi.ng/api@6.5.0) (2019-11-09) | ||
@@ -8,0 +21,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { illegalArgs } from "@thi.ng/errors"; | ||
import { assert } from "../assert"; | ||
/** | ||
@@ -13,5 +13,3 @@ * Method property decorator factory. Augments original method with | ||
const fn = descriptor.value; | ||
if (typeof fn !== "function") { | ||
illegalArgs(`${signature} is not a function`); | ||
} | ||
assert(typeof fn === "function", `${signature} is not a function`); | ||
descriptor.value = function () { | ||
@@ -18,0 +16,0 @@ log(`DEPRECATED ${signature}: ${msg || "will be removed soon"}`); |
@@ -30,2 +30,3 @@ export * from "./api"; | ||
export * from "./api/select"; | ||
export * from "./api/seq"; | ||
export * from "./api/set"; | ||
@@ -32,0 +33,0 @@ export * from "./api/stack"; |
@@ -5,4 +5,2 @@ 'use strict'; | ||
var errors = require('@thi.ng/errors'); | ||
const DEFAULT_EPS = 1e-6; | ||
@@ -99,2 +97,8 @@ const SEMAPHORE = Symbol(); | ||
} | ||
const uintType = (x) => x <= 0x100 ? 0 : x <= 0x10000 ? 3 : 5 ; | ||
const intType = (x) => x >= -0x80 && x < 0x80 | ||
? 2 | ||
: x >= -0x8000 && x < 0x8000 | ||
? 4 | ||
: 6 ; | ||
@@ -183,5 +187,3 @@ const assert = typeof process === "undefined" || | ||
const fn = descriptor.value; | ||
if (typeof fn !== "function") { | ||
errors.illegalArgs(`${signature} is not a function`); | ||
} | ||
assert(typeof fn === "function", `${signature} is not a function`); | ||
descriptor.value = function () { | ||
@@ -335,2 +337,3 @@ log(`DEPRECATED ${signature}: ${msg || "will be removed soon"}`); | ||
exports.inotify_dispatch = inotify_dispatch; | ||
exports.intType = intType; | ||
exports.iterable = iterable; | ||
@@ -341,1 +344,2 @@ exports.mixin = mixin; | ||
exports.typedArray = typedArray; | ||
exports.uintType = uintType; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@thi.ng/errors")):"function"==typeof define&&define.amd?define(["exports","@thi.ng/errors"],t):t(((e=e||self).thi=e.thi||{},e.thi.ng=e.thi.ng||{},e.thi.ng.api={}),e.thi.ng.errors)}(this,(function(e,t){"use strict";const i=Symbol(),r=()=>{};var n,o,s;(n=e.LogLevel||(e.LogLevel={}))[n.FINE=0]="FINE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.SEVERE=4]="SEVERE",n[n.NONE=5]="NONE",(o=e.Type||(e.Type={}))[o.U8=0]="U8",o[o.U8C=1]="U8C",o[o.I8=2]="I8",o[o.U16=3]="U16",o[o.I16=4]="I16",o[o.U32=5]="U32",o[o.I32=6]="I32",o[o.F32=7]="F32",o[o.F64=8]="F64",(s=e.GLType||(e.GLType={}))[s.I8=5120]="I8",s[s.U8=5121]="U8",s[s.I16=5122]="I16",s[s.U16=5123]="U16",s[s.I32=5124]="I32",s[s.U32=5125]="U32",s[s.F32=5126]="F32";const l={5120:2,5121:0,5122:4,5123:3,5124:6,5125:5,5126:7},a={2:5120,0:5121,1:5121,4:5122,3:5123,6:5124,6:5124,5:5125,7:5126,8:void 0},h={0:1,1:1,2:1,3:2,4:2,5:4,6:4,7:4,8:8},c={0:Uint8Array,1:Uint8ClampedArray,2:Int8Array,3:Uint16Array,4:Int16Array,5:Uint32Array,6:Int32Array,7:Float32Array,8:Float64Array,5121:Uint8Array,5120:Int8Array,5123:Uint16Array,5122:Int16Array,5125:Uint32Array,5124:Int32Array,5126:Float32Array};const f="undefined"==typeof process||"production"!==process.env.NODE_ENV||"1"===process.env.UMBRELLA_ASSERTS?(e,t="assertion failed")=>{if("function"==typeof e&&!e()||!e)throw new Error("function"==typeof t?t():t)}:r,y=Object.freeze({level:e.LogLevel.NONE,fine(){},debug(){},info(){},warn(){},severe(){}});const u=(e,t={})=>{const i=Reflect.ownKeys(e),r=Reflect.ownKeys(t),n=Symbol("isa");function o(t){for(let r of i){const i=Object.getOwnPropertyDescriptor(t.prototype,r);!i||i.configurable?Object.defineProperty(t.prototype,r,{value:e[r],writable:!0}):console.log(`not patching: ${t.name}.${r.toString()}`)}return Object.defineProperty(t.prototype,n,{value:!0}),t}for(let e of r)Object.defineProperty(o,e,{value:t[e],enumerable:t.propertyIsEnumerable(e)});return Object.defineProperty(o,Symbol.hasInstance,{value:e=>!!e[n]}),o},E=u({_enabled:!0,isEnabled(){return this._enabled},enable(){this._enabled=!0,this.notify&&this.notify({id:"enable",target:this})},disable(){this._enabled=!1,this.notify&&this.notify({id:"disable",target:this})},toggle(){return this._enabled?this.disable():this.enable(),this._enabled}}),d=(e,t)=>{if(e)for(let i,r=0,n=e.length;r<n;r++)if((i=e[r])[0].call(i[1],t),t.canceled)return},g=u({addListener(e,t,i){let r=(this._listeners=this._listeners||{})[e];return!r&&(r=this._listeners[e]=[]),-1===this.__listener(r,t,i)&&(r.push([t,i]),!0)},removeListener(e,t,i){let r;if(!(r=this._listeners))return!1;const n=r[e];if(n){const o=this.__listener(n,t,i);if(-1!==o)return n.splice(o,1),!n.length&&delete r[e],!0}return!1},notify(e){let t;if(!(t=this._listeners))return!1;void 0===e.target&&(e.target=this),d(t[e.id],e),d(t["*"],e)},__listener(e,t,i){let r=e.length;for(;--r>=0;){const n=e[r];if(n[0]===t&&n[1]===i)break}return r}}),p=u({addWatch(e,t){return this._watches=this._watches||{},!this._watches[e]&&(this._watches[e]=t,!0)},removeWatch(e){if(this._watches)return!!this._watches[e]&&(delete this._watches[e],!0)},notifyWatches(e,t){if(!this._watches)return;const i=this._watches;for(let r in i)i[r](r,e,t)}});e.ConsoleLogger=class{constructor(t,i=e.LogLevel.FINE){this.id=t,this.level=i}fine(...t){this.level<=e.LogLevel.FINE&&this.log("FINE",t)}debug(...t){this.level<=e.LogLevel.DEBUG&&this.log("DEBUG",t)}info(...t){this.level<=e.LogLevel.INFO&&this.log("INFO",t)}warn(...t){this.level<=e.LogLevel.WARN&&this.log("WARN",t)}severe(...t){this.level<=e.LogLevel.SEVERE&&this.log("SEVERE",t)}log(e,t){console.log(`[${e}] ${this.id}:`,...t)}},e.DEFAULT_EPS=1e-6,e.EVENT_ALL="*",e.EVENT_DISABLE="disable",e.EVENT_ENABLE="enable",e.GL2TYPE=l,e.IEnableMixin=E,e.INotifyMixin=g,e.IWatchMixin=p,e.NO_OP=r,e.NULL_LOGGER=y,e.SEMAPHORE=i,e.SIZEOF=h,e.TYPE2GL=a,e.TYPEDARRAY_CTORS=c,e.assert=f,e.configurable=e=>(function(t,i,r){r.configurable=e}),e.deprecated=(e,i=console.log)=>(function(r,n,o){const s=`${r.constructor.name}#${n.toString()}`,l=o.value;return"function"!=typeof l&&t.illegalArgs(`${s} is not a function`),o.value=function(){return i(`DEPRECATED ${s}: ${e||"will be removed soon"}`),l.apply(this,arguments)},o}),e.inotify_dispatch=d,e.iterable=e=>u({*[Symbol.iterator](){yield*this[e]}}),e.mixin=u,e.nomixin=(e,t,i)=>{i.configurable=!1},e.sealed=e=>{Object.seal(e),Object.seal(e.prototype)},e.typedArray=function(e,...t){return new c[e](...t)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e=e||self).thi=e.thi||{},e.thi.ng=e.thi.ng||{},e.thi.ng.api={}))}(this,(function(e){"use strict";const t=Symbol(),i=()=>{};var n,r,o;(n=e.LogLevel||(e.LogLevel={}))[n.FINE=0]="FINE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.SEVERE=4]="SEVERE",n[n.NONE=5]="NONE",(r=e.Type||(e.Type={}))[r.U8=0]="U8",r[r.U8C=1]="U8C",r[r.I8=2]="I8",r[r.U16=3]="U16",r[r.I16=4]="I16",r[r.U32=5]="U32",r[r.I32=6]="I32",r[r.F32=7]="F32",r[r.F64=8]="F64",(o=e.GLType||(e.GLType={}))[o.I8=5120]="I8",o[o.U8=5121]="U8",o[o.I16=5122]="I16",o[o.U16=5123]="U16",o[o.I32=5124]="I32",o[o.U32=5125]="U32",o[o.F32=5126]="F32";const s={5120:2,5121:0,5122:4,5123:3,5124:6,5125:5,5126:7},l={2:5120,0:5121,1:5121,4:5122,3:5123,6:5124,6:5124,5:5125,7:5126,8:void 0},a={0:1,1:1,2:1,3:2,4:2,5:4,6:4,7:4,8:8},c={0:Uint8Array,1:Uint8ClampedArray,2:Int8Array,3:Uint16Array,4:Int16Array,5:Uint32Array,6:Int32Array,7:Float32Array,8:Float64Array,5121:Uint8Array,5120:Int8Array,5123:Uint16Array,5122:Int16Array,5125:Uint32Array,5124:Int32Array,5126:Float32Array};const h="undefined"==typeof process||"production"!==process.env.NODE_ENV||"1"===process.env.UMBRELLA_ASSERTS?(e,t="assertion failed")=>{if("function"==typeof e&&!e()||!e)throw new Error("function"==typeof t?t():t)}:i,f=Object.freeze({level:e.LogLevel.NONE,fine(){},debug(){},info(){},warn(){},severe(){}});const y=(e,t={})=>{const i=Reflect.ownKeys(e),n=Reflect.ownKeys(t),r=Symbol("isa");function o(t){for(let n of i){const i=Object.getOwnPropertyDescriptor(t.prototype,n);!i||i.configurable?Object.defineProperty(t.prototype,n,{value:e[n],writable:!0}):console.log(`not patching: ${t.name}.${n.toString()}`)}return Object.defineProperty(t.prototype,r,{value:!0}),t}for(let e of n)Object.defineProperty(o,e,{value:t[e],enumerable:t.propertyIsEnumerable(e)});return Object.defineProperty(o,Symbol.hasInstance,{value:e=>!!e[r]}),o},u=y({_enabled:!0,isEnabled(){return this._enabled},enable(){this._enabled=!0,this.notify&&this.notify({id:"enable",target:this})},disable(){this._enabled=!1,this.notify&&this.notify({id:"disable",target:this})},toggle(){return this._enabled?this.disable():this.enable(),this._enabled}}),E=(e,t)=>{if(e)for(let i,n=0,r=e.length;n<r;n++)if((i=e[n])[0].call(i[1],t),t.canceled)return},d=y({addListener(e,t,i){let n=(this._listeners=this._listeners||{})[e];return!n&&(n=this._listeners[e]=[]),-1===this.__listener(n,t,i)&&(n.push([t,i]),!0)},removeListener(e,t,i){let n;if(!(n=this._listeners))return!1;const r=n[e];if(r){const o=this.__listener(r,t,i);if(-1!==o)return r.splice(o,1),!r.length&&delete n[e],!0}return!1},notify(e){let t;if(!(t=this._listeners))return!1;void 0===e.target&&(e.target=this),E(t[e.id],e),E(t["*"],e)},__listener(e,t,i){let n=e.length;for(;--n>=0;){const r=e[n];if(r[0]===t&&r[1]===i)break}return n}}),p=y({addWatch(e,t){return this._watches=this._watches||{},!this._watches[e]&&(this._watches[e]=t,!0)},removeWatch(e){if(this._watches)return!!this._watches[e]&&(delete this._watches[e],!0)},notifyWatches(e,t){if(!this._watches)return;const i=this._watches;for(let n in i)i[n](n,e,t)}});e.ConsoleLogger=class{constructor(t,i=e.LogLevel.FINE){this.id=t,this.level=i}fine(...t){this.level<=e.LogLevel.FINE&&this.log("FINE",t)}debug(...t){this.level<=e.LogLevel.DEBUG&&this.log("DEBUG",t)}info(...t){this.level<=e.LogLevel.INFO&&this.log("INFO",t)}warn(...t){this.level<=e.LogLevel.WARN&&this.log("WARN",t)}severe(...t){this.level<=e.LogLevel.SEVERE&&this.log("SEVERE",t)}log(e,t){console.log(`[${e}] ${this.id}:`,...t)}},e.DEFAULT_EPS=1e-6,e.EVENT_ALL="*",e.EVENT_DISABLE="disable",e.EVENT_ENABLE="enable",e.GL2TYPE=s,e.IEnableMixin=u,e.INotifyMixin=d,e.IWatchMixin=p,e.NO_OP=i,e.NULL_LOGGER=f,e.SEMAPHORE=t,e.SIZEOF=a,e.TYPE2GL=l,e.TYPEDARRAY_CTORS=c,e.assert=h,e.configurable=e=>(function(t,i,n){n.configurable=e}),e.deprecated=(e,t=console.log)=>(function(i,n,r){const o=`${i.constructor.name}#${n.toString()}`,s=r.value;return h("function"==typeof s,`${o} is not a function`),r.value=function(){return t(`DEPRECATED ${o}: ${e||"will be removed soon"}`),s.apply(this,arguments)},r}),e.inotify_dispatch=E,e.intType=e=>e>=-128&&e<128?2:e>=-32768&&e<32768?4:6,e.iterable=e=>y({*[Symbol.iterator](){yield*this[e]}}),e.mixin=y,e.nomixin=(e,t,i)=>{i.configurable=!1},e.sealed=e=>{Object.seal(e),Object.seal(e.prototype)},e.typedArray=function(e,...t){return new c[e](...t)},e.uintType=e=>e<=256?0:e<=65536?3:5,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@thi.ng/api", | ||
"version": "6.5.0", | ||
"description": "Common, generic types & interfaces for thi.ng projects", | ||
"version": "6.6.0", | ||
"description": "Common, generic types, interfaces & mixins", | ||
"module": "./index.js", | ||
@@ -21,19 +21,19 @@ "main": "./lib/index.js", | ||
"build:test": "rimraf build && tsc -p test/tsconfig.json", | ||
"test": "yarn build:test && mocha build/test/*.js", | ||
"cover": "yarn build:test && nyc mocha build/test/*.js && nyc report --reporter=lcov", | ||
"test": "mocha test", | ||
"cover": "nyc mocha test && nyc report --reporter=lcov", | ||
"clean": "rimraf *.js *.d.ts .nyc_output build coverage doc lib api decorators mixins", | ||
"doc": "node_modules/.bin/typedoc --mode modules --out doc --ignoreCompilerErrors src", | ||
"doc:readme": "../../scripts/generate-readme", | ||
"doc": "node_modules/.bin/typedoc --mode modules --out doc src", | ||
"pub": "yarn build:release && yarn publish --access public" | ||
}, | ||
"devDependencies": { | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^12.6.3", | ||
"mocha": "^6.1.4", | ||
"@types/node": "^12.12.11", | ||
"mocha": "^6.2.2", | ||
"nyc": "^14.0.0", | ||
"typedoc": "^0.15.0", | ||
"typescript": "^3.6.4" | ||
"ts-node": "^8.5.2", | ||
"typedoc": "^0.15.2", | ||
"typescript": "^3.7.2" | ||
}, | ||
"dependencies": { | ||
"@thi.ng/errors": "^1.2.1" | ||
}, | ||
"keywords": [ | ||
@@ -52,5 +52,2 @@ "compare", | ||
}, | ||
"browserslist": [ | ||
"since 2018-07" | ||
], | ||
"browser": { | ||
@@ -61,3 +58,3 @@ "process": false, | ||
"sideEffects": false, | ||
"gitHead": "97add769f24aa32a1a5e13c5c941605e1b9eb569" | ||
"gitHead": "36c4d9e967bd80ccdbfa0f4a42f594080f95f105" | ||
} |
@@ -0,1 +1,3 @@ | ||
<!-- This file is generated - DO NOT EDIT! --> | ||
# @thi.ng/api | ||
@@ -7,15 +9,31 @@ | ||
This project is part of the | ||
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo. | ||
- [About](#about) | ||
- [Status](#status) | ||
- [Installation](#installation) | ||
- [Dependencies](#dependencies) | ||
- [API](#api) | ||
- [Authors](#authors) | ||
- [License](#license) | ||
## About | ||
Common, generic types, interfaces & mixins. | ||
This package is implicitly used by most other projects in this | ||
repository. It defines: | ||
- 30+ generic, common interfaces & types | ||
- class & method decorators | ||
- mixins | ||
- Dozens of generic, common interfaces & types | ||
- Class & method decorators | ||
- Mixins | ||
- Logging | ||
- Assert (can be disabled for production builds) | ||
- Typedarray utilities | ||
### Status | ||
**STABLE** - used in production | ||
## Installation | ||
@@ -29,10 +47,16 @@ | ||
- [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/master/packages/errors) | ||
None | ||
## API | ||
[Generated API docs](https://docs.thi.ng/umbrella/api/) | ||
TODO | ||
## Authors | ||
- Karsten Schmidt | ||
Karsten Schmidt | ||
## License | ||
© 2016-2018 Karsten Schmidt // Apache Software License 2.0 | ||
© 2016 - 2019 Karsten Schmidt // Apache Software License 2.0 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
129746
0
109
2257
0
61
2
0
8
- Removed@thi.ng/errors@^1.2.1
- Removed@thi.ng/errors@1.3.4(transitive)