Socket
Socket
Sign inDemoInstall

@adobe/aem-spa-component-mapping

Package Overview
Dependencies
Maintainers
52
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/aem-spa-component-mapping - npm Package Compare versions

Comparing version 1.0.8 to 1.1.0

7

CHANGELOG.md

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

# [1.1.0](https://github.com/adobe/aem-spa-component-mapping/compare/v1.0.8...v1.1.0) (2021-01-08)
### Features
* Support for LazyLoading using promises ([228b65b](https://github.com/adobe/aem-spa-component-mapping/commit/228b65b1ef770c0fb8f19975a93f8f58a08be1ca))
## [1.0.8](https://github.com/adobe/aem-spa-component-mapping/compare/v1.0.7...v1.0.8) (2021-01-05)

@@ -2,0 +9,0 @@

2

dist/aem-spa-component-mapping.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.aemSpaComponentMapping=t():e.aemSpaComponentMapping=t()}(function(){try{return"undefined"!=typeof self}catch(e){return!1}}()?self:this,(function(){return(()=>{"use strict";var e={238:(e,t,n)=>{let o;n.r(t),n.d(t,{ComponentMapping:()=>r,MapTo:()=>p});class r{constructor(){return o||(o=this),o}static get instance(){return new this}map(e,t){r.map(e,t)}static map(e,t){e&&t&&("string"==typeof e?[e]:e).forEach((e=>{this.mapping[e]=t}))}get(e){return r.get(e)}static get(e){return this.mapping[e]}}r.mapping={};const p=e=>t=>r.instance.map(e,t)}},t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(238)})()}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.aemSpaComponentMapping=e():t.aemSpaComponentMapping=e()}(function(){try{return"undefined"!=typeof self}catch(t){return!1}}()?self:this,(function(){return(()=>{"use strict";var t={238:(t,e,n)=>{let r;n.r(e),n.d(e,{ComponentMapping:()=>o,MapTo:()=>p});class o{constructor(){return r||(r=this),r}static get instance(){return new this}map(t,e){o.map(t,e)}static map(t,e){t&&e&&("string"==typeof t?[t]:t).forEach((t=>{this.mapping[t]=e}))}lazyMap(t,e){o.lazyMap(t,e)}static lazyMap(t,e){t&&e&&("string"==typeof t?[t]:t).forEach((t=>{this.lazyMapping[t]=e}))}get(t){return o.get(t)}static get(t){return this.mapping[t]}getLazy(t){return o.getLazy(t)}static getLazy(t){return this.lazyMapping[t]?this.lazyMapping[t]():Promise.reject("resourceType "+t+" not found in mappings!")}}o.mapping={},o.lazyMapping={};const p=t=>e=>o.instance.map(t,e)}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}return n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(238)})()}));

@@ -9,2 +9,10 @@ /**

/**
* LazyComponentMappingObject interface.
* @private
*/
interface LazyComponentMappingObject {
[key: string]: lazyMapFunction;
}
export declare type lazyMapFunction = () => Promise<unknown>;
/**
* ComponentMapping singleton. It manages the mapping between AEM component resource types and corresponding

@@ -16,2 +24,3 @@ * JavaScript component class.

static mapping: ComponentMappingObject;
static lazyMapping: LazyComponentMappingObject;
static get instance(): ComponentMappingImpl;

@@ -33,2 +42,4 @@ constructor();

static map(resourceTypes: string | string[], clazz: unknown): void;
lazyMap(resourceTypes: string | string[], clazz: lazyMapFunction): void;
static lazyMap(resourceTypes: string | string[], clazz: lazyMapFunction): void;
/**

@@ -39,3 +50,3 @@ * Returns object (or `undefined`) matching with given resource type.

*/
get(resourceType: string): any;
get(resourceType: string): unknown;
/**

@@ -46,3 +57,11 @@ * Returns object (or `undefined`) matching with given resource type.

*/
static get(resourceType: string): any;
static get(resourceType: string): unknown;
/**
* Returns object (or undefined) matching with given resource type.
*
* @param {string} resourceType - resource type
* @returns {object|undefined} - class associated with given resource type
*/
getLazy(resourceType: string): Promise<unknown>;
static getLazy(resourceType: string): Promise<unknown>;
}

@@ -67,3 +86,22 @@ /**

declare const MapTo: (resourceTypes: string | string[]) => (clazz: unknown) => void;
export { ComponentMappingImpl as ComponentMapping, MapTo };
/**
* Use to register resource types to Class mapping in a lazyLoad fashion, with dynamic imports
*
* Example:
* ```
* import { LazyMapTo } from '@adobe/aem-spa-component-mapping';
*
* MyComponent.ts:
* export class MyComponent {
* ...
* }
*
* LazyMapTo('my/resource/type')(MyComponent);
* ```
*
* @param resourceTypes AEM resource type(s).
* @returns Function mapping a class with the given resource types.
*/
declare const LazyMapTo: (resourceTypes: string | string[]) => (lazyPromise: lazyMapFunction) => void;
export { ComponentMappingImpl as ComponentMapping, MapTo, LazyMapTo };
//# sourceMappingURL=ComponentMapping.d.ts.map
{
"name": "@adobe/aem-spa-component-mapping",
"version": "1.0.8",
"version": "1.1.0",
"description": "Provides a mapping of SPA front-end components to AEM resource types.",

@@ -5,0 +5,0 @@ "keywords": [

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