@thi.ng/api
Advanced tools
Comparing version 6.7.1 to 6.8.0
@@ -1,3 +0,7 @@ | ||
import { Fn } from "./fn"; | ||
import type { Fn } from "./fn"; | ||
/** | ||
* A key-value pair / tuple. | ||
*/ | ||
export declare type Pair<K, V> = [K, V]; | ||
/** | ||
* @param K - key type | ||
@@ -4,0 +8,0 @@ * @param V - value type |
@@ -1,2 +0,2 @@ | ||
import { Fn2 } from "./fn"; | ||
import type { Fn2 } from "./fn"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Generic 2-element comparator function type alias. |
@@ -1,2 +0,2 @@ | ||
import { IAssoc, IAssocIn } from "./assoc"; | ||
import type { IAssoc, IAssocIn } from "./assoc"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Extension of `IAssoc` for types supporting key removals. |
@@ -1,6 +0,3 @@ | ||
import { Fn } from "./fn"; | ||
import { IID } from "./id"; | ||
export declare const EVENT_ALL = "*"; | ||
export declare const EVENT_ENABLE = "enable"; | ||
export declare const EVENT_DISABLE = "disable"; | ||
import type { Fn } from "./fn"; | ||
import type { IID } from "./id"; | ||
/** | ||
@@ -7,0 +4,0 @@ * Event listener. |
/** | ||
* No-effect placeholder function. | ||
*/ | ||
export declare const NO_OP: () => void; | ||
/** | ||
* A no-arg function, returning T. | ||
@@ -7,0 +3,0 @@ */ |
@@ -1,2 +0,14 @@ | ||
import { Head, Tail } from "./tuple"; | ||
import type { Head, Tail } from "./tuple"; | ||
/** | ||
* Lookup path for nested data structures. | ||
*/ | ||
export declare type Path = PropertyKey | PropertyKey[]; | ||
/** | ||
* Extracts from A all keys which have values assignable to type B. | ||
*/ | ||
export declare type TypedKeys<A, B> = { | ||
[P in keyof Required<A>]: B extends A[P] ? P : never; | ||
}[keyof A]; | ||
export declare type NumericKeys<T> = TypedKeys<T, number>; | ||
export declare type StringKeys<T> = TypedKeys<T, string>; | ||
export declare type Keys<T> = keyof T; | ||
@@ -3,0 +15,0 @@ export declare type Keys1<T, A extends Keys<T>> = Keys<T[A]>; |
@@ -1,2 +0,2 @@ | ||
import { Fn, Fn0, Fn2 } from "./fn"; | ||
import type { Fn, Fn0, Fn2 } from "./fn"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Predicate function mapping given value to true/false. |
@@ -1,2 +0,2 @@ | ||
import { IInto } from "./into"; | ||
import type { IInto } from "./into"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Generic interface for set collection types. |
@@ -0,1 +1,3 @@ | ||
export declare type ArrayLikeIterable<T> = ArrayLike<T> & Iterable<T>; | ||
export declare type NumericArray = number[] | TypedArray; | ||
export declare type TypedArray = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array; | ||
@@ -61,11 +63,11 @@ export declare type IntArray = Int8Array | Int16Array | Int32Array; | ||
export declare const SIZEOF: { | ||
[Type.U8]: number; | ||
[Type.U8C]: number; | ||
[Type.I8]: number; | ||
[Type.U16]: number; | ||
[Type.I16]: number; | ||
[Type.U32]: number; | ||
[Type.I32]: number; | ||
[Type.F32]: number; | ||
[Type.F64]: number; | ||
0: number; | ||
1: number; | ||
2: number; | ||
3: number; | ||
4: number; | ||
5: number; | ||
6: number; | ||
7: number; | ||
8: number; | ||
}; | ||
@@ -72,0 +74,0 @@ export declare const TYPEDARRAY_CTORS: Record<Type | GLType, TypedArrayConstructor>; |
@@ -1,2 +0,2 @@ | ||
import { Fn0 } from "./api/fn"; | ||
import type { Fn0 } from "./api/fn"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Takes a `test` result or predicate function without args and throws |
@@ -1,2 +0,2 @@ | ||
import { NO_OP } from "./api/fn"; | ||
import { NO_OP } from "./constants"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Takes a `test` result or predicate function without args and throws |
131
CHANGELOG.md
@@ -6,13 +6,20 @@ # Change Log | ||
## [6.7.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.7.0...@thi.ng/api@6.7.1) (2020-01-26) | ||
# [6.8.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.7.1...@thi.ng/api@6.8.0) (2020-02-25) | ||
**Note:** Version bump only for package @thi.ng/api | ||
### Bug Fixes | ||
* **api:** fix imports ([e3e0cdc](https://github.com/thi-ng/umbrella/commit/e3e0cdc244dd25f33c633e7477e56baf0a9e53e4)) | ||
### Features | ||
* **api:** add TypedKeys, NumericKeys, StringKeys ([fab1a5e](https://github.com/thi-ng/umbrella/commit/fab1a5ec800b68c8170f7c9f138781c6e7fd4263)) | ||
# [6.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.6.0...@thi.ng/api@6.7.0) (2020-01-24) | ||
### Bug Fixes | ||
@@ -22,3 +29,2 @@ | ||
### Features | ||
@@ -42,9 +48,4 @@ | ||
# [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 | ||
@@ -56,9 +57,4 @@ | ||
# [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) | ||
### Features | ||
@@ -70,9 +66,4 @@ | ||
# [6.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.3.3...@thi.ng/api@6.4.0) (2019-09-21) | ||
### Features | ||
@@ -82,33 +73,4 @@ | ||
## [6.3.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.3.2...@thi.ng/api@6.3.3) (2019-08-21) | ||
**Note:** Version bump only for package @thi.ng/api | ||
## [6.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.3.1...@thi.ng/api@6.3.2) (2019-07-31) | ||
**Note:** Version bump only for package @thi.ng/api | ||
## [6.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.3.0...@thi.ng/api@6.3.1) (2019-07-12) | ||
**Note:** Version bump only for package @thi.ng/api | ||
# [6.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.2.0...@thi.ng/api@6.3.0) (2019-07-07) | ||
### Features | ||
@@ -120,9 +82,4 @@ | ||
# [6.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.1.1...@thi.ng/api@6.2.0) (2019-05-22) | ||
### Features | ||
@@ -132,9 +89,4 @@ | ||
## [6.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.1.0...@thi.ng/api@6.1.1) (2019-04-26) | ||
### Bug Fixes | ||
@@ -144,9 +96,4 @@ | ||
# [6.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.0.1...@thi.ng/api@6.1.0) (2019-04-24) | ||
### Features | ||
@@ -157,17 +104,4 @@ | ||
## [6.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.0.0...@thi.ng/api@6.0.1) (2019-04-02) | ||
**Note:** Version bump only for package @thi.ng/api | ||
# [6.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@5.1.0...@thi.ng/api@6.0.0) (2019-03-28) | ||
### Features | ||
@@ -177,3 +111,2 @@ | ||
### BREAKING CHANGES | ||
@@ -190,9 +123,4 @@ | ||
# [5.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@5.0.3...@thi.ng/api@5.1.0) (2019-03-10) | ||
### Features | ||
@@ -203,7 +131,4 @@ | ||
# [5.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@4.2.4...@thi.ng/api@5.0.0) (2019-01-21) | ||
### Bug Fixes | ||
@@ -213,3 +138,2 @@ | ||
### Build System | ||
@@ -219,3 +143,2 @@ | ||
### Features | ||
@@ -225,3 +148,2 @@ | ||
### BREAKING CHANGES | ||
@@ -234,7 +156,5 @@ | ||
<a name="4.2.0"></a> | ||
# [4.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@4.1.1...@thi.ng/api@4.2.0) (2018-09-22) | ||
### Features | ||
@@ -244,7 +164,5 @@ | ||
<a name="4.1.0"></a> | ||
# [4.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@4.0.6...@thi.ng/api@4.1.0) (2018-08-24) | ||
### Features | ||
@@ -255,7 +173,5 @@ | ||
<a name="4.0.0"></a> | ||
# [4.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@3.0.1...@thi.ng/api@4.0.0) (2018-05-12) | ||
### Code Refactoring | ||
@@ -265,3 +181,2 @@ | ||
### BREAKING CHANGES | ||
@@ -277,7 +192,5 @@ | ||
<a name="3.0.0"></a> | ||
# [3.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@2.3.2...@thi.ng/api@3.0.0) (2018-05-10) | ||
### Code Refactoring | ||
@@ -287,3 +200,2 @@ | ||
### BREAKING CHANGES | ||
@@ -300,7 +212,5 @@ | ||
<a name="2.3.1"></a> | ||
## [2.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@2.3.0...@thi.ng/api@2.3.1) (2018-04-29) | ||
### Performance Improvements | ||
@@ -310,9 +220,5 @@ | ||
<a name="2.3.0"></a> | ||
# [2.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@2.2.0...@thi.ng/api@2.3.0) (2018-04-26) | ||
### Features | ||
@@ -325,3 +231,2 @@ | ||
### Features | ||
@@ -331,7 +236,5 @@ | ||
<a name="2.1.1"></a> | ||
## [2.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@2.1.0...@thi.ng/api@2.1.1) (2018-03-28) | ||
### Bug Fixes | ||
@@ -341,7 +244,5 @@ | ||
<a name="2.1.0"></a> | ||
# [2.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@2.0.4...@thi.ng/api@2.1.0) (2018-03-21) | ||
### Features | ||
@@ -351,7 +252,5 @@ | ||
<a name="2.0.1"></a> | ||
## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@2.0.0...@thi.ng/api@2.0.1) (2018-02-02) | ||
### Bug Fixes | ||
@@ -361,7 +260,5 @@ | ||
<a name="2.0.0"></a> | ||
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@1.5.0...@thi.ng/api@2.0.0) (2018-02-01) | ||
### Bug Fixes | ||
@@ -371,3 +268,2 @@ | ||
### Features | ||
@@ -377,3 +273,2 @@ | ||
### BREAKING CHANGES | ||
@@ -383,7 +278,5 @@ | ||
<a name="1.5.0"></a> | ||
# [1.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@1.4.2...@thi.ng/api@1.5.0) (2018-01-31) | ||
### Features | ||
@@ -393,7 +286,5 @@ | ||
<a name="1.4.0"></a> | ||
# [1.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@1.3.0...@thi.ng/api@1.4.0) (2018-01-29) | ||
### Features | ||
@@ -403,9 +294,7 @@ | ||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@1.2.1...@thi.ng/api@1.3.0) (2018-01-28) | ||
### Features | ||
* **api:** add StatefulPredicate ([c74353b](https://github.com/thi-ng/umbrella/commit/c74353b)) |
@@ -1,39 +0,41 @@ | ||
export * from "./api"; | ||
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 type * from "./api/assoc"; | ||
export type * from "./api/bind"; | ||
export type * from "./api/buffered"; | ||
export type * from "./api/clear"; | ||
export type * from "./api/compare"; | ||
export type * from "./api/contains"; | ||
export type * from "./api/copy"; | ||
export type * from "./api/deref"; | ||
export type * from "./api/dissoc"; | ||
export type * from "./api/empty"; | ||
export type * from "./api/enable"; | ||
export type * 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 type * from "./api/get"; | ||
export type * from "./api/hash"; | ||
export type * from "./api/hiccup"; | ||
export type * from "./api/id"; | ||
export type * from "./api/indexed"; | ||
export type * from "./api/into"; | ||
export type * from "./api/keyval"; | ||
export type * from "./api/length"; | ||
export * from "./api/logger"; | ||
export * from "./api/meta"; | ||
export * from "./api/object"; | ||
export * from "./api/predicate"; | ||
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 type * from "./api/meta"; | ||
export type * from "./api/null"; | ||
export type * from "./api/object"; | ||
export type * from "./api/predicate"; | ||
export type * from "./api/prim"; | ||
export type * from "./api/range"; | ||
export type * from "./api/release"; | ||
export type * from "./api/reset"; | ||
export type * from "./api/select"; | ||
export type * from "./api/seq"; | ||
export type * from "./api/set"; | ||
export type * from "./api/stack"; | ||
export type * from "./api/tuple"; | ||
export * from "./api/typedarray"; | ||
export * from "./api/watch"; | ||
export type * from "./api/watch"; | ||
export * from "./assert"; | ||
export * from "./constants"; | ||
export * from "./expose"; | ||
@@ -40,0 +42,0 @@ export * from "./logger"; |
@@ -1,7 +0,5 @@ | ||
export * from "./api"; | ||
export * from "./api/event"; | ||
export * from "./api/fn"; | ||
export * from "./api/logger"; | ||
export * from "./api/typedarray"; | ||
export * from "./assert"; | ||
export * from "./constants"; | ||
export * from "./expose"; | ||
@@ -8,0 +6,0 @@ export * from "./logger"; |
@@ -5,11 +5,2 @@ 'use strict'; | ||
const DEFAULT_EPS = 1e-6; | ||
const SEMAPHORE = Symbol(); | ||
const EVENT_ALL = "*"; | ||
const EVENT_ENABLE = "enable"; | ||
const EVENT_DISABLE = "disable"; | ||
const NO_OP = () => { }; | ||
(function (LogLevel) { | ||
@@ -104,2 +95,9 @@ LogLevel[LogLevel["FINE"] = 0] = "FINE"; | ||
const DEFAULT_EPS = 1e-6; | ||
const SEMAPHORE = Symbol(); | ||
const NO_OP = () => { }; | ||
const EVENT_ALL = "*"; | ||
const EVENT_ENABLE = "enable"; | ||
const EVENT_DISABLE = "disable"; | ||
const assert = typeof process === "undefined" || | ||
@@ -106,0 +104,0 @@ process.env.NODE_ENV !== "production" || |
@@ -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";const t=Symbol(),n=()=>{};var i,r,o;(i=e.LogLevel||(e.LogLevel={}))[i.FINE=0]="FINE",i[i.DEBUG=1]="DEBUG",i[i.INFO=2]="INFO",i[i.WARN=3]="WARN",i[i.SEVERE=4]="SEVERE",i[i.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 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)}:n,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=s,e.IEnableMixin=y,e.INotifyMixin=E,e.IWatchMixin=p,e.NO_OP=n,e.NULL_LOGGER=h,e.SEMAPHORE=t,e.SIZEOF=a,e.TYPE2GL=l,e.TYPEDARRAY_CTORS=c,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 c[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={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})})); |
@@ -1,2 +0,3 @@ | ||
import { ILogger, LogLevel } from "./api/logger"; | ||
import { LogLevel } from "./api/logger"; | ||
import type { ILogger } from "./api/logger"; | ||
export declare const NULL_LOGGER: ILogger; | ||
@@ -3,0 +4,0 @@ export declare class ConsoleLogger implements ILogger { |
@@ -1,2 +0,2 @@ | ||
import { EVENT_DISABLE, EVENT_ENABLE } from "../api/event"; | ||
import { EVENT_DISABLE, EVENT_ENABLE } from "../constants"; | ||
import { mixin } from "../mixin"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { EVENT_ALL } from "../api/event"; | ||
import { EVENT_ALL } from "../constants"; | ||
import { mixin } from "../mixin"; | ||
@@ -3,0 +3,0 @@ export const inotify_dispatch = (listeners, e) => { |
{ | ||
"name": "@thi.ng/api", | ||
"version": "6.7.1", | ||
"version": "6.8.0", | ||
"description": "Common, generic types, interfaces & mixins", | ||
@@ -31,10 +31,10 @@ "module": "./index.js", | ||
"@istanbuljs/nyc-config-typescript": "^1.0.1", | ||
"@microsoft/api-extractor": "^7.7.7", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^13.5.0", | ||
"mocha": "^7.0.0", | ||
"@microsoft/api-extractor": "^7.7.8", | ||
"@types/mocha": "^7.0.1", | ||
"@types/node": "^13.7.4", | ||
"mocha": "^7.0.1", | ||
"nyc": "^15.0.0", | ||
"ts-node": "^8.6.2", | ||
"typedoc": "^0.16.8", | ||
"typescript": "^3.7.5" | ||
"typedoc": "^0.16.10", | ||
"typescript": "^3.8.2" | ||
}, | ||
@@ -59,3 +59,3 @@ "keywords": [ | ||
"sideEffects": false, | ||
"gitHead": "38d193103121815a5794ae242817f8f306b6ddd4" | ||
"gitHead": "b75ac2e62a828cc6ebf7b2aec4332bdf6f933a59" | ||
} |
<!-- This file is generated - DO NOT EDIT! --> | ||
# @thi.ng/api | ||
# ![@thi.ng/api](https://media.thi.ng/umbrella/banners/thing-api.svg?1581297776) | ||
@@ -5,0 +5,0 @@ [![npm version](https://img.shields.io/npm/v/@thi.ng/api.svg)](https://www.npmjs.com/package/@thi.ng/api) |
@@ -1,2 +0,2 @@ | ||
# ${pkg.name} | ||
# ${pkg.banner} | ||
@@ -3,0 +3,0 @@ [![npm version](https://img.shields.io/npm/v/${pkg.name}.svg)](https://www.npmjs.com/package/${pkg.name}) |
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
146031
115
2564