@rxap/pipes 13.0.0-next.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/santization/lib/santization.pipe.mjs +1 -1
- package/esm2020/santization/lib/santization.service.mjs +5 -2
- package/fesm2015/rxap-pipes-santization.mjs +4 -1
- package/fesm2015/rxap-pipes-santization.mjs.map +1 -1
- package/fesm2020/rxap-pipes-santization.mjs +4 -1
- package/fesm2020/rxap-pipes-santization.mjs.map +1 -1
- package/package.json +3 -3
- package/santization/lib/santization.pipe.d.ts +1 -1
- package/santization/lib/santization.service.d.ts +1 -1
|
@@ -18,4 +18,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
18
18
|
name: 'santization',
|
|
19
19
|
}]
|
|
20
20
|
}], ctorParameters: function () { return [{ type: i1.SantizationService }]; } });
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FudGl6YXRpb24ucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvcGlwZXMvc2FudGl6YXRpb24vc3JjL2xpYi9zYW50aXphdGlvbi5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDO0FBRXBELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHVCQUF1QixDQUFDOzs7QUFLM0QsTUFBTSxPQUFPLGVBQWU7SUFDMUIsWUFBNkIsa0JBQXNDO1FBQXRDLHVCQUFrQixHQUFsQixrQkFBa0IsQ0FBb0I7SUFBRyxDQUFDO0lBRXZFLFNBQVMsQ0FDUCxLQUFvQixFQUNwQixPQUE0RCxLQUFLO1F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angular/core';
|
|
2
2
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import * as i1 from "@angular/platform-browser";
|
|
@@ -8,6 +8,9 @@ export class SantizationService {
|
|
|
8
8
|
this._sanitizer = _sanitizer;
|
|
9
9
|
}
|
|
10
10
|
transform(value, type = 'url') {
|
|
11
|
+
if (value === null) {
|
|
12
|
+
return this._sanitizer.sanitize(SecurityContext.NONE, value);
|
|
13
|
+
}
|
|
11
14
|
switch (type) {
|
|
12
15
|
case 'html':
|
|
13
16
|
return this._sanitizer.bypassSecurityTrustHtml(value);
|
|
@@ -34,4 +37,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
34
37
|
type: Inject,
|
|
35
38
|
args: [DomSanitizer]
|
|
36
39
|
}] }]; } });
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FudGl6YXRpb24uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvcGlwZXMvc2FudGl6YXRpb24vc3JjL2xpYi9zYW50aXphdGlvbi5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxNQUFNLEVBQ04sVUFBVSxFQUNWLGVBQWUsRUFDaEIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUNMLFlBQVksRUFFYixNQUFNLDJCQUEyQixDQUFDOzs7QUFFbkMsZ0NBQWdDO0FBSWhDLE1BQU0sT0FBTyxrQkFBa0I7SUFDN0IsWUFBMEMsVUFBd0I7UUFBeEIsZUFBVSxHQUFWLFVBQVUsQ0FBYztJQUFHLENBQUM7SUFFdEUsU0FBUyxDQUNQLEtBQW9CLEVBQ3BCLE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1ZSk7XG5cbiAgICAgIGNhc2UgJ3VybCc6XG4gICAgICAgIHJldHVybiB0aGlzLl9zYW5pdGl6ZXIuYnlwYXNzU2VjdXJpdHlUcnVzdFVybCh2YWx1ZSk7XG5cbiAgICAgIGNhc2UgJ3Jlc291cmNlVXJsJzpcbiAgICAgICAgcmV0dXJuIHRoaXMuX3Nhbml0aXplci5ieXBhc3NTZWN1cml0eVRydXN0UmVzb3VyY2VVcmwodmFsdWUpO1xuICAgIH1cblxuICAgIHRocm93IG5ldyBFcnJvcigndHlwZSBpcyBub3Qgc2V0Jyk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Inject, Pipe, NgModule } from '@angular/core';
|
|
2
|
+
import { SecurityContext, Injectable, Inject, Pipe, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/platform-browser';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
|
|
@@ -9,6 +9,9 @@ class SantizationService {
|
|
|
9
9
|
this._sanitizer = _sanitizer;
|
|
10
10
|
}
|
|
11
11
|
transform(value, type = 'url') {
|
|
12
|
+
if (value === null) {
|
|
13
|
+
return this._sanitizer.sanitize(SecurityContext.NONE, value);
|
|
14
|
+
}
|
|
12
15
|
switch (type) {
|
|
13
16
|
case 'html':
|
|
14
17
|
return this._sanitizer.bypassSecurityTrustHtml(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-pipes-santization.mjs","sources":["../../../../libs/pipes/santization/src/lib/santization.service.ts","../../../../libs/pipes/santization/src/lib/santization.pipe.ts","../../../../libs/pipes/santization/src/lib/santization.module.ts","../../../../libs/pipes/santization/src/rxap-pipes-santization.ts"],"sourcesContent":["import {\n Inject,\n Injectable\n} from '@angular/core';\nimport {\n DomSanitizer,\n SafeValue\n} from '@angular/platform-browser';\n\n// TODO : move to @rxap/services\n@Injectable({\n providedIn: 'root'\n})\nexport class SantizationService {\n constructor(@Inject(DomSanitizer) private _sanitizer: DomSanitizer) {}\n\n transform(\n value: string,\n type: 'html' | 'style' | 'script' | 'url' | 'resourceUrl' = 'url'\n ): SafeValue {\n switch (type) {\n case 'html':\n return this._sanitizer.bypassSecurityTrustHtml(value);\n\n case 'style':\n return this._sanitizer.bypassSecurityTrustStyle(value);\n\n case 'script':\n return this._sanitizer.bypassSecurityTrustScript(value);\n\n case 'url':\n return this._sanitizer.bypassSecurityTrustUrl(value);\n\n case 'resourceUrl':\n return this._sanitizer.bypassSecurityTrustResourceUrl(value);\n }\n\n throw new Error('type is not set');\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { SafeValue } from '@angular/platform-browser';\nimport { SantizationService } from './santization.service';\n\n@Pipe({\n name: 'santization',\n})\nexport class SantizationPipe implements PipeTransform {\n constructor(private readonly santizationService: SantizationService) {}\n\n transform(\n value: string,\n type: 'html' | 'style' | 'script' | 'url' | 'resourceUrl' = 'url'
|
|
1
|
+
{"version":3,"file":"rxap-pipes-santization.mjs","sources":["../../../../libs/pipes/santization/src/lib/santization.service.ts","../../../../libs/pipes/santization/src/lib/santization.pipe.ts","../../../../libs/pipes/santization/src/lib/santization.module.ts","../../../../libs/pipes/santization/src/rxap-pipes-santization.ts"],"sourcesContent":["import {\n Inject,\n Injectable,\n SecurityContext\n} from '@angular/core';\nimport {\n DomSanitizer,\n SafeValue\n} from '@angular/platform-browser';\n\n// TODO : move to @rxap/services\n@Injectable({\n providedIn: 'root'\n})\nexport class SantizationService {\n constructor(@Inject(DomSanitizer) private _sanitizer: DomSanitizer) {}\n\n transform(\n value: string | null,\n type: 'html' | 'style' | 'script' | 'url' | 'resourceUrl' = 'url'\n ): SafeValue | null {\n if (value === null) {\n return this._sanitizer.sanitize(SecurityContext.NONE, value);\n }\n switch (type) {\n case 'html':\n return this._sanitizer.bypassSecurityTrustHtml(value);\n\n case 'style':\n return this._sanitizer.bypassSecurityTrustStyle(value);\n\n case 'script':\n return this._sanitizer.bypassSecurityTrustScript(value);\n\n case 'url':\n return this._sanitizer.bypassSecurityTrustUrl(value);\n\n case 'resourceUrl':\n return this._sanitizer.bypassSecurityTrustResourceUrl(value);\n }\n\n throw new Error('type is not set');\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { SafeValue } from '@angular/platform-browser';\nimport { SantizationService } from './santization.service';\n\n@Pipe({\n name: 'santization',\n})\nexport class SantizationPipe implements PipeTransform {\n constructor(private readonly santizationService: SantizationService) {}\n\n transform(\n value: string | null,\n type: 'html' | 'style' | 'script' | 'url' | 'resourceUrl' = 'url'\n ): SafeValue | null {\n return this.santizationService.transform(value, type);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SantizationPipe } from './santization.pipe';\n\n@NgModule({\n declarations: [ SantizationPipe ],\n imports: [],\n exports: [ SantizationPipe ]\n})\nexport class SantizationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAUA;MAIa,kBAAkB;IAC7B,YAA0C,UAAwB;QAAxB,eAAU,GAAV,UAAU,CAAc;KAAI;IAEtE,SAAS,CACP,KAAoB,EACpB,OAA4D,KAAK;QAEjE,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SAC9D;QACD,QAAQ,IAAI;YACV,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;YAExD,KAAK,OAAO;gBACV,OAAO,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;YAEzD,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;YAE1D,KAAK,KAAK;gBACR,OAAO,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;YAEvD,KAAK,aAAa;gBAChB,OAAO,IAAI,CAAC,UAAU,CAAC,8BAA8B,CAAC,KAAK,CAAC,CAAC;SAChE;QAED,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;;+GA5BU,kBAAkB,kBACT,YAAY;mHADrB,kBAAkB,cAFjB,MAAM;2FAEP,kBAAkB;kBAH9B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;8BAEc,MAAM;+BAAC,YAAY;;;;MCRrB,eAAe;IAC1B,YAA6B,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;KAAI;IAEvE,SAAS,CACP,KAAoB,EACpB,OAA4D,KAAK;QAEjE,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KACvD;;4GARU,eAAe;0GAAf,eAAe;2FAAf,eAAe;kBAH3B,IAAI;mBAAC;oBACJ,IAAI,EAAE,aAAa;iBACpB;;;MCEY,iBAAiB;;8GAAjB,iBAAiB;+GAAjB,iBAAiB,iBAJZ,eAAe,aAEf,eAAe;+GAEpB,iBAAiB,YAHd,EAAE;2FAGL,iBAAiB;kBAL7B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAE,eAAe,CAAE;oBACjC,OAAO,EAAO,EAAE;oBAChB,OAAO,EAAO,CAAE,eAAe,CAAE;iBAClC;;;ACPD;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Inject, Pipe, NgModule } from '@angular/core';
|
|
2
|
+
import { SecurityContext, Injectable, Inject, Pipe, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/platform-browser';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
|
|
@@ -9,6 +9,9 @@ class SantizationService {
|
|
|
9
9
|
this._sanitizer = _sanitizer;
|
|
10
10
|
}
|
|
11
11
|
transform(value, type = 'url') {
|
|
12
|
+
if (value === null) {
|
|
13
|
+
return this._sanitizer.sanitize(SecurityContext.NONE, value);
|
|
14
|
+
}
|
|
12
15
|
switch (type) {
|
|
13
16
|
case 'html':
|
|
14
17
|
return this._sanitizer.bypassSecurityTrustHtml(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-pipes-santization.mjs","sources":["../../../../libs/pipes/santization/src/lib/santization.service.ts","../../../../libs/pipes/santization/src/lib/santization.pipe.ts","../../../../libs/pipes/santization/src/lib/santization.module.ts","../../../../libs/pipes/santization/src/rxap-pipes-santization.ts"],"sourcesContent":["import {\n Inject,\n Injectable\n} from '@angular/core';\nimport {\n DomSanitizer,\n SafeValue\n} from '@angular/platform-browser';\n\n// TODO : move to @rxap/services\n@Injectable({\n providedIn: 'root'\n})\nexport class SantizationService {\n constructor(@Inject(DomSanitizer) private _sanitizer: DomSanitizer) {}\n\n transform(\n value: string,\n type: 'html' | 'style' | 'script' | 'url' | 'resourceUrl' = 'url'\n ): SafeValue {\n switch (type) {\n case 'html':\n return this._sanitizer.bypassSecurityTrustHtml(value);\n\n case 'style':\n return this._sanitizer.bypassSecurityTrustStyle(value);\n\n case 'script':\n return this._sanitizer.bypassSecurityTrustScript(value);\n\n case 'url':\n return this._sanitizer.bypassSecurityTrustUrl(value);\n\n case 'resourceUrl':\n return this._sanitizer.bypassSecurityTrustResourceUrl(value);\n }\n\n throw new Error('type is not set');\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { SafeValue } from '@angular/platform-browser';\nimport { SantizationService } from './santization.service';\n\n@Pipe({\n name: 'santization',\n})\nexport class SantizationPipe implements PipeTransform {\n constructor(private readonly santizationService: SantizationService) {}\n\n transform(\n value: string,\n type: 'html' | 'style' | 'script' | 'url' | 'resourceUrl' = 'url'
|
|
1
|
+
{"version":3,"file":"rxap-pipes-santization.mjs","sources":["../../../../libs/pipes/santization/src/lib/santization.service.ts","../../../../libs/pipes/santization/src/lib/santization.pipe.ts","../../../../libs/pipes/santization/src/lib/santization.module.ts","../../../../libs/pipes/santization/src/rxap-pipes-santization.ts"],"sourcesContent":["import {\n Inject,\n Injectable,\n SecurityContext\n} from '@angular/core';\nimport {\n DomSanitizer,\n SafeValue\n} from '@angular/platform-browser';\n\n// TODO : move to @rxap/services\n@Injectable({\n providedIn: 'root'\n})\nexport class SantizationService {\n constructor(@Inject(DomSanitizer) private _sanitizer: DomSanitizer) {}\n\n transform(\n value: string | null,\n type: 'html' | 'style' | 'script' | 'url' | 'resourceUrl' = 'url'\n ): SafeValue | null {\n if (value === null) {\n return this._sanitizer.sanitize(SecurityContext.NONE, value);\n }\n switch (type) {\n case 'html':\n return this._sanitizer.bypassSecurityTrustHtml(value);\n\n case 'style':\n return this._sanitizer.bypassSecurityTrustStyle(value);\n\n case 'script':\n return this._sanitizer.bypassSecurityTrustScript(value);\n\n case 'url':\n return this._sanitizer.bypassSecurityTrustUrl(value);\n\n case 'resourceUrl':\n return this._sanitizer.bypassSecurityTrustResourceUrl(value);\n }\n\n throw new Error('type is not set');\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { SafeValue } from '@angular/platform-browser';\nimport { SantizationService } from './santization.service';\n\n@Pipe({\n name: 'santization',\n})\nexport class SantizationPipe implements PipeTransform {\n constructor(private readonly santizationService: SantizationService) {}\n\n transform(\n value: string | null,\n type: 'html' | 'style' | 'script' | 'url' | 'resourceUrl' = 'url'\n ): SafeValue | null {\n return this.santizationService.transform(value, type);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SantizationPipe } from './santization.pipe';\n\n@NgModule({\n declarations: [ SantizationPipe ],\n imports: [],\n exports: [ SantizationPipe ]\n})\nexport class SantizationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAUA;MAIa,kBAAkB;IAC7B,YAA0C,UAAwB;QAAxB,eAAU,GAAV,UAAU,CAAc;KA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aAEf,eAAe;+GAEpB,iBAAiB,YAHd,EAAE;2FAGL,iBAAiB;kBAL7B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAE,eAAe,CAAE;oBACjC,OAAO,EAAO,EAAE;oBAChB,OAAO,EAAO,CAAE,eAAe,CAAE;iBAClC;;;ACPD;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/pipes",
|
|
3
|
-
"version": "13.0.0
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Merzough Münker",
|
|
6
6
|
"homepage": "https://gitlab.com/rxap/packages/libs/pipes",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@angular/core": "^13.2.3",
|
|
22
22
|
"@angular/platform-browser": "^13.2.3",
|
|
23
23
|
"@angular/platform-browser-dynamic": "^13.2.3",
|
|
24
|
-
"@rxap/utilities": "^13.0.0
|
|
24
|
+
"@rxap/utilities": "^13.0.0",
|
|
25
25
|
"reflect-metadata": "^0.1.13",
|
|
26
26
|
"rxjs": "^6.5.5"
|
|
27
27
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"save": "dependencies"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@rxap/schematics-utilities": "^13.0.0-next.
|
|
44
|
+
"@rxap/schematics-utilities": "^13.0.0-next.1",
|
|
45
45
|
"tslib": "^2.3.1"
|
|
46
46
|
},
|
|
47
47
|
"module": "fesm2015/rxap-pipes.mjs",
|
|
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
export declare class SantizationPipe implements PipeTransform {
|
|
6
6
|
private readonly santizationService;
|
|
7
7
|
constructor(santizationService: SantizationService);
|
|
8
|
-
transform(value: string, type?: 'html' | 'style' | 'script' | 'url' | 'resourceUrl'): SafeValue;
|
|
8
|
+
transform(value: string | null, type?: 'html' | 'style' | 'script' | 'url' | 'resourceUrl'): SafeValue | null;
|
|
9
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<SantizationPipe, never>;
|
|
10
10
|
static ɵpipe: i0.ɵɵPipeDeclaration<SantizationPipe, "santization">;
|
|
11
11
|
}
|
|
@@ -3,7 +3,7 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export declare class SantizationService {
|
|
4
4
|
private _sanitizer;
|
|
5
5
|
constructor(_sanitizer: DomSanitizer);
|
|
6
|
-
transform(value: string, type?: 'html' | 'style' | 'script' | 'url' | 'resourceUrl'): SafeValue;
|
|
6
|
+
transform(value: string | null, type?: 'html' | 'style' | 'script' | 'url' | 'resourceUrl'): SafeValue | null;
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<SantizationService, never>;
|
|
8
8
|
static ɵprov: i0.ɵɵInjectableDeclaration<SantizationService>;
|
|
9
9
|
}
|