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

@liff/use

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liff/use - npm Package Compare versions

Comparing version 2.15.0 to 2.16.0

7

lib/context.d.ts
import { ModuleDriver, ModuleContext, Hooks } from './types';
export declare class ModuleContextImpl implements ModuleContext {
private driver;
constructor(driver: ModuleDriver);
export declare class ModuleContextImpl<Liff> implements ModuleContext<Liff> {
private _driver;
liff: Liff;
constructor(_driver: ModuleDriver, liff: Liff);
addHooks: <T extends Hooks = Hooks>(hooks: T) => void;
}

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("@liff/logger"),r=function(e){var t=this;this.driver=e,this.addHooks=function(e){t.driver.addHooks(e)}},o=function(){function t(){this.modules=new Set,this.hooksSet=new Set}return t.prototype.addHooks=function(e){this.hooksSet.add(e)},t.prototype.addModule=function(e){this.modules.add(e)},t.prototype.hasModule=function(e){return this.modules.has(e)},t.prototype.runHook=function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return e.__awaiter(this,void 0,void 0,(function(){var o,n,i,a,u,s,l,d;return e.__generator(this,(function(f){switch(f.label){case 0:o=[];try{for(n=e.__values(this.hooksSet),i=n.next();!i.done;i=n.next())a=i.value,"function"==typeof(u=a[t])&&(s=u.apply(void 0,e.__spread(r)),o.push(s))}catch(p){l={error:p}}finally{try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(l)throw l.error}}return[4,Promise.all(o)];case 1:return f.sent(),[2]}}))}))},t.prototype.runSyncHook=function(t){for(var r,o,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];try{for(var a=e.__values(this.hooksSet),u=a.next();!u.done;u=a.next()){var s=u.value,l=s[t];"function"==typeof l&&l.apply(void 0,e.__spread(n))}}catch(d){r={error:d}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}},t}(),n=function(){function e(e,t){this.driver=e,this.option=t}return e.prototype.install=function(e){return this.factory(this.driver,e)},Object.defineProperty(e.prototype,"name",{get:function(){return"use"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOption",{get:function(){return{namespacePrefix:"$"}},enumerable:!1,configurable:!0}),e.prototype.factory=function(e,r){var o=Object.assign({},this.defaultOption,this.option).namespacePrefix;return function(n,i){if(e.hasModule(n))return this;if(!n||"function"!=typeof n.install||"string"!=typeof n.name)return t.logger.warn("To install the plugin, you need to define the `name` property and the `install` method."),this;var a=""+o+n.name,u=n.install.call(n,r,i);return this[""+a]?(t.logger.warn("There is a duplicate plugin name. `"+n.name+"` plugin namespace will be override."),this[""+a]=u):void 0!==u&&(this[""+a]=u),e.addModule(n),this}},e}();exports.ModuleContextImpl=r,exports.ModuleDriverImpl=o,exports.UseModule=n;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("@liff/logger"),r=function(e,t){var r=this;this._driver=e,this.liff=t,this.addHooks=function(e){r._driver.addHooks(e)}},o=function(){function t(){this.modules=new Set,this.hooksSet=new Set}return t.prototype.addHooks=function(e){this.hooksSet.add(e)},t.prototype.addModule=function(e){this.modules.add(e)},t.prototype.hasModule=function(e){return this.modules.has(e)},t.prototype.runHook=function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return e.__awaiter(this,void 0,void 0,(function(){var o,n,i,a,u,s,l,f;return e.__generator(this,(function(d){switch(d.label){case 0:o=[];try{for(n=e.__values(this.hooksSet),i=n.next();!i.done;i=n.next())a=i.value,"function"==typeof(u=a[t])&&(s=u.apply(void 0,e.__spread(r)),o.push(s))}catch(p){l={error:p}}finally{try{i&&!i.done&&(f=n.return)&&f.call(n)}finally{if(l)throw l.error}}return[4,Promise.all(o)];case 1:return d.sent(),[2]}}))}))},t.prototype.runSyncHook=function(t){for(var r,o,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];try{for(var a=e.__values(this.hooksSet),u=a.next();!u.done;u=a.next()){var s=u.value,l=s[t];"function"==typeof l&&l.apply(void 0,e.__spread(n))}}catch(f){r={error:f}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}},t}(),n=function(){function e(e,t){this.driver=e,this.option=t}return e.prototype.install=function(e){return this.factory(this.driver,e)},Object.defineProperty(e.prototype,"name",{get:function(){return"use"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOption",{get:function(){return{namespacePrefix:"$"}},enumerable:!1,configurable:!0}),e.prototype.factory=function(e,r){var o=Object.assign({},this.defaultOption,this.option).namespacePrefix;return function(n,i){if(e.hasModule(n))return this;if(!n||"function"!=typeof n.install||"string"!=typeof n.name)return t.logger.warn("To install the plugin, you need to define the `name` property and the `install` method."),this;var a=""+o+n.name,u=n.install.call(n,r,i);return this[""+a]?(t.logger.warn("There is a duplicate plugin name. `"+n.name+"` plugin namespace will be override."),this[""+a]=u):void 0!==u&&(this[""+a]=u),e.addModule(n),this}},e}();exports.ModuleContextImpl=r,exports.ModuleDriverImpl=o,exports.UseModule=n;

@@ -1,1 +0,1 @@

import{__awaiter as t,__generator as e,__values as n,__spread as o}from"tslib";import{logger as r}from"@liff/logger";var i=function(t){var e=this;this.driver=t,this.addHooks=function(t){e.driver.addHooks(t)}},a=function(){function r(){this.modules=new Set,this.hooksSet=new Set}return r.prototype.addHooks=function(t){this.hooksSet.add(t)},r.prototype.addModule=function(t){this.modules.add(t)},r.prototype.hasModule=function(t){return this.modules.has(t)},r.prototype.runHook=function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return t(this,void 0,void 0,(function(){var t,a,u,s,l,f,p,d;return e(this,(function(e){switch(e.label){case 0:t=[];try{for(a=n(this.hooksSet),u=a.next();!u.done;u=a.next())s=u.value,"function"==typeof(l=s[r])&&(f=l.apply(void 0,o(i)),t.push(f))}catch(h){p={error:h}}finally{try{u&&!u.done&&(d=a.return)&&d.call(a)}finally{if(p)throw p.error}}return[4,Promise.all(t)];case 1:return e.sent(),[2]}}))}))},r.prototype.runSyncHook=function(t){for(var e,r,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];try{for(var u=n(this.hooksSet),s=u.next();!s.done;s=u.next()){var l=s.value,f=l[t];"function"==typeof f&&f.apply(void 0,o(i))}}catch(p){e={error:p}}finally{try{s&&!s.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}},r}(),u=function(){function t(t,e){this.driver=t,this.option=e}return t.prototype.install=function(t){return this.factory(this.driver,t)},Object.defineProperty(t.prototype,"name",{get:function(){return"use"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultOption",{get:function(){return{namespacePrefix:"$"}},enumerable:!1,configurable:!0}),t.prototype.factory=function(t,e){var n=Object.assign({},this.defaultOption,this.option).namespacePrefix;return function(o,i){if(t.hasModule(o))return this;if(!o||"function"!=typeof o.install||"string"!=typeof o.name)return r.warn("To install the plugin, you need to define the `name` property and the `install` method."),this;var a=""+n+o.name,u=o.install.call(o,e,i);return this[""+a]?(r.warn("There is a duplicate plugin name. `"+o.name+"` plugin namespace will be override."),this[""+a]=u):void 0!==u&&(this[""+a]=u),t.addModule(o),this}},t}();export{i as ModuleContextImpl,a as ModuleDriverImpl,u as UseModule};
import{__awaiter as t,__generator as e,__values as n,__spread as o}from"tslib";import{logger as r}from"@liff/logger";var i=function(t,e){var n=this;this._driver=t,this.liff=e,this.addHooks=function(t){n._driver.addHooks(t)}},a=function(){function r(){this.modules=new Set,this.hooksSet=new Set}return r.prototype.addHooks=function(t){this.hooksSet.add(t)},r.prototype.addModule=function(t){this.modules.add(t)},r.prototype.hasModule=function(t){return this.modules.has(t)},r.prototype.runHook=function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return t(this,void 0,void 0,(function(){var t,a,u,s,l,f,h,p;return e(this,(function(e){switch(e.label){case 0:t=[];try{for(a=n(this.hooksSet),u=a.next();!u.done;u=a.next())s=u.value,"function"==typeof(l=s[r])&&(f=l.apply(void 0,o(i)),t.push(f))}catch(d){h={error:d}}finally{try{u&&!u.done&&(p=a.return)&&p.call(a)}finally{if(h)throw h.error}}return[4,Promise.all(t)];case 1:return e.sent(),[2]}}))}))},r.prototype.runSyncHook=function(t){for(var e,r,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];try{for(var u=n(this.hooksSet),s=u.next();!s.done;s=u.next()){var l=s.value,f=l[t];"function"==typeof f&&f.apply(void 0,o(i))}}catch(h){e={error:h}}finally{try{s&&!s.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}},r}(),u=function(){function t(t,e){this.driver=t,this.option=e}return t.prototype.install=function(t){return this.factory(this.driver,t)},Object.defineProperty(t.prototype,"name",{get:function(){return"use"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultOption",{get:function(){return{namespacePrefix:"$"}},enumerable:!1,configurable:!0}),t.prototype.factory=function(t,e){var n=Object.assign({},this.defaultOption,this.option).namespacePrefix;return function(o,i){if(t.hasModule(o))return this;if(!o||"function"!=typeof o.install||"string"!=typeof o.name)return r.warn("To install the plugin, you need to define the `name` property and the `install` method."),this;var a=""+n+o.name,u=o.install.call(o,e,i);return this[""+a]?(r.warn("There is a duplicate plugin name. `"+o.name+"` plugin namespace will be override."),this[""+a]=u):void 0!==u&&(this[""+a]=u),t.addModule(o),this}},t}();export{i as ModuleContextImpl,a as ModuleDriverImpl,u as UseModule};

@@ -14,4 +14,4 @@ export declare type SyncHookFunc<T extends readonly unknown[] = readonly unknown[]> = (...args: T) => void;

export declare type ModuleNamespace<T> = T;
export interface LiffModule<T = unknown, U = unknown> {
install(context: ModuleContext, options?: U): ModuleNamespace<T>;
export interface LiffModule<T = unknown, U = unknown, Liff = unknown> {
install(context: ModuleContext<Liff>, options?: U): ModuleNamespace<T>;
readonly name: string;

@@ -26,4 +26,5 @@ }

}
export interface ModuleContext {
export interface ModuleContext<Liff = unknown> {
addHooks<T extends Hooks = Hooks>(hooks: T): void;
liff: Liff;
}

@@ -9,7 +9,7 @@ import { ModuleDriver, ModuleContext, LiffModule } from './types';

};
export declare class UseModule implements LiffModule<Use> {
export declare class UseModule<Liff> implements LiffModule<Use> {
private driver;
private option?;
constructor(driver: ModuleDriver, option?: Option | undefined);
install(context: ModuleContext): Use;
install(context: ModuleContext<Liff>): Use;
get name(): string;

@@ -16,0 +16,0 @@ private get defaultOption();

{
"name": "@liff/use",
"version": "2.15.0",
"version": "2.16.0",
"description": "@liff/use",

@@ -31,3 +31,3 @@ "license": "SEE LICENSE IN README.md",

"dependencies": {
"@liff/logger": "2.15.0"
"@liff/logger": "2.16.0"
},

@@ -37,3 +37,3 @@ "peerDependencies": {

},
"gitHead": "5fa5082f1dc61f3f8e09c642cf0313e9fb91c9a4"
"gitHead": "0b742399b677d7857a5c898eb794dd00c8d7889c"
}
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