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

@wildebeest/component

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wildebeest/component - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

3

dist/ComponentBindService.d.ts

@@ -14,3 +14,4 @@ import { ComponentBinder } from "./ComponentBinder";

}): void;
bindToElement(element: HTMLElement): Map<string, Array<Component>>;
autoBind(element: HTMLElement): Map<string, Array<Component>>;
bindToElement(element: any, component: Component): void;
}

@@ -17,3 +17,3 @@ "use strict";

};
ComponentBindService.prototype.bindToElement = function (element) {
ComponentBindService.prototype.autoBind = function (element) {
var result = new Map();

@@ -31,2 +31,8 @@ for (var key in this.binders) {

};
ComponentBindService.prototype.bindToElement = function (element, component) {
if (!element.wbComponents) {
element.wbComponents = [];
}
element.wbComponents.push(component);
};
ComponentBindService = __decorate([

@@ -33,0 +39,0 @@ inversify_1.injectable()

{
"name": "@wildebeest/component",
"version": "0.1.3",
"version": "0.2.0",
"description": "Components",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -15,3 +15,3 @@ import { injectable } from "inversify";

public bindToElement(element: HTMLElement): Map<string, Array<Component>>
public autoBind(element: HTMLElement): Map<string, Array<Component>>
{

@@ -30,2 +30,10 @@ let result: Map<string, Array<Component>> = new Map();

}
public bindToElement(element: any, component: Component): void
{
if (!element.wbComponents) {
element.wbComponents = [];
}
element.wbComponents.push(component);
}
}

@@ -53,3 +53,3 @@ import 'ts-jest';

test("binding HTML element to component", () => {
test("auto binding", () => {
componentBindService.addBinder('test', {

@@ -62,6 +62,20 @@ selector: '.test',

domService.insert([element], document.body);
let components: Map<string, Array<Component>> = bindService.bindToElement(document.body);
let components: Map<string, Array<Component>> = bindService.autoBind(document.body);
expect(components.get('test')).toBeDefined();
expect(components.get('test').length).toEqual(1);
});
test("binding HTML element to component", () => {
componentBindService.addBinder('test', {
selector: '.test',
binder: new TestComponentBinder(emitterService)
});
let element: any = domService.create('<div class="test"></div>');
let component: Component = new TestComponent(element, emitterService.createEmitter());
bindService.bindToElement(element, component);
expect(element.wbComponents).toBeDefined();
expect(element.wbComponents.length).toEqual(1);
});

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