Socket
Socket
Sign inDemoInstall

@gedit/utils

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gedit/utils - npm Package Compare versions

Comparing version 0.1.63 to 0.1.64

39

lib/browser/dom-utils.js

@@ -18,5 +18,10 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -28,11 +33,11 @@ Object.defineProperty(exports, "__esModule", { value: true });

var common_1 = require("../common");
var toStyleKey = function (key) { return key.replace(/([A-Z])/, function (k) { return "-" + k.toLowerCase(); }); };
var toStyleKey = function (key) { return key.replace(/([A-Z])/, function (k) { return "-".concat(k.toLowerCase()); }); };
var domUtils;
(function (domUtils) {
function toPixel(num) {
return num + "px";
return "".concat(num, "px");
}
domUtils.toPixel = toPixel;
function fromPixel(pixel) {
return parseInt(pixel.substring(0, top.length - 2));
return parseInt(pixel.substring(0, pixel.length - 2));
}

@@ -45,3 +50,3 @@ domUtils.fromPixel = fromPixel;

function toPercent(percent) {
return percent + "%";
return "".concat(percent, "%");
}

@@ -64,3 +69,3 @@ domUtils.toPercent = toPercent;

if (classNames.length > 0) {
element.className = clsx_1.default(classNames);
element.className = (0, clsx_1.default)(classNames);
}

@@ -76,3 +81,3 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

}
return createElement.apply(void 0, __spread(['div'], classNames));
return createElement.apply(void 0, __spreadArray(['div'], __read(classNames), false));
}

@@ -85,3 +90,3 @@ domUtils.createDivWithClass = createDivWithClass;

}
element.className = clsx_1.default(classNames.concat(element.className.split(' ')));
element.className = (0, clsx_1.default)(classNames.concat(element.className.split(' ')));
}

@@ -105,3 +110,3 @@ domUtils.addClass = addClass;

}
element.className = clsx_1.default(classNames);
element.className = (0, clsx_1.default)(classNames);
}

@@ -114,11 +119,11 @@ domUtils.coverClass = coverClass;

function translatePercent(node, x, y) {
node.style.transform = "translate(" + x + "%, " + y + "%)";
node.style.transform = "translate(".concat(x, "%, ").concat(y, "%)");
}
domUtils.translatePercent = translatePercent;
function translateXPercent(node, x) {
node.style.transform = "translateX(" + x + "%)";
node.style.transform = "translateX(".concat(x, "%)");
}
domUtils.translateXPercent = translateXPercent;
function translateYPercent(node, y) {
node.style.transform = "translateY(" + y + "%)";
node.style.transform = "translateY(".concat(y, "%)");
}

@@ -128,3 +133,3 @@ domUtils.translateYPercent = translateYPercent;

var styleStrs = [];
common_1.each(styles, function (value, key) {
(0, common_1.each)(styles, function (value, key) {
if (value === undefined)

@@ -135,3 +140,3 @@ return;

}
styleStrs.push(toStyleKey(key) + ":" + value);
styleStrs.push("".concat(toStyleKey(key), ":").concat(value));
});

@@ -146,3 +151,3 @@ var oldStyle = node.getAttribute('style');

function classNameWithPrefix(prefix) {
return function (key, opts) { return clsx_1.default(key.split(/\s+/).map(function (s) { return prefix + "-" + s; }).join(' '), opts); };
return function (key, opts) { return (0, clsx_1.default)(key.split(/\s+/).map(function (s) { return "".concat(prefix, "-").concat(s); }).join(' '), opts); };
}

@@ -149,0 +154,0 @@ domUtils.classNameWithPrefix = classNameWithPrefix;

@@ -110,6 +110,6 @@ "use strict";

Endpoint.prototype.getWebSocketUrl = function () {
return new uri_1.URI(this.wsScheme + "//" + this.host + this.pathname + this.path);
return new uri_1.URI("".concat(this.wsScheme, "//").concat(this.host).concat(this.pathname).concat(this.path));
};
Endpoint.prototype.getRestUrl = function () {
return new uri_1.URI(this.httpScheme + "//" + this.host + this.pathname + this.path);
return new uri_1.URI("".concat(this.httpScheme, "//").concat(this.host).concat(this.pathname).concat(this.path));
};

@@ -116,0 +116,0 @@ Endpoint.prototype.getSearchParam = function (name, defaultValue) {

@@ -10,3 +10,3 @@ "use strict";

var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};

@@ -13,0 +13,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -18,5 +18,10 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -43,3 +48,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

}
return a(b.apply(void 0, __spread(args)));
return a(b.apply(void 0, __spreadArray([], __read(args), false)));
}; });

@@ -46,0 +51,0 @@ }

@@ -33,5 +33,10 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -54,3 +59,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

try {
currentServices.push.apply(currentServices, __spread(currentContainer.getAll(this.serviceIdentifier)));
currentServices.push.apply(currentServices, __spreadArray([], __read(currentContainer.getAll(this.serviceIdentifier)), false));
}

@@ -57,0 +62,0 @@ catch (error) {

@@ -80,5 +80,10 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -187,3 +192,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

try {
ret.push(callback.apply(void 0, __spread(args)));
ret.push(callback.apply(void 0, __spreadArray([], __read(args), false)));
}

@@ -352,3 +357,3 @@ catch (e) {

// eslint-disable-next-line max-len
console.warn("Possible Emitter memory leak detected. " + listenerCount + " listeners added. Use event.maxListeners to increase the limit (" + maxListeners + "). MOST frequent listener (" + topCount_1 + "):");
console.warn("Possible Emitter memory leak detected. ".concat(listenerCount, " listeners added. Use event.maxListeners to increase the limit (").concat(maxListeners, "). MOST frequent listener (").concat(topCount_1, "):"));
console.warn(topStack_1);

@@ -355,0 +360,0 @@ }

@@ -25,7 +25,7 @@ "use strict";

emitter.event(function () { return counter++; });
chai_1.expect(counter).eq(0);
(0, chai_1.expect)(counter).eq(0);
emitter.fire(undefined);
chai_1.expect(counter).eq(1);
(0, chai_1.expect)(counter).eq(1);
});
});
//# sourceMappingURL=event.spec.js.map

@@ -10,3 +10,3 @@ "use strict";

var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};

@@ -13,0 +13,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -87,5 +87,7 @@ "use strict";

exports.isEmpty = isEmpty;
exports.each = function (obj, fn) { return keys(obj).forEach(function (key) { return fn(obj[key], key); }); };
exports.values = function (obj) { return Object.values ? Object.values(obj) : keys(obj).map(function (k) { return obj[k]; }); };
exports.filter = function (obj, fn, dest) {
var each = function (obj, fn) { return keys(obj).forEach(function (key) { return fn(obj[key], key); }); };
exports.each = each;
var values = function (obj) { return Object.values ? Object.values(obj) : keys(obj).map(function (k) { return obj[k]; }); };
exports.values = values;
var filter = function (obj, fn, dest) {
return keys(obj).reduce(function (output, key) {

@@ -96,16 +98,22 @@ var _a;

};
exports.pick = function (obj, fields, dest) { return exports.filter(obj, function (n, k) { return fields.indexOf(k) !== -1; }, dest); };
exports.omit = function (obj, fields, dest) { return exports.filter(obj, function (n, k) { return fields.indexOf(k) === -1; }, dest); };
exports.reduce = function (obj, fn, res) {
exports.filter = filter;
var pick = function (obj, fields, dest) { return (0, exports.filter)(obj, function (n, k) { return fields.indexOf(k) !== -1; }, dest); };
exports.pick = pick;
var omit = function (obj, fields, dest) { return (0, exports.filter)(obj, function (n, k) { return fields.indexOf(k) === -1; }, dest); };
exports.omit = omit;
var reduce = function (obj, fn, res) {
if (res === void 0) { res = {}; }
return keys(obj).reduce(function (r, k) { return fn(r, obj[k], k); }, res);
};
exports.mapValues = function (obj, fn) { return exports.reduce(obj, function (res, value, key) {
exports.reduce = reduce;
var mapValues = function (obj, fn) { return (0, exports.reduce)(obj, function (res, value, key) {
var _a;
return Object.assign(res, (_a = {}, _a[key] = fn(value, key), _a));
}); };
exports.mapKeys = function (obj, fn) { return exports.reduce(obj, function (res, value, key) {
exports.mapValues = mapValues;
var mapKeys = function (obj, fn) { return (0, exports.reduce)(obj, function (res, value, key) {
var _a;
return Object.assign(res, (_a = {}, _a[fn(value, key)] = value, _a));
}); };
exports.mapKeys = mapKeys;
/**

@@ -177,3 +185,4 @@ * @param target

exports.setByKey = setByKey;
exports.NOOP = function () { };
var NOOP = function () { };
exports.NOOP = NOOP;
//# sourceMappingURL=objects.js.map

@@ -33,5 +33,10 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -62,3 +67,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

exports.isWindows ? 'cmd' : command,
exports.isWindows ? __spread(['/c', command], args) : args
exports.isWindows ? __spreadArray(['/c', command], __read(args), false) : args
];

@@ -65,0 +70,0 @@ }

@@ -91,3 +91,3 @@ "use strict";

if (code >= 65 /* A */ && code <= 90 /* Z */) {
path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3
path = "/".concat(String.fromCharCode(code + 32), ":").concat(path.substr(3)); // "/c:".length === 3
}

@@ -98,3 +98,3 @@ }

if (code >= 65 /* A */ && code <= 90 /* Z */) {
path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3
path = "".concat(String.fromCharCode(code + 32), ":").concat(path.substr(2)); // "/c:".length === 3
}

@@ -101,0 +101,0 @@ }

@@ -142,3 +142,3 @@ "use strict";

var from = _a.from, to = _a.to, expectation = _a.expectation;
it("the relative path from '" + from + "' to '" + to + "' should be '" + expectation + "'", function () {
it("the relative path from '".concat(from, "' to '").concat(to, "' should be '").concat(expectation, "'"), function () {
var path = new path_1.Path(from).relative(new path_1.Path(to));

@@ -218,3 +218,3 @@ assert.deepEqual(expectation, path && path.toString());

var from = _a.from, expectation = _a.expectation;
it("path " + from + " should be normalized as " + expectation, function () {
it("path ".concat(from, " should be normalized as ").concat(expectation), function () {
assert.deepStrictEqual(new path_1.Path(from).normalize().toString(), expectation);

@@ -221,0 +221,0 @@ });

@@ -93,3 +93,3 @@ "use strict";

clearTimeout(handle);
deferred.reject(cancellation_1.cancelled());
deferred.reject((0, cancellation_1.cancelled)());
});

@@ -96,0 +96,0 @@ return deferred.promise;

@@ -58,3 +58,3 @@ "use strict";

intervalTime: 100,
retries: 3,
retries: 3, // 尝试三次
});

@@ -61,0 +61,0 @@ checkIfRetry = function (res) {

@@ -21,6 +21,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -94,5 +96,10 @@ function __() { this.constructor = d; }

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -147,6 +154,6 @@ Object.defineProperty(exports, "__esModule", { value: true });

AbstractReferenceCollection.prototype.keys = function () {
return __spread(this._keys.values());
return __spreadArray([], __read(this._keys.values()), false);
};
AbstractReferenceCollection.prototype.values = function () {
return __spread(this._values.values());
return __spreadArray([], __read(this._values.values()), false);
};

@@ -153,0 +160,0 @@ AbstractReferenceCollection.prototype.get = function (args) {

@@ -69,5 +69,10 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -85,3 +90,4 @@ Object.defineProperty(exports, "__esModule", { value: true });

references = new reference_1.ReferenceCollection(function (key) { return ({
key: key, dispose: function () {
key: key,
dispose: function () {
expectation.disposed = true;

@@ -114,3 +120,4 @@ }

references = new reference_1.ReferenceCollection(function (key) { return ({
key: key, dispose: function () {
key: key,
dispose: function () {
expectation.disposed = true;

@@ -150,3 +157,4 @@ }

references = new reference_1.ReferenceCollection(function (key) { return ({
key: key, dispose: function () {
key: key,
dispose: function () {
expectation.disposed = true;

@@ -182,3 +190,4 @@ }

references = new reference_1.ReferenceCollection(function (key) { return ({
key: key, dispose: function () {
key: key,
dispose: function () {
}

@@ -212,3 +221,4 @@ }); });

return [2 /*return*/, ({
key: key, dispose: function () {
key: key,
dispose: function () {
}

@@ -218,3 +228,3 @@ })];

}); });
return [4 /*yield*/, Promise.all(__spread(Array(10).keys()).map(function () { return references.acquire('a'); }))];
return [4 /*yield*/, Promise.all(__spreadArray([], __read(Array(10).keys()), false).map(function () { return references.acquire('a'); }))];
case 1:

@@ -236,3 +246,4 @@ result = _a.sent();

return [2 /*return*/, ({
key: key, dispose: function () {
key: key,
dispose: function () {
disposed = true;

@@ -239,0 +250,0 @@ }

@@ -10,3 +10,3 @@ "use strict";

var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};

@@ -13,0 +13,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -49,3 +49,3 @@ "use strict";

if (decoration.properties) {
return objects_1.mapValues(decoration.properties, function (v, k) {
return (0, objects_1.mapValues)(decoration.properties, function (v, k) {
var childKey = prefixKey + k;

@@ -52,0 +52,0 @@ if (mixinDefaults && mixinDefaults[childKey] !== undefined) {

@@ -33,5 +33,10 @@ "use strict";

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -48,3 +53,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

var x = Array.from(new Set(myFoo.bar.arr));
myArr.push.apply(myArr, __spread(x));
myArr.push.apply(myArr, __spreadArray([], __read(x), false));
}

@@ -51,0 +56,0 @@ });

@@ -251,3 +251,3 @@ "use strict";

return '';
return Object.keys(obj).map(function (key) { return key + "=" + (obj[key] || ''); }).join('&');
return Object.keys(obj).map(function (key) { return "".concat(key, "=").concat(obj[key] || ''); }).join('&');
}

@@ -254,0 +254,0 @@ URI.objectToQueryString = objectToQueryString;

@@ -131,3 +131,3 @@ "use strict";

MockLogger = __decorate([
inversify_1.injectable()
(0, inversify_1.injectable)()
], MockLogger);

@@ -134,0 +134,0 @@ return MockLogger;

{
"name": "@gedit/utils",
"version": "0.1.63",
"version": "0.1.64",
"license": "MIT",

@@ -31,3 +31,3 @@ "main": "lib/common/index",

},
"gitHead": "9b41f77f8ae3b6aa3bf567402f699b5faaff532b"
"gitHead": "db74e452a213a016b3be82938fe68df8fdde2e6b"
}

@@ -22,3 +22,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

export function fromPixel(pixel: string): number {
return parseInt(pixel.substring(0, top.length - 2));
return parseInt(pixel.substring(0, pixel.length - 2));
}

@@ -25,0 +25,0 @@

@@ -109,3 +109,3 @@ /********************************************************************************

const promises = curTasks.map(task => this.tryToExec<T>(task, checkIfRetry));
const result = await Promise.all(promises);
const result: T[] = await Promise.all(promises);
const nextTasks = tasks.slice(this.opts.intervalCount);

@@ -112,0 +112,0 @@ if (nextTasks.length === 0) return result;

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

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

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

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

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