Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thi.ng/api

Package Overview
Dependencies
Maintainers
1
Versions
188
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/api - npm Package Compare versions

Comparing version 6.12.3 to 6.13.0

60

api/fn.d.ts

@@ -63,2 +63,62 @@ /**

export declare type FnAnyT<A, B> = (...xs: A[]) => B;
/**
* 1-arg function with arg of type A and return type B (defaults
* to A)
*/
export declare type FnU<A, B = A> = Fn<A, B>;
/**
* 2-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU2<A, B = A> = Fn2<A, A, B>;
/**
* 3-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU3<A, B = A> = Fn3<A, A, A, B>;
/**
* 4-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU4<A, B = A> = Fn4<A, A, A, A, B>;
/**
* 5-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU5<A, B = A> = Fn5<A, A, A, A, A, B>;
/**
* 6-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU6<A, B = A> = Fn6<A, A, A, A, A, A, B>;
/**
* 7-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU7<A, B = A> = Fn7<A, A, A, A, A, A, A, B>;
/**
* 8-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU8<A, B = A> = Fn8<A, A, A, A, A, A, A, A, B>;
/**
* 9-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU9<A, B = A> = Fn9<A, A, A, A, A, A, A, A, A, B>;
/**
* 10-arg function with all args uniformly of type A and return type B (defaults
* to A)
*/
export declare type FnU10<A, B = A> = Fn10<A, A, A, A, A, A, A, A, A, A, B>;
export declare type FnN = FnU<number>;
export declare type FnN2 = FnU2<number>;
export declare type FnN3 = FnU3<number>;
export declare type FnN4 = FnU4<number>;
export declare type FnN5 = FnU5<number>;
export declare type FnN6 = FnU6<number>;
export declare type FnN7 = FnU7<number>;
export declare type FnN8 = FnU8<number>;
export declare type FnN9 = FnU9<number>;
export declare type FnN10 = FnU10<number>;
//# sourceMappingURL=fn.d.ts.map

3

api/keyval.d.ts

@@ -10,2 +10,5 @@ import type { Head, Tail } from "./tuple";

export declare type StringKeys<T> = TypedKeys<T, string>;
export declare type DeepPartial<T> = Partial<{
[k in keyof T]: DeepPartial<T[k]>;
}>;
export declare type Keys<T> = keyof Required<T>;

@@ -12,0 +15,0 @@ export declare type Keys1<T, A extends Keys<T>> = Keys<Required<T>[A]>;

11

assert.js

@@ -10,5 +10,10 @@ import { NO_OP } from "./constants";

*/
export const assert = typeof process === "undefined" ||
process.env.NODE_ENV !== "production" ||
process.env.UMBRELLA_ASSERTS === "1"
export const assert = (() => {
try {
return (process.env.NODE_ENV !== "production" ||
process.env.UMBRELLA_ASSERTS === "1");
}
catch (e) { }
return false;
})()
? (test, msg = "assertion failed") => {

@@ -15,0 +20,0 @@ if ((typeof test === "function" && !test()) || !test) {

@@ -6,2 +6,19 @@ # Change Log

# [6.13.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.12.3...@thi.ng/api@6.13.0) (2020-09-13)
### Bug Fixes
* **api:** update assert() & exposeGlobal() detection ([2cdc038](https://github.com/thi-ng/umbrella/commit/2cdc038d5ae3f8efba7c71e708de6eda1d3a4dd5))
### Features
* **api:** add DeepPartial type ([0d9a0de](https://github.com/thi-ng/umbrella/commit/0d9a0de2c3b5029bdc49101727d234a065a94869))
* **api:** add FnU and FnN function types ([4ba48d0](https://github.com/thi-ng/umbrella/commit/4ba48d0dc4324c79c9e9b11d9e55b04b5c5f54c7))
## [6.12.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@6.12.2...@thi.ng/api@6.12.3) (2020-08-28)

@@ -8,0 +25,0 @@

@@ -18,7 +18,12 @@ /**

(always ||
typeof process === "undefined" ||
process.env.NODE_ENV !== "production" ||
process.env.UMBRELLA_ASSERTS === "1")) {
(() => {
try {
return (process.env.NODE_ENV !== "production" ||
process.env.UMBRELLA_GLOBALS === "1");
}
catch (e) { }
return false;
})())) {
glob[id] = value;
}
};

@@ -104,5 +104,10 @@ 'use strict';

const assert = typeof process === "undefined" ||
process.env.NODE_ENV !== "production" ||
process.env.UMBRELLA_ASSERTS === "1"
const assert = (() => {
try {
return (process.env.NODE_ENV !== "production" ||
process.env.UMBRELLA_ASSERTS === "1");
}
catch (e) { }
return false;
})()
? (test, msg = "assertion failed") => {

@@ -123,5 +128,10 @@ if ((typeof test === "function" && !test()) || !test) {

(always ||
typeof process === "undefined" ||
process.env.NODE_ENV !== "production" ||
process.env.UMBRELLA_ASSERTS === "1")) {
(() => {
try {
return (process.env.NODE_ENV !== "production" ||
process.env.UMBRELLA_GLOBALS === "1");
}
catch (e) { }
return false;
})())) {
glob[id] = value;

@@ -128,0 +138,0 @@ }

@@ -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="undefined"!=typeof globalThis?globalThis:e||self).thi=e.thi||{},e.thi.ng=e.thi.ng||{},e.thi.ng.api={}))}(this,(function(e){"use strict";const t=e=>null!=e&&"function"==typeof e.deref;var n,i,r;(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",(i=e.Type||(e.Type={}))[i.U8=0]="U8",i[i.U8C=1]="U8C",i[i.I8=2]="I8",i[i.U16=3]="U16",i[i.I16=4]="I16",i[i.U32=5]="U32",i[i.I32=6]="I32",i[i.F32=7]="F32",i[i.F64=8]="F64",(r=e.GLType||(e.GLType={}))[r.I8=5120]="I8",r[r.U8=5121]="U8",r[r.I16=5122]="I16",r[r.U16=5123]="U16",r[r.I32=5124]="I32",r[r.U32=5125]="U32",r[r.F32=5126]="F32";const o={[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},s={[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},y={[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},l={[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 p=Symbol(),a=()=>{},T="enable",f="disable",c="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)}:a,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},u=d({_enabled:!0,isEnabled(){return this._enabled},enable(){this._enabled=!0,this.notify&&this.notify({id:T,target:this})},disable(){this._enabled=!1,this.notify&&this.notify({id:f,target:this})},toggle(){return this._enabled?this.disable():this.enable(),this._enabled}}),I=(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},L=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),I(t[e.id],e),I(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}}),E=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=f,e.EVENT_ENABLE=T,e.GL2TYPE=o,e.IEnableMixin=u,e.INotifyMixin=L,e.IWatchMixin=E,e.NO_OP=a,e.NULL_LOGGER=h,e.SEMAPHORE=p,e.SIZEOF=y,e.TYPE2GL=s,e.TYPEDARRAY_CTORS=l,e.assert=c,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 c("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.deref=e=>t(e)?e.deref():e,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=I,e.intType=t=>t>=-128&&t<128?e.Type.I8:t>=-32768&&t<32768?e.Type.I16:e.Type.I32,e.isDeref=t,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=t=>t<=256?e.Type.U8:t<=65536?e.Type.U16:e.Type.U32,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="undefined"!=typeof globalThis?globalThis:e||self).thi=e.thi||{},e.thi.ng=e.thi.ng||{},e.thi.ng.api={}))}(this,(function(e){"use strict";const t=e=>null!=e&&"function"==typeof e.deref;var n,i,r;(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",(i=e.Type||(e.Type={}))[i.U8=0]="U8",i[i.U8C=1]="U8C",i[i.I8=2]="I8",i[i.U16=3]="U16",i[i.I16=4]="I16",i[i.U32=5]="U32",i[i.I32=6]="I32",i[i.F32=7]="F32",i[i.F64=8]="F64",(r=e.GLType||(e.GLType={}))[r.I8=5120]="I8",r[r.U8=5121]="U8",r[r.I16=5122]="I16",r[r.U16=5123]="U16",r[r.I32=5124]="I32",r[r.U32=5125]="U32",r[r.F32=5126]="F32";const o={[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},s={[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},y={[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},l={[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 p=Symbol(),a=()=>{},c="enable",T="disable",f=(()=>{try{return"production"!==process.env.NODE_ENV||"1"===process.env.UMBRELLA_ASSERTS}catch(e){}return!1})()?(e,t="assertion failed")=>{if("function"==typeof e&&!e()||!e)throw new Error("function"==typeof t?t():t)}:a,h=Object.freeze({level:e.LogLevel.NONE,fine(){},debug(){},info(){},warn(){},severe(){}});const u=(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},d=u({_enabled:!0,isEnabled(){return this._enabled},enable(){this._enabled=!0,this.notify&&this.notify({id:c,target:this})},disable(){this._enabled=!1,this.notify&&this.notify({id:T,target:this})},toggle(){return this._enabled?this.disable():this.enable(),this._enabled}}),L=(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},I=u({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),L(t[e.id],e),L(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}}),U=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 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=T,e.EVENT_ENABLE=c,e.GL2TYPE=o,e.IEnableMixin=d,e.INotifyMixin=I,e.IWatchMixin=U,e.NO_OP=a,e.NULL_LOGGER=h,e.SEMAPHORE=p,e.SIZEOF=y,e.TYPE2GL=s,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.deref=e=>t(e)?e.deref():e,e.exposeGlobal=(e,t,n=!1)=>{const i="undefined"!=typeof global?global:"undefined"!=typeof window?window:void 0;i&&(n||(()=>{try{return"production"!==process.env.NODE_ENV||"1"===process.env.UMBRELLA_GLOBALS}catch(e){}return!1})())&&(i[e]=t)},e.inotify_dispatch=L,e.intType=t=>t>=-128&&t<128?e.Type.I8:t>=-32768&&t<32768?e.Type.I16:e.Type.I32,e.isDeref=t,e.iterable=e=>u({*[Symbol.iterator](){yield*this[e]}}),e.mixin=u,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=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.12.3",
"version": "6.13.0",
"description": "Common, generic types, interfaces & mixins",

@@ -34,3 +34,3 @@ "module": "./index.js",

"cover": "nyc mocha test && nyc report --reporter=lcov",
"clean": "rimraf *.js *.d.ts .nyc_output build coverage doc lib api decorators mixins",
"clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib api decorators mixins",
"doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",

@@ -64,9 +64,10 @@ "doc": "node_modules/.bin/typedoc --mode modules --out doc --theme ../../tools/doc/typedoc-theme src",

"keywords": [
"compare",
"equality",
"ES6",
"assert",
"constants",
"decorators",
"es6",
"generic",
"interfaces",
"mixins",
"type declarations",
"interface",
"mixin",
"type",
"typescript"

@@ -82,3 +83,3 @@ ],

"sideEffects": false,
"gitHead": "3a55c0df86c5be9c56a1e1a4c0cfcaa2809a160a"
"gitHead": "83a0206aae59aa1b1b4bcb01c2b34bbe3db4844c"
}

@@ -55,3 +55,3 @@ <!-- This file is generated - DO NOT EDIT! -->

Package sizes (gzipped, pre-treeshake): ESM: 2.05 KB / CJS: 2.19 KB / UMD: 2.17 KB
Package sizes (gzipped, pre-treeshake): ESM: 2.08 KB / CJS: 2.22 KB / UMD: 2.19 KB

@@ -58,0 +58,0 @@ ## Dependencies

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc