@stencil/angular-output-target
Advanced tools
Comparing version 0.7.2-dev.11691686917.1045ccb9 to 0.8.0
@@ -73,3 +73,2 @@ import { createComponentEventTypeImports, dashToPascalCase, formatToQuotedList } from './utils'; | ||
const formatOutputType = (componentClassName, event) => { | ||
const prefix = `I${componentClassName}`; | ||
/** | ||
@@ -83,20 +82,7 @@ * The original attribute contains the original type defined by the devs. | ||
.reduce((type, [src, dst]) => { | ||
let renamedType = type; | ||
if (!type.startsWith(prefix)) { | ||
renamedType = `I${componentClassName}${type}`; | ||
} | ||
const renamedType = `I${componentClassName}${type}`; | ||
return (renamedType | ||
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`) | ||
// Capture all instances of the `src` field surrounded by non-word characters on each side and join them. | ||
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => { | ||
if ((dst === null || dst === void 0 ? void 0 : dst.location) === 'import') { | ||
/** | ||
* Replaces a complex type reference within a generic type. | ||
* For example, remapping a type like `EventEmitter<CustomEvent<MyEvent<T>>>` to | ||
* `EventEmitter<CustomEvent<IMyComponentMyEvent<IMyComponentT>>`. | ||
*/ | ||
return [p1, `I${componentClassName}${v.substring(1, v.length - 1)}`, p2].join(''); | ||
} | ||
return [p1, dst, p2].join(''); | ||
})); | ||
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => [p1, dst, p2].join(''))); | ||
}, event.complexType.original | ||
@@ -103,0 +89,0 @@ .replace(/\n/g, ' ') |
@@ -218,3 +218,2 @@ 'use strict'; | ||
const formatOutputType = (componentClassName, event) => { | ||
const prefix = `I${componentClassName}`; | ||
/** | ||
@@ -228,20 +227,7 @@ * The original attribute contains the original type defined by the devs. | ||
.reduce((type, [src, dst]) => { | ||
let renamedType = type; | ||
if (!type.startsWith(prefix)) { | ||
renamedType = `I${componentClassName}${type}`; | ||
} | ||
const renamedType = `I${componentClassName}${type}`; | ||
return (renamedType | ||
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`) | ||
// Capture all instances of the `src` field surrounded by non-word characters on each side and join them. | ||
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => { | ||
if ((dst === null || dst === void 0 ? void 0 : dst.location) === 'import') { | ||
/** | ||
* Replaces a complex type reference within a generic type. | ||
* For example, remapping a type like `EventEmitter<CustomEvent<MyEvent<T>>>` to | ||
* `EventEmitter<CustomEvent<IMyComponentMyEvent<IMyComponentT>>`. | ||
*/ | ||
return [p1, `I${componentClassName}${v.substring(1, v.length - 1)}`, p2].join(''); | ||
} | ||
return [p1, dst, p2].join(''); | ||
})); | ||
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => [p1, dst, p2].join(''))); | ||
}, event.complexType.original | ||
@@ -248,0 +234,0 @@ .replace(/\n/g, ' ') |
@@ -210,3 +210,2 @@ import path from 'path'; | ||
const formatOutputType = (componentClassName, event) => { | ||
const prefix = `I${componentClassName}`; | ||
/** | ||
@@ -220,20 +219,7 @@ * The original attribute contains the original type defined by the devs. | ||
.reduce((type, [src, dst]) => { | ||
let renamedType = type; | ||
if (!type.startsWith(prefix)) { | ||
renamedType = `I${componentClassName}${type}`; | ||
} | ||
const renamedType = `I${componentClassName}${type}`; | ||
return (renamedType | ||
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`) | ||
// Capture all instances of the `src` field surrounded by non-word characters on each side and join them. | ||
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => { | ||
if ((dst === null || dst === void 0 ? void 0 : dst.location) === 'import') { | ||
/** | ||
* Replaces a complex type reference within a generic type. | ||
* For example, remapping a type like `EventEmitter<CustomEvent<MyEvent<T>>>` to | ||
* `EventEmitter<CustomEvent<IMyComponentMyEvent<IMyComponentT>>`. | ||
*/ | ||
return [p1, `I${componentClassName}${v.substring(1, v.length - 1)}`, p2].join(''); | ||
} | ||
return [p1, dst, p2].join(''); | ||
})); | ||
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => [p1, dst, p2].join(''))); | ||
}, event.complexType.original | ||
@@ -240,0 +226,0 @@ .replace(/\n/g, ' ') |
{ | ||
"name": "@stencil/angular-output-target", | ||
"version": "0.7.2-dev.11691686917.1045ccb9", | ||
"version": "0.8.0", | ||
"description": "Angular output target for @stencil/core components.", | ||
@@ -61,3 +61,3 @@ "main": "dist/index.cjs.js", | ||
}, | ||
"gitHead": "045ccb908869f12cc45c6f67fb99d1dcf5e23427", | ||
"gitHead": "a3588e905186a0e86e7f88418fd5b2f9531b55e0", | ||
"volta": { | ||
@@ -64,0 +64,0 @@ "extends": "../../package.json" |
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
100107
1943