@thi.ng/api
Advanced tools
Comparing version 6.9.0 to 6.9.1
@@ -15,3 +15,3 @@ export declare type ArrayLikeIterable<T> = ArrayLike<T> & Iterable<T>; | ||
*/ | ||
export declare const enum Type { | ||
export declare enum Type { | ||
U8 = 0, | ||
@@ -37,3 +37,3 @@ U8C = 1, | ||
*/ | ||
export declare const enum GLType { | ||
export declare enum GLType { | ||
I8 = 5120, | ||
@@ -40,0 +40,0 @@ U8 = 5121, |
@@ -41,9 +41,9 @@ /** | ||
export const GL2TYPE = { | ||
[5120 /* I8 */]: 2 /* I8 */, | ||
[5121 /* U8 */]: 0 /* U8 */, | ||
[5122 /* I16 */]: 4 /* I16 */, | ||
[5123 /* U16 */]: 3 /* U16 */, | ||
[5124 /* I32 */]: 6 /* I32 */, | ||
[5125 /* U32 */]: 5 /* U32 */, | ||
[5126 /* F32 */]: 7 /* F32 */ | ||
[GLType.I8]: Type.I8, | ||
[GLType.U8]: Type.U8, | ||
[GLType.I16]: Type.I16, | ||
[GLType.U16]: Type.U16, | ||
[GLType.I32]: Type.I32, | ||
[GLType.U32]: Type.U32, | ||
[GLType.F32]: Type.F32, | ||
}; | ||
@@ -59,12 +59,12 @@ /** | ||
export const TYPE2GL = { | ||
[2 /* I8 */]: 5120 /* I8 */, | ||
[0 /* U8 */]: 5121 /* U8 */, | ||
[1 /* U8C */]: 5121 /* U8 */, | ||
[4 /* I16 */]: 5122 /* I16 */, | ||
[3 /* U16 */]: 5123 /* U16 */, | ||
[6 /* I32 */]: 5124 /* I32 */, | ||
[6 /* I32 */]: 5124 /* I32 */, | ||
[5 /* U32 */]: 5125 /* U32 */, | ||
[7 /* F32 */]: 5126 /* F32 */, | ||
[8 /* F64 */]: undefined | ||
[Type.I8]: GLType.I8, | ||
[Type.U8]: GLType.U8, | ||
[Type.U8C]: GLType.U8, | ||
[Type.I16]: GLType.I16, | ||
[Type.U16]: GLType.U16, | ||
[Type.I32]: GLType.I32, | ||
[Type.I32]: GLType.I32, | ||
[Type.U32]: GLType.U32, | ||
[Type.F32]: GLType.F32, | ||
[Type.F64]: undefined, | ||
}; | ||
@@ -76,29 +76,29 @@ /** | ||
export const SIZEOF = { | ||
[0 /* U8 */]: 1, | ||
[1 /* U8C */]: 1, | ||
[2 /* I8 */]: 1, | ||
[3 /* U16 */]: 2, | ||
[4 /* I16 */]: 2, | ||
[5 /* U32 */]: 4, | ||
[6 /* I32 */]: 4, | ||
[7 /* F32 */]: 4, | ||
[8 /* F64 */]: 8 | ||
[Type.U8]: 1, | ||
[Type.U8C]: 1, | ||
[Type.I8]: 1, | ||
[Type.U16]: 2, | ||
[Type.I16]: 2, | ||
[Type.U32]: 4, | ||
[Type.I32]: 4, | ||
[Type.F32]: 4, | ||
[Type.F64]: 8, | ||
}; | ||
export const TYPEDARRAY_CTORS = { | ||
[0 /* U8 */]: Uint8Array, | ||
[1 /* U8C */]: Uint8ClampedArray, | ||
[2 /* I8 */]: Int8Array, | ||
[3 /* U16 */]: Uint16Array, | ||
[4 /* I16 */]: Int16Array, | ||
[5 /* U32 */]: Uint32Array, | ||
[6 /* I32 */]: Int32Array, | ||
[7 /* F32 */]: Float32Array, | ||
[8 /* F64 */]: Float64Array, | ||
[5121 /* U8 */]: Uint8Array, | ||
[5120 /* I8 */]: Int8Array, | ||
[5123 /* U16 */]: Uint16Array, | ||
[5122 /* I16 */]: Int16Array, | ||
[5125 /* U32 */]: Uint32Array, | ||
[5124 /* I32 */]: Int32Array, | ||
[5126 /* F32 */]: Float32Array | ||
[Type.U8]: Uint8Array, | ||
[Type.U8C]: Uint8ClampedArray, | ||
[Type.I8]: Int8Array, | ||
[Type.U16]: Uint16Array, | ||
[Type.I16]: Int16Array, | ||
[Type.U32]: Uint32Array, | ||
[Type.I32]: Int32Array, | ||
[Type.F32]: Float32Array, | ||
[Type.F64]: Float64Array, | ||
[GLType.U8]: Uint8Array, | ||
[GLType.I8]: Int8Array, | ||
[GLType.U16]: Uint16Array, | ||
[GLType.I16]: Int16Array, | ||
[GLType.U32]: Uint32Array, | ||
[GLType.I32]: Int32Array, | ||
[GLType.F32]: Float32Array, | ||
}; | ||
@@ -114,3 +114,3 @@ export function typedArray(type, ...xs) { | ||
*/ | ||
export const uintType = (x) => x <= 0x100 ? 0 /* U8 */ : x <= 0x10000 ? 3 /* U16 */ : 5 /* U32 */; | ||
export const uintType = (x) => x <= 0x100 ? Type.U8 : x <= 0x10000 ? Type.U16 : Type.U32; | ||
/** | ||
@@ -123,5 +123,5 @@ * Returns the smallest possible *signed* int type enum for given `x`. | ||
export const intType = (x) => x >= -0x80 && x < 0x80 | ||
? 2 /* I8 */ | ||
? Type.I8 | ||
: x >= -0x8000 && x < 0x8000 | ||
? 4 /* I16 */ | ||
: 6 /* I32 */; | ||
? Type.I16 | ||
: Type.I32; |
@@ -6,2 +6,10 @@ # Change Log | ||
## [6.9.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.9.0...@thi.ng/api@6.9.1) (2020-04-05) | ||
**Note:** Version bump only for package @thi.ng/api | ||
# [6.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.8.3...@thi.ng/api@6.9.0) (2020-03-28) | ||
@@ -8,0 +16,0 @@ |
37
index.js
@@ -0,3 +1,40 @@ | ||
export * from "./api/assoc"; | ||
export * from "./api/bind"; | ||
export * from "./api/buffered"; | ||
export * from "./api/clear"; | ||
export * from "./api/compare"; | ||
export * from "./api/contains"; | ||
export * from "./api/copy"; | ||
export * from "./api/deref"; | ||
export * from "./api/dissoc"; | ||
export * from "./api/empty"; | ||
export * from "./api/enable"; | ||
export * from "./api/equiv"; | ||
export * from "./api/event"; | ||
export * from "./api/fn"; | ||
export * from "./api/get"; | ||
export * from "./api/hash"; | ||
export * from "./api/hiccup"; | ||
export * from "./api/id"; | ||
export * from "./api/indexed"; | ||
export * from "./api/into"; | ||
export * from "./api/keyval"; | ||
export * from "./api/length"; | ||
export * from "./api/logger"; | ||
export * from "./api/meta"; | ||
export * from "./api/null"; | ||
export * from "./api/object"; | ||
export * from "./api/path"; | ||
export * from "./api/predicate"; | ||
export * from "./api/prim"; | ||
export * from "./api/range"; | ||
export * from "./api/release"; | ||
export * from "./api/reset"; | ||
export * from "./api/select"; | ||
export * from "./api/seq"; | ||
export * from "./api/set"; | ||
export * from "./api/stack"; | ||
export * from "./api/tuple"; | ||
export * from "./api/typedarray"; | ||
export * from "./api/watch"; | ||
export * from "./assert"; | ||
@@ -4,0 +41,0 @@ export * from "./constants"; |
@@ -35,50 +35,50 @@ 'use strict'; | ||
const GL2TYPE = { | ||
[5120 ]: 2 , | ||
[5121 ]: 0 , | ||
[5122 ]: 4 , | ||
[5123 ]: 3 , | ||
[5124 ]: 6 , | ||
[5125 ]: 5 , | ||
[5126 ]: 7 | ||
[exports.GLType.I8]: exports.Type.I8, | ||
[exports.GLType.U8]: exports.Type.U8, | ||
[exports.GLType.I16]: exports.Type.I16, | ||
[exports.GLType.U16]: exports.Type.U16, | ||
[exports.GLType.I32]: exports.Type.I32, | ||
[exports.GLType.U32]: exports.Type.U32, | ||
[exports.GLType.F32]: exports.Type.F32, | ||
}; | ||
const TYPE2GL = { | ||
[2 ]: 5120 , | ||
[0 ]: 5121 , | ||
[1 ]: 5121 , | ||
[4 ]: 5122 , | ||
[3 ]: 5123 , | ||
[6 ]: 5124 , | ||
[6 ]: 5124 , | ||
[5 ]: 5125 , | ||
[7 ]: 5126 , | ||
[8 ]: undefined | ||
[exports.Type.I8]: exports.GLType.I8, | ||
[exports.Type.U8]: exports.GLType.U8, | ||
[exports.Type.U8C]: exports.GLType.U8, | ||
[exports.Type.I16]: exports.GLType.I16, | ||
[exports.Type.U16]: exports.GLType.U16, | ||
[exports.Type.I32]: exports.GLType.I32, | ||
[exports.Type.I32]: exports.GLType.I32, | ||
[exports.Type.U32]: exports.GLType.U32, | ||
[exports.Type.F32]: exports.GLType.F32, | ||
[exports.Type.F64]: undefined, | ||
}; | ||
const SIZEOF = { | ||
[0 ]: 1, | ||
[1 ]: 1, | ||
[2 ]: 1, | ||
[3 ]: 2, | ||
[4 ]: 2, | ||
[5 ]: 4, | ||
[6 ]: 4, | ||
[7 ]: 4, | ||
[8 ]: 8 | ||
[exports.Type.U8]: 1, | ||
[exports.Type.U8C]: 1, | ||
[exports.Type.I8]: 1, | ||
[exports.Type.U16]: 2, | ||
[exports.Type.I16]: 2, | ||
[exports.Type.U32]: 4, | ||
[exports.Type.I32]: 4, | ||
[exports.Type.F32]: 4, | ||
[exports.Type.F64]: 8, | ||
}; | ||
const TYPEDARRAY_CTORS = { | ||
[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 | ||
[exports.Type.U8]: Uint8Array, | ||
[exports.Type.U8C]: Uint8ClampedArray, | ||
[exports.Type.I8]: Int8Array, | ||
[exports.Type.U16]: Uint16Array, | ||
[exports.Type.I16]: Int16Array, | ||
[exports.Type.U32]: Uint32Array, | ||
[exports.Type.I32]: Int32Array, | ||
[exports.Type.F32]: Float32Array, | ||
[exports.Type.F64]: Float64Array, | ||
[exports.GLType.U8]: Uint8Array, | ||
[exports.GLType.I8]: Int8Array, | ||
[exports.GLType.U16]: Uint16Array, | ||
[exports.GLType.I16]: Int16Array, | ||
[exports.GLType.U32]: Uint32Array, | ||
[exports.GLType.I32]: Int32Array, | ||
[exports.GLType.F32]: Float32Array, | ||
}; | ||
@@ -88,8 +88,8 @@ function typedArray(type, ...xs) { | ||
} | ||
const uintType = (x) => x <= 0x100 ? 0 : x <= 0x10000 ? 3 : 5 ; | ||
const uintType = (x) => x <= 0x100 ? exports.Type.U8 : x <= 0x10000 ? exports.Type.U16 : exports.Type.U32; | ||
const intType = (x) => x >= -0x80 && x < 0x80 | ||
? 2 | ||
? exports.Type.I8 | ||
: x >= -0x8000 && x < 0x8000 | ||
? 4 | ||
: 6 ; | ||
? exports.Type.I16 | ||
: exports.Type.I32; | ||
@@ -96,0 +96,0 @@ const DEFAULT_EPS = 1e-6; |
@@ -1,1 +0,1 @@ | ||
!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";var t,n,i;(t=e.LogLevel||(e.LogLevel={}))[t.FINE=0]="FINE",t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.SEVERE=4]="SEVERE",t[t.NONE=5]="NONE",(n=e.Type||(e.Type={}))[n.U8=0]="U8",n[n.U8C=1]="U8C",n[n.I8=2]="I8",n[n.U16=3]="U16",n[n.I16=4]="I16",n[n.U32=5]="U32",n[n.I32=6]="I32",n[n.F32=7]="F32",n[n.F64=8]="F64",(i=e.GLType||(e.GLType={}))[i.I8=5120]="I8",i[i.U8=5121]="U8",i[i.I16=5122]="I16",i[i.U16=5123]="U16",i[i.I32=5124]="I32",i[i.U32=5125]="U32",i[i.F32=5126]="F32";const r={5120:2,5121:0,5122:4,5123:3,5124:6,5125:5,5126:7},o={2:5120,0:5121,1:5121,4:5122,3:5123,6:5124,6:5124,5:5125,7:5126,8:void 0},s={0:1,1:1,2:1,3:2,4:2,5:4,6:4,7:4,8:8},l={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 a=Symbol(),c=()=>{},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)}:c,h=Object.freeze({level:e.LogLevel.NONE,fine(){},debug(){},info(){},warn(){},severe(){}});const d=(e,t={})=>{const n=Reflect.ownKeys(e),i=Reflect.ownKeys(t),r=Symbol("isa");function o(t){for(let i of n){const n=Object.getOwnPropertyDescriptor(t.prototype,i);!n||n.configurable?Object.defineProperty(t.prototype,i,{value:e[i],writable:!0}):console.log(`not patching: ${t.name}.${i.toString()}`)}return Object.defineProperty(t.prototype,r,{value:!0}),t}for(let e of i)Object.defineProperty(o,e,{value:t[e],enumerable:t.propertyIsEnumerable(e)});return Object.defineProperty(o,Symbol.hasInstance,{value:e=>!!e[r]}),o},y=d({_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}}),u=(e,t)=>{if(e)for(let n,i=0,r=e.length;i<r;i++)if(n=e[i],n[0].call(n[1],t),t.canceled)return},E=d({addListener(e,t,n){let i=(this._listeners=this._listeners||{})[e];return!i&&(i=this._listeners[e]=[]),-1===this.__listener(i,t,n)&&(i.push([t,n]),!0)},removeListener(e,t,n){let i;if(!(i=this._listeners))return!1;const r=i[e];if(r){const o=this.__listener(r,t,n);if(-1!==o)return r.splice(o,1),!r.length&&delete i[e],!0}return!1},notify(e){let t;if(!(t=this._listeners))return!1;void 0===e.target&&(e.target=this),u(t[e.id],e),u(t["*"],e)},__listener(e,t,n){let i=e.length;for(;--i>=0;){const r=e[i];if(r[0]===t&&r[1]===n)break}return i}}),p=d({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 n=this._watches;for(let i in n)n[i](i,e,t)}});e.ConsoleLogger=class{constructor(t,n=e.LogLevel.FINE){this.id=t,this.level=n}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=r,e.IEnableMixin=y,e.INotifyMixin=E,e.IWatchMixin=p,e.NO_OP=c,e.NULL_LOGGER=h,e.SEMAPHORE=a,e.SIZEOF=s,e.TYPE2GL=o,e.TYPEDARRAY_CTORS=l,e.assert=f,e.configurable=e=>function(t,n,i){i.configurable=e},e.deprecated=(e,t=console.log)=>function(n,i,r){const o=`${n.constructor.name}#${i.toString()}`,s=r.value;return f("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.exposeGlobal=(e,t,n=!1)=>{const i="undefined"!=typeof global?global:"undefined"!=typeof window?window:void 0;i&&(n||"undefined"==typeof process||"production"!==process.env.NODE_ENV||"1"===process.env.UMBRELLA_ASSERTS)&&(i[e]=t)},e.inotify_dispatch=u,e.intType=e=>e>=-128&&e<128?2:e>=-32768&&e<32768?4:6,e.iterable=e=>d({*[Symbol.iterator](){yield*this[e]}}),e.mixin=d,e.nomixin=(e,t,n)=>{n.configurable=!1},e.sealed=e=>{Object.seal(e),Object.seal(e.prototype)},e.typedArray=function(e,...t){return new l[e](...t)},e.uintType=e=>e<=256?0:e<=65536?3:5,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";var t,n,i;(t=e.LogLevel||(e.LogLevel={}))[t.FINE=0]="FINE",t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.SEVERE=4]="SEVERE",t[t.NONE=5]="NONE",(n=e.Type||(e.Type={}))[n.U8=0]="U8",n[n.U8C=1]="U8C",n[n.I8=2]="I8",n[n.U16=3]="U16",n[n.I16=4]="I16",n[n.U32=5]="U32",n[n.I32=6]="I32",n[n.F32=7]="F32",n[n.F64=8]="F64",(i=e.GLType||(e.GLType={}))[i.I8=5120]="I8",i[i.U8=5121]="U8",i[i.I16=5122]="I16",i[i.U16=5123]="U16",i[i.I32=5124]="I32",i[i.U32=5125]="U32",i[i.F32=5126]="F32";const r={[e.GLType.I8]:e.Type.I8,[e.GLType.U8]:e.Type.U8,[e.GLType.I16]:e.Type.I16,[e.GLType.U16]:e.Type.U16,[e.GLType.I32]:e.Type.I32,[e.GLType.U32]:e.Type.U32,[e.GLType.F32]:e.Type.F32},o={[e.Type.I8]:e.GLType.I8,[e.Type.U8]:e.GLType.U8,[e.Type.U8C]:e.GLType.U8,[e.Type.I16]:e.GLType.I16,[e.Type.U16]:e.GLType.U16,[e.Type.I32]:e.GLType.I32,[e.Type.I32]:e.GLType.I32,[e.Type.U32]:e.GLType.U32,[e.Type.F32]:e.GLType.F32,[e.Type.F64]:void 0},s={[e.Type.U8]:1,[e.Type.U8C]:1,[e.Type.I8]:1,[e.Type.U16]:2,[e.Type.I16]:2,[e.Type.U32]:4,[e.Type.I32]:4,[e.Type.F32]:4,[e.Type.F64]:8},y={[e.Type.U8]:Uint8Array,[e.Type.U8C]:Uint8ClampedArray,[e.Type.I8]:Int8Array,[e.Type.U16]:Uint16Array,[e.Type.I16]:Int16Array,[e.Type.U32]:Uint32Array,[e.Type.I32]:Int32Array,[e.Type.F32]:Float32Array,[e.Type.F64]:Float64Array,[e.GLType.U8]:Uint8Array,[e.GLType.I8]:Int8Array,[e.GLType.U16]:Uint16Array,[e.GLType.I16]:Int16Array,[e.GLType.U32]:Uint32Array,[e.GLType.I32]:Int32Array,[e.GLType.F32]:Float32Array};const l=Symbol(),p=()=>{},a="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)}:p,T=Object.freeze({level:e.LogLevel.NONE,fine(){},debug(){},info(){},warn(){},severe(){}});const c=(e,t={})=>{const n=Reflect.ownKeys(e),i=Reflect.ownKeys(t),r=Symbol("isa");function o(t){for(let i of n){const n=Object.getOwnPropertyDescriptor(t.prototype,i);!n||n.configurable?Object.defineProperty(t.prototype,i,{value:e[i],writable:!0}):console.log(`not patching: ${t.name}.${i.toString()}`)}return Object.defineProperty(t.prototype,r,{value:!0}),t}for(let e of i)Object.defineProperty(o,e,{value:t[e],enumerable:t.propertyIsEnumerable(e)});return Object.defineProperty(o,Symbol.hasInstance,{value:e=>!!e[r]}),o},f=c({_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}}),h=(e,t)=>{if(e)for(let n,i=0,r=e.length;i<r;i++)if(n=e[i],n[0].call(n[1],t),t.canceled)return},d=c({addListener(e,t,n){let i=(this._listeners=this._listeners||{})[e];return!i&&(i=this._listeners[e]=[]),-1===this.__listener(i,t,n)&&(i.push([t,n]),!0)},removeListener(e,t,n){let i;if(!(i=this._listeners))return!1;const r=i[e];if(r){const o=this.__listener(r,t,n);if(-1!==o)return r.splice(o,1),!r.length&&delete i[e],!0}return!1},notify(e){let t;if(!(t=this._listeners))return!1;void 0===e.target&&(e.target=this),h(t[e.id],e),h(t["*"],e)},__listener(e,t,n){let i=e.length;for(;--i>=0;){const r=e[i];if(r[0]===t&&r[1]===n)break}return i}}),I=c({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 n=this._watches;for(let i in n)n[i](i,e,t)}});e.ConsoleLogger=class{constructor(t,n=e.LogLevel.FINE){this.id=t,this.level=n}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=r,e.IEnableMixin=f,e.INotifyMixin=d,e.IWatchMixin=I,e.NO_OP=p,e.NULL_LOGGER=T,e.SEMAPHORE=l,e.SIZEOF=s,e.TYPE2GL=o,e.TYPEDARRAY_CTORS=y,e.assert=a,e.configurable=e=>function(t,n,i){i.configurable=e},e.deprecated=(e,t=console.log)=>function(n,i,r){const o=`${n.constructor.name}#${i.toString()}`,s=r.value;return a("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.exposeGlobal=(e,t,n=!1)=>{const i="undefined"!=typeof global?global:"undefined"!=typeof window?window:void 0;i&&(n||"undefined"==typeof process||"production"!==process.env.NODE_ENV||"1"===process.env.UMBRELLA_ASSERTS)&&(i[e]=t)},e.inotify_dispatch=h,e.intType=t=>t>=-128&&t<128?e.Type.I8:t>=-32768&&t<32768?e.Type.I16:e.Type.I32,e.iterable=e=>c({*[Symbol.iterator](){yield*this[e]}}),e.mixin=c,e.nomixin=(e,t,n)=>{n.configurable=!1},e.sealed=e=>{Object.seal(e),Object.seal(e.prototype)},e.typedArray=function(e,...t){return new y[e](...t)},e.uintType=t=>t<=256?e.Type.U8:t<=65536?e.Type.U16:e.Type.U32,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@thi.ng/api", | ||
"version": "6.9.0", | ||
"version": "6.9.1", | ||
"description": "Common, generic types, interfaces & mixins", | ||
@@ -34,3 +34,3 @@ "module": "./index.js", | ||
"@types/node": "^13.7.4", | ||
"mocha": "^7.0.1", | ||
"mocha": "^7.1.1", | ||
"nyc": "^15.0.0", | ||
@@ -62,3 +62,3 @@ "ts-node": "^8.6.2", | ||
}, | ||
"gitHead": "202477e312cf26869f0421e42a9a5fd80ff6adc8" | ||
"gitHead": "1fbd320aece52cdf48c3f502a449109b2c9ccfd9" | ||
} |
<!-- This file is generated - DO NOT EDIT! --> | ||
# ![@thi.ng/api](https://media.thi.ng/umbrella/banners/thing-api.svg?1585427305) | ||
# ![api](https://media.thi.ng/umbrella/banners/thing-api.svg?56b8f72e) | ||
@@ -47,3 +47,3 @@ [![npm version](https://img.shields.io/npm/v/@thi.ng/api.svg)](https://www.npmjs.com/package/@thi.ng/api) | ||
Package sizes (gzipped): ESM: 1.97 KB / CJS: 2.07 KB / UMD: 2.05 KB | ||
Package sizes (gzipped, pre-treeshake): ESM: 2.01 KB / CJS: 2.14 KB / UMD: 2.12 KB | ||
@@ -50,0 +50,0 @@ ## Dependencies |
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
128962
2709