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

@devexperts/utils

Package Overview
Dependencies
Maintainers
3
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devexperts/utils - npm Package Compare versions

Comparing version 0.7.2 to 0.8.0-0

31

lib/bem/bem.js

@@ -5,2 +5,3 @@ "use strict";

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

@@ -83,10 +84,7 @@ /**

return [];
}
else if (isArrayModifiers(modifiers)) {
} else if (isArrayModifiers(modifiers)) {
return normalizeArrayModifiers(modifiers);
}
else if (isKeyModifiers(modifiers)) {
} else if (isKeyModifiers(modifiers)) {
return normalizeKeyModifiers(modifiers);
}
else {
} else {
throw new Error(exports.ERROR_MODIFIERS_VALIDATION);

@@ -101,3 +99,5 @@ }

function normalizeKeyModifiers(modifiers) {
return Object.keys(modifiers).filter(function (key) { return !!modifiers[key]; });
return Object.keys(modifiers).filter(function (key) {
return !!modifiers[key];
});
}

@@ -113,10 +113,7 @@ /**

return acc.concat(modifier);
}
else if (isKeyModifiers(modifier)) {
} else if (isKeyModifiers(modifier)) {
return acc.concat(normalizeKeyModifiers(modifier));
}
else if (isArrayModifiers(modifier)) {
} else if (isArrayModifiers(modifier)) {
return acc.concat(normalizeArrayModifiers(modifier));
}
else {
} else {
throw new Error(exports.ERROR_MODIFIERS_VALIDATION);

@@ -167,8 +164,6 @@ }

return element(blockName, elementOrBlockModifiers, elementModifiers);
}
else if (isKeyModifiers(elementOrBlockModifiers) || isArrayModifiers(elementOrBlockModifiers)) {
} else if (isKeyModifiers(elementOrBlockModifiers) || isArrayModifiers(elementOrBlockModifiers)) {
//block-modifiers
return block(blockName, elementOrBlockModifiers);
}
else if (!elementOrBlockModifiers) {
} else if (!elementOrBlockModifiers) {
return blockName; //block

@@ -205,2 +200,2 @@ }

}
exports.BEM = BEM;
exports.BEM = BEM;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -16,7 +17,11 @@ var tslib_1 = require("tslib");

*/
var Collection = /** @class */ (function (_super) {
var Collection = /** @class */function (_super) {
tslib_1.__extends(Collection, _super);
function Collection(items, options) {
if (items === void 0) { items = []; }
if (options === void 0) { options = {}; }
if (items === void 0) {
items = [];
}
if (options === void 0) {
options = {};
}
var _this = _super.call(this) || this;

@@ -51,3 +56,5 @@ _this._options = tslib_1.__assign({}, options);

Collection.prototype.clone = function (options) {
if (options === void 0) { options = {}; }
if (options === void 0) {
options = {};
}
return new Collection(this._items.slice(), Object.assign({}, this._options, options));

@@ -91,7 +98,8 @@ };

//do not pass callback directly to not give access to items arrays as 3rd argument
var item = this._items.find(function (element, index) { return callback(element, index); });
var item = this._items.find(function (element, index) {
return callback(element, index);
});
if (typeof item !== 'undefined') {
return item;
}
else {
} else {
throw new Error(exports.ERROR_NOT_FOUND);

@@ -105,3 +113,5 @@ }

//do not pass callback directly to not give access to items arrays as 3rd argument
return this._items.filter(function (element, index) { return callback(element, index); });
return this._items.filter(function (element, index) {
return callback(element, index);
});
};

@@ -113,3 +123,5 @@ /**

//do not pass callback directly to not give access to items arrays as 3rd argument
this._items.forEach(function (element, index) { return callback(element, index); });
this._items.forEach(function (element, index) {
return callback(element, index);
});
};

@@ -121,3 +133,5 @@ /**

//do not pass callback directly to not give access to items arrays as 3rd argument
return this._items.map(function (element, index) { return callback(element, index); });
return this._items.map(function (element, index) {
return callback(element, index);
});
};

@@ -129,3 +143,5 @@ /**

//do not pass callback directly to not give access to items arrays as 3rd argument
return this._items.reduce(function (acc, element, index) { return callback(acc, element, index); }, initial);
return this._items.reduce(function (acc, element, index) {
return callback(acc, element, index);
}, initial);
};

@@ -136,3 +152,5 @@ /**

Collection.prototype.some = function (callback) {
return this._items.some(function (element, index) { return callback(element, index); });
return this._items.some(function (element, index) {
return callback(element, index);
});
};

@@ -143,3 +161,5 @@ /**

Collection.prototype.every = function (callback) {
return this._items.every(function (element, index) { return callback(element, index); });
return this._items.every(function (element, index) {
return callback(element, index);
});
};

@@ -162,4 +182,4 @@ /**

return Collection;
}(Emitter_1.default));
}(Emitter_1.default);
exports.Collection = Collection;
exports.default = Collection;
exports.default = Collection;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -9,4 +10,8 @@ var string_1 = require("../string/string");

var rect = element.getBoundingClientRect();
var top = rect.top, left = rect.left, right = rect.right, bottom = rect.bottom;
var width = rect.width, height = rect.height;
var top = rect.top,
left = rect.left,
right = rect.right,
bottom = rect.bottom;
var width = rect.width,
height = rect.height;
width = width || element.offsetWidth;

@@ -77,7 +82,5 @@ height = height || element.offsetHeight;

return context.contains(node);
}
else if (context.compareDocumentPosition) {
} else if (context.compareDocumentPosition) {
return context === node || !!(context.compareDocumentPosition(node) & 16); //tslint:disable-line no-bitwise
}
else {
} else {
return fallback(context, node);

@@ -96,5 +99,5 @@ }

}
} while ((current = current.parentNode)); //tslint:disable-line no-conditional-assignment
} while (current = current.parentNode); //tslint:disable-line no-conditional-assignment
}
return false;
}
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./dom"), exports);
tslib_1.__exportStar(require("./prefix"), exports);
tslib_1.__exportStar(require("./prefix"), exports);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var string_1 = require("../string/string");
var properties = [
'alignContent',
'alignItems',
'alignSelf',
'animation',
'animationDelay',
'animationDirection',
'animationDuration',
'animationFillMode',
'animationIterationCount',
'animationName',
'animationPlayState',
'animationTimingFunction',
'appearance',
'aspectRatio',
'backfaceVisibility',
'backgroundClip',
'borderImage',
'borderImageSlice',
'boxShadow',
'columnCount',
'columnFill',
'columnGap',
'columnRule',
'columnRuleColor',
'columnRuleStyle',
'columnRuleWidth',
'columnSpan',
'columnWidth',
'columns',
'flex',
'flexBasis',
'flexDirection',
'flexFlow',
'flexGrow',
'flexShrink',
'flexWrap',
'fontFeatureSettings',
'fontKearning',
'fontVariantLigatures',
'justifyContent',
'grid',
'gridArea',
'gridAutoColumns',
'gridAutoFlow',
'gridAutoRows',
'gridColumn',
'gridColumnEnd',
'gridColumnStart',
'gridRow',
'gridRowEnd',
'gridRowStart',
'gridTemplate',
'gridTemplateAreas',
'gridTemplateColumns',
'gridTemplateRows',
'hyphens',
'lineBreak',
'perspective',
'perspectiveOrigin',
'perspectiveOriginX',
'perspectiveOriginY',
'rubyPosition',
'scrollSnapCoordinate',
'scrollSnapDestination',
'scrollSnapPoints',
'scrollSnapPointsX',
'scrollSnapPointsY',
'scrollSnapType',
'tabSize',
'textDecoration',
'textDecorationColor',
'textDecorationLine',
'textDecorationStyle',
'textOrientation',
'textSizeAdjust',
'transform',
'transition',
'transformOrigin',
'transformOriginX',
'transformOriginY',
'transformOriginZ',
'transformStyle',
'transitionProperty',
'transitionDuration',
'transitionTimingFunction',
'transitionDelay',
'userModify',
'userSelect'
];
var properties = ['alignContent', 'alignItems', 'alignSelf', 'animation', 'animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction', 'appearance', 'aspectRatio', 'backfaceVisibility', 'backgroundClip', 'borderImage', 'borderImageSlice', 'boxShadow', 'columnCount', 'columnFill', 'columnGap', 'columnRule', 'columnRuleColor', 'columnRuleStyle', 'columnRuleWidth', 'columnSpan', 'columnWidth', 'columns', 'flex', 'flexBasis', 'flexDirection', 'flexFlow', 'flexGrow', 'flexShrink', 'flexWrap', 'fontFeatureSettings', 'fontKearning', 'fontVariantLigatures', 'justifyContent', 'grid', 'gridArea', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridColumn', 'gridColumnEnd', 'gridColumnStart', 'gridRow', 'gridRowEnd', 'gridRowStart', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows', 'hyphens', 'lineBreak', 'perspective', 'perspectiveOrigin', 'perspectiveOriginX', 'perspectiveOriginY', 'rubyPosition', 'scrollSnapCoordinate', 'scrollSnapDestination', 'scrollSnapPoints', 'scrollSnapPointsX', 'scrollSnapPointsY', 'scrollSnapType', 'tabSize', 'textDecoration', 'textDecorationColor', 'textDecorationLine', 'textDecorationStyle', 'textOrientation', 'textSizeAdjust', 'transform', 'transition', 'transformOrigin', 'transformOriginX', 'transformOriginY', 'transformOriginZ', 'transformStyle', 'transitionProperty', 'transitionDuration', 'transitionTimingFunction', 'transitionDelay', 'userModify', 'userSelect'];
/**

@@ -112,2 +24,2 @@ * Prefixes vendor keys

}
exports.default = prefix;
exports.default = prefix;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

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

*/
var Emitter = /** @class */ (function () {
var Emitter = /** @class */function () {
function Emitter() {

@@ -17,4 +18,3 @@ this._events = {};

this._events[event].push(handler);
}
else {
} else {
this._events[event] = [handler];

@@ -35,4 +35,3 @@ }

delete this._events[event];
}
else {
} else {
handlers.splice(index, 1);

@@ -42,4 +41,3 @@ }

}
}
else {
} else {
delete this._events[event];

@@ -58,7 +56,9 @@ }

if (this._events[event]) {
this._events[event].forEach(function (handler) { return handler.apply(_this, args); });
this._events[event].forEach(function (handler) {
return handler.apply(_this, args);
});
}
};
return Emitter;
}());
exports.default = Emitter;
}();
exports.default = Emitter;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

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

*/
function TFSAction() {
}
function TFSAction() {}
exports.TFSAction = TFSAction;

@@ -21,2 +21,2 @@ /**

*/
TFSAction.prototype.error = null;
TFSAction.prototype.error = null;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -9,4 +10,8 @@ /**

function debounce(func, wait, immediate) {
if (wait === void 0) { wait = 0; }
if (immediate === void 0) { immediate = false; }
if (wait === void 0) {
wait = 0;
}
if (immediate === void 0) {
immediate = false;
}
var timeout;

@@ -21,4 +26,3 @@ var args;

timeout = setTimeout(later, wait - last);
}
else {
} else {
timeout = null;

@@ -53,4 +57,8 @@ if (!immediate) {

function DEBOUNCE(wait, immediate) {
if (wait === void 0) { wait = 0; }
if (immediate === void 0) { immediate = false; }
if (wait === void 0) {
wait = 0;
}
if (immediate === void 0) {
immediate = false;
}
return function (target, prop, descriptor) {

@@ -63,12 +71,9 @@ if (descriptor) {

};
}
else if (descriptor.get) {
} else if (descriptor.get) {
descriptor.get = debounce(descriptor.get, wait, immediate);
}
else if (descriptor.value) {
} else if (descriptor.value) {
descriptor.value = debounce(descriptor.value, wait, immediate);
}
return descriptor;
}
else {
} else {
throw new Error('Property decorators are not implemented yet!');

@@ -78,2 +83,2 @@ }

}
exports.DEBOUNCE = DEBOUNCE;
exports.DEBOUNCE = DEBOUNCE;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -23,2 +24,2 @@ function DISPOSABLE(target) {

}
exports.DISPOSABLE = DISPOSABLE;
exports.DISPOSABLE = DISPOSABLE;

@@ -5,2 +5,3 @@ "use strict";

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

@@ -19,2 +20,2 @@ var tslib_1 = require("tslib");

exports.DISPOSABLE = disposable_1.DISPOSABLE;
tslib_1.__exportStar(require("./identity"), exports);
tslib_1.__exportStar(require("./identity"), exports);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -6,2 +7,2 @@ function identity(arg) {

}
exports.default = identity;
exports.default = identity;

@@ -8,6 +8,18 @@ /**

*/
export declare function memoize<A>(this: any, fn: () => A): () => A;
export declare function memoize<A, B>(this: any, fn: (a: A) => B): (a: A) => B;
export declare function memoize<A, B, C>(this: any, fn: (a: A, b: B) => C): (a: A, b: B) => C;
export declare function memoize<A, B, C, D>(this: any, fn: (a: A, b: B, c: C) => D): (a: A, b: B, c: C) => D;
export declare function memoize<A>(this: any, fn: () => A): {
(): A;
[key: string]: () => A;
};
export declare function memoize<A, B>(this: any, fn: (a: A) => B): {
(a: A): B;
[key: string]: (a: A) => B;
};
export declare function memoize<A, B, C>(this: any, fn: (a: A, b: B) => C): {
(a: A, b: B): C;
[key: string]: (a: A, b: B) => C;
};
export declare function memoize<A, B, C, D>(this: any, fn: (a: A, b: B, c: C) => D): {
(a: A, b: B, c: C): D;
[key: string]: (a: A, b: B, c: C) => D;
};
export default memoize;

@@ -14,0 +26,0 @@ /**

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

@@ -41,7 +42,5 @@ /**

};
}
else if (descriptor.get) {
} else if (descriptor.get) {
descriptor.get = memoize(descriptor.get);
}
else if (descriptor.value) {
} else if (descriptor.value) {
descriptor.value = memoize(descriptor.value);

@@ -64,2 +63,2 @@ }

return JSON.stringify(args);
}
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.raf = function (cb) {
var id;
var invoke = function (ctx, args) { return function () {
id = undefined;
cb.apply(ctx, args);
}; };
var invoke = function (ctx, args) {
return function () {
id = undefined;
cb.apply(ctx, args);
};
};
//use function to save original context

@@ -25,2 +28,2 @@ function synced() {

return synced;
};
};

@@ -7,2 +7,3 @@ "use strict";

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

@@ -16,4 +17,8 @@ /**

function throttle(func, wait, options) {
if (wait === void 0) { wait = 0; }
if (options === void 0) { options = {}; }
if (wait === void 0) {
wait = 0;
}
if (options === void 0) {
options = {};
}
var context;

@@ -50,4 +55,3 @@ var args;

}
}
else if (!timeout && options.trailing !== false) {
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);

@@ -63,4 +67,8 @@ }

function THROTTLE(wait, options) {
if (wait === void 0) { wait = 0; }
if (options === void 0) { options = {}; }
if (wait === void 0) {
wait = 0;
}
if (options === void 0) {
options = {};
}
return function (target, prop, descriptor) {

@@ -73,12 +81,9 @@ if (descriptor) {

};
}
else if (descriptor.get) {
} else if (descriptor.get) {
descriptor.get = throttle(descriptor.get, wait, options);
}
else if (descriptor.value) {
} else if (descriptor.value) {
descriptor.value = throttle(descriptor.value, wait, options);
}
return descriptor;
}
else {
} else {
throw new Error('Property decorators are not implemented yet!');

@@ -88,2 +93,2 @@ }

}
exports.THROTTLE = THROTTLE;
exports.THROTTLE = THROTTLE;

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

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

@@ -29,5 +30,4 @@ exports.hasOwnProperty = Object.prototype.hasOwnProperty;

// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / (x) === 1 / (y);
}
else {
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN

@@ -50,4 +50,3 @@ return x !== x && y !== y;

}
if (typeof objA !== 'object' || objA === null ||
typeof objB !== 'object' || objB === null) {
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;

@@ -63,4 +62,3 @@ }

for (var i = 0; i < keysA.length; i++) {
if (!exports.hasOwnProperty.call(objB, keysA[i]) ||
!is(objA[keysA[i]], objB[keysA[i]])) {
if (!exports.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;

@@ -71,2 +69,2 @@ }

}
exports.shallowEqual = shallowEqual;
exports.shallowEqual = shallowEqual;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./fb"), exports);
tslib_1.__exportStar(require("./object"), exports);
tslib_1.__exportStar(require("./object"), exports);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -27,4 +28,3 @@ var fb_1 = require("./fb");

}
if (typeof objA !== 'object' || objA === null ||
typeof objB !== 'object' || objB === null) {
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;

@@ -39,4 +39,3 @@ }

for (var i = 0, len = keysA.length; i < len; i++) {
if (!fb_2.hasOwnProperty.call(objB, keysA[i]) ||
!deepEqual(objA[keysA[i]], objB[keysA[i]])) {
if (!fb_2.hasOwnProperty.call(objB, keysA[i]) || !deepEqual(objA[keysA[i]], objB[keysA[i]])) {
return false;

@@ -47,2 +46,2 @@ }

}
exports.deepEqual = deepEqual;
exports.deepEqual = deepEqual;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -24,3 +25,3 @@ var tslib_1 = require("tslib");

*/
var Session = /** @class */ (function (_super) {
var Session = /** @class */function (_super) {
tslib_1.__extends(Session, _super);

@@ -43,5 +44,3 @@ function Session() {

}
}
catch (e) {
}
} catch (e) {}
if (value && value.receiver_sid === id) {

@@ -55,5 +54,5 @@ _this._emit(exports.E_SESSION.REQUEST, value.messageType, value.payload);

window.addEventListener('storage', _this._onStorage);
_this['_using']([
function () { return window.removeEventListener('storage', _this._onStorage); }
]);
_this['_using']([function () {
return window.removeEventListener('storage', _this._onStorage);
}]);
}

@@ -89,9 +88,6 @@ return _this;

};
Session = tslib_1.__decorate([
disposable_1.DISPOSABLE,
tslib_1.__metadata("design:paramtypes", [])
], Session);
Session = tslib_1.__decorate([disposable_1.DISPOSABLE, tslib_1.__metadata("design:paramtypes", [])], Session);
return Session;
}(Emitter_1.default));
}(Emitter_1.default);
exports.Session = Session;
exports.default = new Session();
exports.default = new Session();
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./string"), exports);
tslib_1.__exportStar(require("./split"), exports);
tslib_1.__exportStar(require("./split"), exports);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

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

function split(string, substring, caseSensitive) {
if (caseSensitive === void 0) { caseSensitive = true; }
if (caseSensitive === void 0) {
caseSensitive = true;
}
if (!substring && substring !== '0') {

@@ -18,2 +21,2 @@ return [string];

exports.split = split;
exports.default = split;
exports.default = split;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

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

function dasherize(string, lower) {
if (lower === void 0) { lower = true; }
if (lower === void 0) {
lower = true;
}
var dasherized = string.replace(/([a-z])(?=[A-Z])/g, '$1-');
if (lower) {
return dasherized.toLowerCase();
}
else {
} else {
return dasherized;

@@ -22,3 +24,5 @@ }

function camelize(string, lower) {
if (lower === void 0) { lower = true; }
if (lower === void 0) {
lower = true;
}
//camelize

@@ -31,4 +35,3 @@ var camelized = string.replace(/[-_\s]+(.)?/g, function (match, c) {

return decapitalize(camelized);
}
else {
} else {
return capitalize(camelized);

@@ -43,4 +46,8 @@ }

function randomId(prefix, postfix) {
if (prefix === void 0) { prefix = ''; }
if (postfix === void 0) { postfix = ''; }
if (prefix === void 0) {
prefix = '';
}
if (postfix === void 0) {
postfix = '';
}
var id = ++uniqueIdCounter;

@@ -72,7 +79,5 @@ return "" + prefix + id + postfix;

return declensions[2];
}
else if (floored % 10 < 5) {
} else if (floored % 10 < 5) {
return declensions[cases[floored % 10]];
}
else {
} else {
return declensions[cases[5]];

@@ -92,4 +97,3 @@ }

return declensions[0];
}
else {
} else {
return declensions[1];

@@ -104,5 +108,7 @@ }

function uuid() {
var chr4 = function () { return Math.random().toString(16).slice(-4); };
var chr4 = function () {
return Math.random().toString(16).slice(-4);
};
return chr4() + chr4() + "-" + chr4() + "-" + chr4() + "-" + chr4() + "-" + (chr4() + chr4() + chr4());
}
exports.uuid = uuid;
exports.uuid = uuid;
{
"name": "@devexperts/utils",
"version": "0.7.2",
"version": "0.8.0-0",
"description": "",

@@ -8,7 +8,7 @@ "main": "lib/index.js",

"test": "echo \"Error: no test specified\" && exit 1",
"build": "dx-tools build-ts-transform",
"clean": "dx-tools clean",
"build": "dx-tools build-lib src lib",
"clean": "dx-tools clean lib",
"prepublish": "npm run clean && npm run build",
"start": "dx-tools watch-ts-transform",
"watch": "dx-tools watch-ts-transform"
"start": "npm run watch",
"watch": "dx-tools build-lib src lib -w"
},

@@ -37,4 +37,4 @@ "repository": {

"devDependencies": {
"@devexperts/tools": "^0.7.2"
"@devexperts/tools": "^0.8.0-0"
}
}
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