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

angular-es-utils

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-es-utils - npm Package Compare versions

Comparing version 1.0.11 to 1.1.0

.idea/dictionaries/Kuitos.xml

25

lib/animation/index.js

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

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**

@@ -7,10 +12,5 @@ * @author Kuitos

'use strict';
var ANIMATIONEND_EVENT = void 0,
TRANSITIONEND_EVENT = void 0;
Object.defineProperty(exports, '__esModule', {
value: true
});
var ANIMATIONEND_EVENT = undefined,
TRANSITIONEND_EVENT = undefined;
if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {

@@ -31,3 +31,3 @@ ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';

exports['default'] = {
exports.default = {

@@ -38,3 +38,2 @@ addClass: function addClass(element, className) {

element.classList.add(className);
EVENTS.forEach(function (event) {

@@ -50,12 +49,14 @@ element.addEventListener(event, function () {

});
element.classList.add(className);
},
removeClass: function removeClass(element, className, doneHook) {
element.classList.remove(className);
EVENTS.forEach(function (event) {
element.addEventListener(event, doneHook, false);
});
element.classList.remove(className);
}
};
module.exports = exports['default'];
};

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

/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-01-17
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Debounce = exports.Throttle = exports.Bind = exports.Inject = undefined;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _Inject = require('./Inject');

@@ -19,2 +12,25 @@

exports.Inject = _Inject2['default'];
var _Bind = require('./Bind');
var _Bind2 = _interopRequireDefault(_Bind);
var _Throttle = require('./Throttle');
var _Throttle2 = _interopRequireDefault(_Throttle);
var _Debounce = require('./Debounce');
var _Debounce2 = _interopRequireDefault(_Debounce);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-01-17
*/
exports.Inject = _Inject2.default;
exports.Bind = _Bind2.default;
exports.Throttle = _Throttle2.default;
exports.Debounce = _Debounce2.default;

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

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**

@@ -10,9 +18,4 @@ * @author Kuitos

*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = function () {
exports.default = function () {
for (var _len = arguments.length, dependencies = Array(_len), _key = 0; _key < _len; _key++) {

@@ -22,14 +25,27 @@ dependencies[_key] = arguments[_key];

return function (target, key, descriptor) {
return function (target, name, descriptor) {
// 修饰的如果是类的方法
if (descriptor) {
var fn = descriptor.value;
fn.$inject = dependencies;
} else {
target.$inject = dependencies;
throw new Error('can not use Inject decorator with a non-constructor!');
}
var Constructor = function Constructor() {
_classCallCheck(this, Constructor);
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
// 将依赖服务挂载在原始构造函数的prototype上(不是直接绑定到this上,节省空间)
args.forEach(function (arg, i) {
return target.prototype['_' + dependencies[i]] = arg;
});
// 使用原始构造函数实例化
return new (Function.prototype.bind.apply(target, [null].concat(args)))();
};
Constructor.$inject = dependencies;
return Constructor;
};
};
module.exports = exports["default"];
};

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

/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-03-02
*/
"use strict";

@@ -13,7 +7,13 @@

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Deferred = (function () {
/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-03-02
*/
var Deferred = function () {
function Deferred() {

@@ -43,5 +43,4 @@ var _this = this;

return Deferred;
})();
}();
exports["default"] = Deferred;
module.exports = exports["default"];
exports.default = Deferred;

@@ -1,19 +0,18 @@

/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2015-12-29
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _bind = Function.prototype.bind;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _default = (function () {
/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2015-12-29
*/
var _default = function () {
function _default() {

@@ -32,3 +31,3 @@ _classCallCheck(this, _default);

var instance = new (_bind.apply(Constructor, [null].concat(args)))();
var instance = new (Function.prototype.bind.apply(Constructor, [null].concat(args)))();

@@ -53,5 +52,4 @@ Object.getOwnPropertyNames(Constructor.prototype).forEach(function (prop) {

return _default;
})();
}();
exports['default'] = _default;
module.exports = exports['default'];
exports.default = _default;

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

/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-02-02
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Animation = exports.Deferred = exports.ModuleHelper = exports.FactoryCreator = exports.Inject = undefined;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _decorators = require('./decorators');

@@ -33,6 +26,12 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Inject = _decorators.Inject;
exports.FactoryCreator = _factoryCreator2['default'];
exports.ModuleHelper = _moduleHelper2['default'];
exports.Deferred = _deferred2['default'];
exports.Animation = _animation2['default'];
exports.FactoryCreator = _factoryCreator2.default;
exports.ModuleHelper = _moduleHelper2.default;
exports.Deferred = _deferred2.default;
exports.Animation = _animation2.default; /**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-02-02
*/

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

/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-02-17
*/
"use strict";

@@ -13,12 +7,18 @@

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _default = (function () {
function _default() {
_classCallCheck(this, _default);
/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-02-17
*/
var FieldsMapper = function () {
function FieldsMapper() {
_classCallCheck(this, FieldsMapper);
}
_createClass(_default, null, [{
_createClass(FieldsMapper, null, [{
key: "transform",

@@ -28,6 +28,5 @@ value: function transform(data, schema) {}

return _default;
})();
return FieldsMapper;
}();
exports["default"] = _default;
module.exports = exports["default"];
exports.default = FieldsMapper;

@@ -1,19 +0,14 @@

/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-01-17
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-01-17
*/
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _angular = require('angular');

@@ -23,3 +18,7 @@

var _default = (function () {
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _default = function () {
function _default() {

@@ -34,5 +33,5 @@ _classCallCheck(this, _default);

try {
return _angular2['default'].module(moduleName);
return _angular2.default.module(moduleName);
} catch (e) {
return _angular2['default'].module(moduleName, deps);
return _angular2.default.module(moduleName, deps);
}

@@ -43,5 +42,4 @@ }

return _default;
})();
}();
exports['default'] = _default;
module.exports = exports['default'];
exports.default = _default;
{
"name": "angular-es-utils",
"version": "1.0.11",
"version": "1.1.0",
"description": "es utils design for angular1.x",
"main": "./lib/index.js",
"scripts": {
"build": "rm -fr lib && NODE_ENV=production babel src --out-dir lib --ignore **/__tests__ && git add lib",
"codecheck": "NODE_EVN=test eslint src",
"start": "node server.js"
"build": "rm -fr lib && NODE_ENV=production babel src --out-dir lib --ignore **/__tests__ && git add lib",
"codecheck": "NODE_EVN=test eslint src",
"start": "node server.js",
"prepush": "npm test",
"test": "ava -v"
},
"author": "Kuitos<kuitos.lau@gmail.com>",
"ava": {
"files": [
"src/**/__tests__/*.js"
],
"require": [
"babel-register",
"./ava-test-helper.js"
],
"babel": "inherit"
},
"devDependencies": {
"assets-webpack-plugin": "^3.1.0",
"autoprefixer": "^6.0.3",
"babel-core": "^5.8.33",
"babel-eslint": "^4.1.3",
"babel-loader": "^5.3.3",
"clean-webpack-plugin": "^0.1.4",
"css-loader": "^0.21.0",
"eslint": "^1.8.0",
"eslint-friendly-formatter": "^1.2.2",
"eslint-loader": "^1.1.0",
"eslint-plugin-standard": "^1.3.1",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"html-loader": "^0.4.0",
"husky": "^0.10.1",
"image-min": "^0.3.2",
"image-webpack-loader": "^1.6.2",
"json-mock-kuitos": "^1.0.3",
"node-sass": "^3.4.1",
"postcss-loader": "^0.7.0",
"sass-loader": "^3.1.1",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
"webpack": "^1.12.2",
"webpack-dev-middleware": "^1.2.0",
"webpack-hot-middleware": "^2.4.1"
"angular": "^1.5.3",
"angular-mock": "^1.0.0",
"angular-mocks": "^1.5.3",
"assets-webpack-plugin": "^3.1.0",
"autoprefixer": "^6.3.6",
"ava": "^0.14.0",
"babel-core": "^6.7.4",
"babel-eslint": "^4.1.3",
"babel-loader": "^6.2.4",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"clean-webpack-plugin": "^0.1.4",
"css-loader": "^0.21.0",
"esdoc": "^0.4.6",
"esdoc-es7-plugin": "0.0.3",
"eslint": "^1.8.0",
"eslint-friendly-formatter": "^1.2.2",
"eslint-loader": "^1.1.0",
"eslint-plugin-standard": "^1.3.1",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"html-loader": "^0.4.0",
"husky": "^0.10.1",
"image-webpack-loader": "^1.6.3",
"jsdom": "^8.3.1",
"json-mock-kuitos": "^1.0.3",
"node-dir": "^0.1.11",
"node-sass": "^3.4.1",
"postcss-loader": "^0.7.0",
"resolve-url-loader": "^1.4.3",
"sass-loader": "^3.1.1",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
"webpack": "^1.12.2",
"webpack-dev-middleware": "^1.2.0",
"webpack-hot-middleware": "^2.4.1"
},
"dependencies": {
"angular": "^1.5.0"
"angular": "^1.5.0"
}
}

@@ -27,3 +27,2 @@ /**

addClass: (element, className, doneHook = noop, autoRemove = false) => {
element.classList.add(className);
EVENTS.forEach(event => {

@@ -39,11 +38,14 @@ element.addEventListener(event, () => {

});
element.classList.add(className);
},
removeClass: (element, className, doneHook) => {
element.classList.remove(className);
EVENTS.forEach(event => {
element.addEventListener(event, doneHook, false);
});
element.classList.remove(className);
}
};

@@ -8,5 +8,11 @@ /**

import Inject from './Inject';
import Bind from './Bind';
import Throttle from './Throttle';
import Debounce from './Debounce';
export {
Inject
Inject,
Bind,
Throttle,
Debounce
};

@@ -10,12 +10,20 @@ /**

*/
export default (...dependencies) => (target, key, descriptor) => {
export default (...dependencies) => (target, name, descriptor) => {
// 修饰的如果是类的方法
if (descriptor) {
const fn = descriptor.value;
fn.$inject = dependencies;
} else {
target.$inject = dependencies;
throw new Error('can not use Inject decorator with a non-constructor!');
}
class Constructor {
constructor(...args) {
// 将依赖服务挂载在原始构造函数的prototype上(不是直接绑定到this上,节省空间)
args.forEach((arg, i) => target.prototype[`_${dependencies[i]}`] = arg);
// 使用原始构造函数实例化
return new target(...args);
}
}
Constructor.$inject = dependencies;
return Constructor;
};

@@ -7,3 +7,3 @@ /**

import {Inject} from './decorators';
import { Inject } from './decorators';
import FactoryCreator from './factory-creator';

@@ -10,0 +10,0 @@ import ModuleHelper from './module-helper';

@@ -7,9 +7,8 @@ /**

export default class {
export default class FieldsMapper {
static transform(data, schema) {
}
}

@@ -48,3 +48,3 @@ /**

{
test: /\.js?$/,
test: /\.js$/,
loaders: ['babel'],

@@ -51,0 +51,0 @@ exclude: /(node_modules|bower_components)/,

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

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