angular-immutable
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "angular-immutable", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"main": "./dist/immutable.js", | ||
@@ -19,4 +19,6 @@ "homepage": "https://github.com/mgechev/angular-immutable", | ||
"test", | ||
"tests" | ||
"tests", | ||
"demo", | ||
"lib" | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
(function () { | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.angularImmutable = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -6,14 +6,12 @@ var immutableDirective = (function() { | ||
var scope = true; | ||
var restrict = 'A'; | ||
var link = (function(scope, el, attrs) { | ||
var immutable = attrs.immutable; | ||
if (!(/^[a-zA-Z0-9_$]+$/).test(immutable)) { | ||
return ; | ||
} | ||
if (!scope[immutable]) { | ||
if (!get(immutable, scope)) { | ||
console.warn(("No " + immutable + " property found.")); | ||
} | ||
scope.$watch((function() { | ||
return scope.$parent[immutable]; | ||
return get(immutable, scope.$parent); | ||
}), (function(val) { | ||
scope[immutable] = val.toJS(); | ||
scope.immutables = val.toJS(); | ||
})); | ||
@@ -24,7 +22,22 @@ }); | ||
scope: scope, | ||
restrict: restrict, | ||
link: link | ||
}; | ||
function get(path, obj) { | ||
var schema = obj; | ||
var pList = path.split('.'); | ||
var len = pList.length; | ||
for (var i = 0; i < len - 1; i++) { | ||
var elem = pList[i]; | ||
if (!schema[elem]) | ||
schema[elem] = {}; | ||
schema = schema[elem]; | ||
} | ||
return schema[pList[len - 1]]; | ||
} | ||
}); | ||
angular.module('immutable', []).directive('immutable', immutableDirective); | ||
module.exports = angular.module('immutable', []).directive('immutable', immutableDirective).name; | ||
}()); | ||
//# sourceURL=/Users/soocheng/Documents/angular-immutable/lib/immutable.js | ||
},{}]},{},[1])(1) | ||
}); |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";var t=function(){var t=2e3,n=!0,r=function(t,n,r){var e=r.immutable;/^[a-zA-Z0-9_$]+$/.test(e)&&(t[e]||console.warn("No "+e+" property found."),t.$watch(function(){return t.$parent[e]},function(n){t[e]=n.toJS()}))};return{priority:t,scope:n,link:r}};angular.module("immutable",[]).directive("immutable",t)}(); | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.angularImmutable=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";var immutableDirective=function(){var priority=2e3;var scope=true;var restrict="A";var link=function(scope,el,attrs){var immutable=attrs.immutable;if(!get(immutable,scope)){console.warn("No "+immutable+" property found.")}scope.$watch(function(){return get(immutable,scope.$parent)},function(val){scope.immutables=val.toJS()})};return{priority:priority,scope:scope,restrict:restrict,link:link};function get(path,obj){var schema=obj;var pList=path.split(".");var len=pList.length;for(var i=0;i<len-1;i++){var elem=pList[i];if(!schema[elem])schema[elem]={};schema=schema[elem]}return schema[pList[len-1]]}};module.exports=angular.module("immutable",[]).directive("immutable",immutableDirective).name},{}]},{},[1])(1)}); |
{ | ||
"name": "angular-immutable", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Immutable data structures in AngularJS", | ||
"main": "./dist/immutable.js", | ||
"scripts": { | ||
"browserify": "browserify -e ./lib/immutable.js -t es6ify -o ./dist/immutable.js -s angularImmutable", | ||
"build": "npm run browserify && uglifyjs ./dist/immutable.js -o ./dist/immutable.min.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -12,8 +14,6 @@ }, | ||
"devDependencies": { | ||
"gulp": "^3.8.11", | ||
"gulp-rename": "^1.2.0", | ||
"gulp-traceur": "^0.17.0", | ||
"gulp-uglify": "^1.1.0", | ||
"gulp-wrap": "^0.11.0" | ||
"browserify": "^10.2.0", | ||
"es6ify": "^1.6.0", | ||
"uglify-js": "^2.4.21" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
3
0
1
5395
5
65
4
5