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

@casl/angular

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@casl/angular - npm Package Compare versions

Comparing version 3.0.5 to 3.0.6

dist/types/can.metadata.json

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Change Log

## [3.0.6](https://github.com/stalniy/casl/compare/@casl/angular@3.0.5...@casl/angular@3.0.6) (2020-03-06)
### Bug Fixes
* **angular:** reverts back anngular to not use Ivy as it was not recommend by angular team ([b883118](https://github.com/stalniy/casl/commit/b8831184f4bbfc3924e95f1fd4f2861d88b43fdf)), closes [#270](https://github.com/stalniy/casl/issues/270)
## [3.0.5](https://github.com/stalniy/casl/compare/@casl/angular@3.0.4...@casl/angular@3.0.5) (2020-02-21)

@@ -7,0 +14,0 @@

61

dist/es5m/index.js

@@ -1,9 +0,11 @@

import { ɵɵdirectiveInject, ɵɵinjectPipeChangeDetectorRef, ɵɵdefinePipe, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope } from '@angular/core';
import { __decorate, __metadata } from 'tslib';
import { Pipe, ChangeDetectorRef, NgModule } from '@angular/core';
import { Ability } from '@casl/ability';
var noop = function noop() {}; // TODO: `pure` can be removed after https://github.com/angular/angular/issues/15041
var noop = function noop() {};
var ɵ0 = noop; // TODO: `pure` can be removed after https://github.com/angular/angular/issues/15041
var CanPipe =
/*#__PURE__*/
/** @class */
function () {

@@ -16,5 +18,3 @@ function CanPipe(ability, cd) {

var _proto = CanPipe.prototype;
_proto.transform = function transform(resource, action, field) {
CanPipe.prototype.transform = function (resource, action, field) {
var _this = this;

@@ -31,34 +31,31 @@

_proto.can = function can(action, subject, field) {
CanPipe.prototype.can = function (action, subject, field) {
return this.ability.can(action, subject, field);
};
_proto.ngOnDestroy = function ngOnDestroy() {
CanPipe.prototype.ngOnDestroy = function () {
this.unsubscribeFromAbility();
};
CanPipe = __decorate([Pipe({
name: 'can',
pure: false
}), __metadata("design:paramtypes", [Ability, ChangeDetectorRef])], CanPipe);
return CanPipe;
}();
CanPipe.ɵfac = function CanPipe_Factory(t) {
return new (t || CanPipe)(ɵɵdirectiveInject(Ability), ɵɵinjectPipeChangeDetectorRef());
};
CanPipe.ɵpipe = ɵɵdefinePipe({
name: "can",
type: CanPipe,
pure: false
});
function createAbility() {
return new Ability([]);
}
var AbilityModule =
/*#__PURE__*/
/** @class */
function () {
function AbilityModule() {}
AbilityModule.forRoot = function forRoot() {
AbilityModule_1 = AbilityModule;
AbilityModule.forRoot = function () {
return {
ngModule: AbilityModule,
ngModule: AbilityModule_1,
providers: [{

@@ -71,21 +68,11 @@ provide: Ability,

var AbilityModule_1;
AbilityModule = AbilityModule_1 = __decorate([NgModule({
declarations: [CanPipe],
exports: [CanPipe]
})], AbilityModule);
return AbilityModule;
}();
AbilityModule.ɵmod = ɵɵdefineNgModule({
type: AbilityModule
});
AbilityModule.ɵinj = ɵɵdefineInjector({
factory: function AbilityModule_Factory(t) {
return new (t || AbilityModule)();
}
});
(function () {
(typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(AbilityModule, {
declarations: [CanPipe],
exports: [CanPipe]
});
})();
export { AbilityModule, CanPipe, createAbility };
export { AbilityModule, CanPipe, createAbility, ɵ0 };
//# sourceMappingURL=index.js.map

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

import { ɵɵdirectiveInject, ɵɵinjectPipeChangeDetectorRef, ɵɵdefinePipe, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope } from '@angular/core';
import { __decorate, __metadata } from 'tslib';
import { Pipe, ChangeDetectorRef, NgModule } from '@angular/core';
import { Ability } from '@casl/ability';
const noop = () => {}; // TODO: `pure` can be removed after https://github.com/angular/angular/issues/15041
const noop = () => {};
const ɵ0 = noop; // TODO: `pure` can be removed after https://github.com/angular/angular/issues/15041
class CanPipe {
let CanPipe = class CanPipe {
constructor(ability, cd) {

@@ -30,21 +32,16 @@ this.ability = ability;

}
CanPipe.ɵfac = function CanPipe_Factory(t) {
return new (t || CanPipe)(ɵɵdirectiveInject(Ability), ɵɵinjectPipeChangeDetectorRef());
};
CanPipe.ɵpipe = ɵɵdefinePipe({
name: "can",
type: CanPipe,
CanPipe = __decorate([Pipe({
name: 'can',
pure: false
});
}), __metadata("design:paramtypes", [Ability, ChangeDetectorRef])], CanPipe);
var AbilityModule_1;
function createAbility() {
return new Ability([]);
}
class AbilityModule {
let AbilityModule = AbilityModule_1 = class AbilityModule {
static forRoot() {
return {
ngModule: AbilityModule,
ngModule: AbilityModule_1,
providers: [{

@@ -57,20 +54,9 @@ provide: Ability,

}
AbilityModule.ɵmod = ɵɵdefineNgModule({
type: AbilityModule
});
AbilityModule.ɵinj = ɵɵdefineInjector({
factory: function AbilityModule_Factory(t) {
return new (t || AbilityModule)();
}
});
};
AbilityModule = AbilityModule_1 = __decorate([NgModule({
declarations: [CanPipe],
exports: [CanPipe]
})], AbilityModule);
(function () {
(typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(AbilityModule, {
declarations: [CanPipe],
exports: [CanPipe]
});
})();
export { AbilityModule, CanPipe, createAbility };
export { AbilityModule, CanPipe, createAbility, ɵ0 };
//# sourceMappingURL=index.js.map

@@ -1,5 +0,4 @@

import { ChangeDetectorRef } from '@angular/core';
import { ChangeDetectorRef, PipeTransform } from '@angular/core';
import { Ability } from '@casl/ability';
import * as i0 from "@angular/core";
export declare class CanPipe {
export declare class CanPipe implements PipeTransform {
protected ability: Ability;

@@ -12,4 +11,2 @@ protected cd: ChangeDetectorRef;

ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDef<CanPipe>;
static ɵpipe: i0.ɵɵPipeDefWithMeta<CanPipe, "can">;
}
import { ModuleWithProviders } from '@angular/core';
import { Ability } from '@casl/ability';
import * as i0 from "@angular/core";
import * as i1 from "./can";
export declare function createAbility(): Ability;
export declare class AbilityModule {
static forRoot(): ModuleWithProviders<AbilityModule>;
static ɵmod: i0.ɵɵNgModuleDefWithMeta<AbilityModule, [typeof i1.CanPipe], never, [typeof i1.CanPipe]>;
static ɵinj: i0.ɵɵInjectorDef<AbilityModule>;
}

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

!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@angular/core"),require("@casl/ability")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@casl/ability"],i):i(((e=e||self).casl=e.casl||{},e.casl.ng={}),e.ng.core,e.casl)}(this,function(e,i,t){"use strict";function r(){}var n=function(){function e(e,i){this.ability=e,this.cd=i,this.unsubscribeFromAbility=r}var i=e.prototype;return i.transform=function(e,i,t){var n=this;return this.unsubscribeFromAbility===r&&(this.unsubscribeFromAbility=this.ability.on("updated",function(){return n.cd.markForCheck()})),this.can(i,e,t)},i.can=function(e,i,t){return this.ability.can(e,i,t)},i.ngOnDestroy=function(){this.unsubscribeFromAbility()},e}();function o(){return new t.Ability([])}n.ɵfac=function(e){return new(e||n)(i.ɵɵdirectiveInject(t.Ability),i.ɵɵinjectPipeChangeDetectorRef())},n.ɵpipe=i.ɵɵdefinePipe({name:"can",type:n,pure:!1});var c=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[{provide:t.Ability,useFactory:o}]}},e}();c.ɵmod=i.ɵɵdefineNgModule({type:c}),c.ɵinj=i.ɵɵdefineInjector({factory:function(e){return new(e||c)}}),"undefined"!=typeof ngJitMode&&!ngJitMode||i.ɵɵsetNgModuleScope(c,{declarations:[n],exports:[n]}),e.AbilityModule=c,e.CanPipe=n,e.createAbility=o,Object.defineProperty(e,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("tslib"),require("@angular/core"),require("@casl/ability")):"function"==typeof define&&define.amd?define(["exports","tslib","@angular/core","@casl/ability"],e):e(((t=t||self).casl=t.casl||{},t.casl.ng={}),t.tslib,t.ng.core,t.casl)}(this,function(t,e,i,r){"use strict";function n(){}var o=n,s=(a.prototype.transform=function(t,e,i){var r=this;return this.unsubscribeFromAbility===n&&(this.unsubscribeFromAbility=this.ability.on("updated",function(){return r.cd.markForCheck()})),this.can(e,t,i)},a.prototype.can=function(t,e,i){return this.ability.can(t,e,i)},a.prototype.ngOnDestroy=function(){this.unsubscribeFromAbility()},a=e.__decorate([i.Pipe({name:"can",pure:!1}),e.__metadata("design:paramtypes",[r.Ability,i.ChangeDetectorRef])],a));function a(t,e){this.ability=t,this.cd=e,this.unsubscribeFromAbility=n}function c(){return new r.Ability([])}var u,l=((u=b).forRoot=function(){return{ngModule:u,providers:[{provide:r.Ability,useFactory:c}]}},b=u=e.__decorate([i.NgModule({declarations:[s],exports:[s]})],b));function b(){}t.AbilityModule=l,t.CanPipe=s,t.createAbility=c,t.ɵ0=o,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=index.js.map
{
"name": "@casl/angular",
"version": "3.0.5",
"version": "3.0.6",
"description": "Angular module for CASL which makes it easy to add permissions in any Angular application",

@@ -17,5 +17,10 @@ "main": "dist/umd/index.js",

"scripts": {
"prebuild": "rm -rf dist/types/* && ngc",
"build": "rollup -c ../../tools/rollup.config.js -i dist/types/src/index.js -n casl.ng -g @angular/core:ng.core,@casl/ability:casl",
"postbuild": "mv dist/types/src/*.d.ts dist/types && rm -rf dist/types/src",
"prebuild": "rm -rf dist/*",
"build": "npm run build.types && npm run build.es5m && npm run build.es6 && npm run build.umd",
"build.es5m": "TARGET=es5 BUILD=es5m npm run rollup",
"build.es6": "TARGET=es2015 BUILD=es6 npm run rollup",
"build.umd": "TARGET=es5 BUILD=umd npm run rollup",
"build.types": "ngc -p tsconfig.types.json",
"rollup": "ngc --target $TARGET --outDir dist/$BUILD/tmp && BUILD_TYPES=$BUILD USE_SRC_MAPS=1 rollup -c ../../tools/rollup.config.js -i dist/$BUILD/tmp/index.js -n casl.ng -g @angular/core:ng.core,@casl/ability:casl,tslib:tslib",
"postrollup": "rm -rf dist/$BUILD/tmp",
"test": "NODE_ENV=test jest --config ../../tools/jest.config.js",

@@ -22,0 +27,0 @@ "lint": "node -p -e '`Skip linting for typescript`'",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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