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

mapscreenr

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapscreenr - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

docs/assets/css/main.css

333

lib/MapScreenr.d.ts

@@ -1,246 +0,109 @@

declare namespace MapScreenr {
import { IMapScreenr, IMapScreenrSettings, IVariableFunctions, IVariables } from "./IMapScreenr";
/**
* A flexible container for map attributes and viewport.
*/
export declare class MapScreenr implements IMapScreenr {
/**
* Functions to compute new variable values, keyed by their variable's names.
* A listing of variable Functions to be calculated on screen resets.
*/
interface IVariableFunctions {
[i: string]: Function;
}
variableFunctions: IVariableFunctions;
/**
* Known variables, keyed by name.
* Arguments to be passed into variable computation Functions.
*/
interface IVariables {
[i: string]: any;
}
variableArgs: any[];
/**
* Settings to initialize a new instance of the MapScreenr class.
* Top border measurement of the bounding box.
*/
interface IMapScreenrSettings {
/**
* How wide the MapScreenr should be.
*/
width: number;
/**
* How tall the MapScreenr should be.
*/
height: number;
/**
* A mapping of functions to generate member variables that should be
* recomputed on screen change, keyed by variable name.
*/
variableFunctions?: IVariableFunctions;
/**
* Arguments to be passed to variable Functions.
*/
variableArgs?: any[];
/**
* Assorted known variables, keyed by name.
*/
variables?: IVariables;
/**
* A scope to run functions in, if not this IMapScreenr.
*/
scope?: any;
}
top: number;
/**
* A flexible container for map attributes and viewport.
* Right border measurement of the bounding box.
*/
interface IMapScreenr {
/**
* Top border measurement of the bounding box.
*/
top: number;
/**
* Right border measurement of the bounding box.
*/
right: number;
/**
* Bottom border measurement of the bounding box.
*/
bottom: number;
/**
* Left border measurement of the bounding box.
*/
left: number;
/**
* Constant horizontal midpoint of the bounding box, equal to (left + right) / 2.
*/
middleX: number;
/**
* Constant vertical midpoint of the bounding box, equal to (top + bottom) / 2.
*/
middleY: number;
/**
* Constant width of the bounding box.
*/
width: number;
/**
* Constant height of the bounding box.
*/
height: number;
/**
* A listing of variable Functions to be calculated on screen resets.
*/
variableFunctions: IVariableFunctions;
/**
* Arguments to be passed into variable computation Functions.
*/
variableArgs: any[];
/**
* Known variables, keyed by name.
*/
variables: IVariables;
/**
* Completely clears the MapScreenr for use in a new Area. Positioning is
* reset to (0,0) and user-configured variables are recalculated.
*/
clearScreen(): void;
/**
* Computes middleX as the midpoint between left and right.
*/
setMiddleX(): void;
/**
* Computes middleY as the midpoint between top and bottom.
*/
setMiddleY(): void;
/**
* Recalculates all variables by passing variableArgs to their Functions.
*/
setVariables(): void;
/**
* Recalculates a variable by passing variableArgs to its Function.
*
* @param name The name of the variable to recalculate.
* @param value A new value for the variable instead of its Function's result.
* @returns The new value of the variable.
*/
setVariable(name: string, value?: any): any;
/**
* Shifts the MapScreenr horizontally and vertically via shiftX and shiftY.
*
* @param dx How far to scroll horizontally.
* @param dy How far to scroll vertically.
*/
shift(dx: number, dy: number): void;
/**
* Shifts the MapScreenr horizontally by changing left and right by the dx.
*
* @param dx How far to scroll horizontally.
*/
shiftX(dx: number): void;
/**
* Shifts the MapScreenr vertically by changing top and bottom by the dy.
*
* @param dy How far to scroll vertically.
*/
shiftY(dy: number): void;
}
right: number;
/**
* A flexible container for map attributes and viewport.
* Bottom border measurement of the bounding box.
*/
class MapScreenr implements IMapScreenr {
/**
* A listing of variable Functions to be calculated on screen resets.
*/
variableFunctions: IVariableFunctions;
/**
* Arguments to be passed into variable computation Functions.
*/
variableArgs: any[];
/**
* Top border measurement of the bounding box.
*/
top: number;
/**
* Right border measurement of the bounding box.
*/
right: number;
/**
* Bottom border measurement of the bounding box.
*/
bottom: number;
/**
* Left border measurement of the bounding box.
*/
left: number;
/**
* Constant horizontal midpoint of the bounding box, equal to (left + right) / 2.
*/
middleX: number;
/**
* Constant vertical midpoint of the bounding box, equal to (top + bottom) / 2.
*/
middleY: number;
/**
* Constant width of the bounding box.
*/
width: number;
/**
* Constant height of the bounding box.
*/
height: number;
/**
* Assorted known variables, keyed by name.
*/
variables: IVariables;
/**
* A scope to run functions in, if not this MapScreenr.
*/
private scope;
/**
* Resets the MapScreenr. All members of the settings argument are copied
* to the MapScreenr itself, though only width and height are required.
*
* @param {IMapScreenrSettings} settings
*/
constructor(settings: IMapScreenrSettings);
/**
* Completely clears the MapScreenr for use in a new Area. Positioning is
* reset to (0,0) and user-configured variables are recalculated.
*/
clearScreen(): void;
/**
* Computes middleX as the midpoint between left and right.
*/
setMiddleX(): void;
/**
* Computes middleY as the midpoint between top and bottom.
*/
setMiddleY(): void;
/**
* Recalculates all variables by passing variableArgs to their Functions.
*/
setVariables(): void;
/**
* Recalculates a variable by passing variableArgs to its Function.
*
* @param name The name of the variable to recalculate.
* @param value A new value for the variable instead of its Function's result.
* @returns The new value of the variable.
*/
setVariable(name: string, value?: any): any;
/**
* Shifts the MapScreenr horizontally and vertically via shiftX and shiftY.
*
* @param dx How far to scroll horizontally.
* @param dy How far to scroll vertically.
*/
shift(dx: number, dy: number): void;
/**
* Shifts the MapScreenr horizontally by changing left and right by the dx.
*
* @param dx How far to scroll horizontally.
*/
shiftX(dx: number): void;
/**
* Shifts the MapScreenr vertically by changing top and bottom by the dy.
*
* @param dy How far to scroll vertically.
*/
shiftY(dy: number): void;
/**
* Known variables, keyed by name.
*/
[i: string]: any;
}
bottom: number;
/**
* Left border measurement of the bounding box.
*/
left: number;
/**
* Constant horizontal midpoint of the bounding box, equal to (left + right) / 2.
*/
middleX: number;
/**
* Constant vertical midpoint of the bounding box, equal to (top + bottom) / 2.
*/
middleY: number;
/**
* Constant width of the bounding box.
*/
width: number;
/**
* Constant height of the bounding box.
*/
height: number;
/**
* Assorted known variables, keyed by name.
*/
variables: IVariables;
/**
* A scope to run functions in, if not this MapScreenr.
*/
private scope;
/**
* Resets the MapScreenr. All members of the settings argument are copied
* to the MapScreenr itself, though only width and height are required.
*
* @param {IMapScreenrSettings} settings
*/
constructor(settings: IMapScreenrSettings);
/**
* Completely clears the MapScreenr for use in a new Area. Positioning is
* reset to (0,0) and user-configured variables are recalculated.
*/
clearScreen(): void;
/**
* Computes middleX as the midpoint between left and right.
*/
setMiddleX(): void;
/**
* Computes middleY as the midpoint between top and bottom.
*/
setMiddleY(): void;
/**
* Recalculates all variables by passing variableArgs to their Functions.
*/
setVariables(): void;
/**
* Recalculates a variable by passing variableArgs to its Function.
*
* @param name The name of the variable to recalculate.
* @param value A new value for the variable instead of its Function's result.
* @returns The new value of the variable.
*/
setVariable(name: string, value?: any): any;
/**
* Shifts the MapScreenr horizontally and vertically via shiftX and shiftY.
*
* @param dx How far to scroll horizontally.
* @param dy How far to scroll vertically.
*/
shift(dx: number, dy: number): void;
/**
* Shifts the MapScreenr horizontally by changing left and right by the dx.
*
* @param dx How far to scroll horizontally.
*/
shiftX(dx: number): void;
/**
* Shifts the MapScreenr vertically by changing top and bottom by the dy.
*
* @param dy How far to scroll vertically.
*/
shiftY(dy: number): void;
/**
* Known variables, keyed by name.
*/
[i: string]: any;
}
declare var module: any;

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

var MapScreenr;
(function (MapScreenr_1) {
/**
* A flexible container for map attributes and viewport.
*/
var MapScreenr = (function () {
/**
* Resets the MapScreenr. All members of the settings argument are copied
* to the MapScreenr itself, though only width and height are required.
*
* @param {IMapScreenrSettings} settings
*/
function MapScreenr(settings) {
/**
* Assorted known variables, keyed by name.
*/
this.variables = {};
if (typeof settings === "undefined") {
throw new Error("No settings object given to MapScreenr.");
}
if (typeof settings.width === "undefined") {
throw new Error("No width given to MapScreenr.");
}
if (typeof settings.height === "undefined") {
throw new Error("No height given to MapScreenr.");
}
if (settings.variables) {
for (var name_1 in settings.variables) {
if (settings.variables.hasOwnProperty(name_1)) {
this.variables[name_1] = settings.variables[name_1];
}
}
}
this.height = settings.height;
this.width = settings.width;
this.scope = settings.scope || this;
this.variableFunctions = settings.variableFunctions || {};
this.variableArgs = settings.variableArgs || [];
}
/**
* Completely clears the MapScreenr for use in a new Area. Positioning is
* reset to (0,0) and user-configured variables are recalculated.
*/
MapScreenr.prototype.clearScreen = function () {
this.left = 0;
this.top = 0;
this.right = this.width;
this.bottom = this.height;
this.setMiddleX();
this.setMiddleY();
this.setVariables();
};
/**
* Computes middleX as the midpoint between left and right.
*/
MapScreenr.prototype.setMiddleX = function () {
this.middleX = (this.left + this.right) / 2;
};
/**
* Computes middleY as the midpoint between top and bottom.
*/
MapScreenr.prototype.setMiddleY = function () {
this.middleY = (this.top + this.bottom) / 2;
};
/**
* Recalculates all variables by passing variableArgs to their Functions.
*/
MapScreenr.prototype.setVariables = function () {
for (var i in this.variableFunctions) {
if (this.variableFunctions.hasOwnProperty(i)) {
this.setVariable(i);
}
}
};
/**
* Recalculates a variable by passing variableArgs to its Function.
*
* @param name The name of the variable to recalculate.
* @param value A new value for the variable instead of its Function's result.
* @returns The new value of the variable.
*/
MapScreenr.prototype.setVariable = function (name, value) {
this.variables[name] = arguments.length === 1
? this.variableFunctions[name].apply(this.scope, this.variableArgs)
: value;
};
/**
* Shifts the MapScreenr horizontally and vertically via shiftX and shiftY.
*
* @param dx How far to scroll horizontally.
* @param dy How far to scroll vertically.
*/
MapScreenr.prototype.shift = function (dx, dy) {
if (dx) {
this.shiftX(dx);
}
if (dy) {
this.shiftY(dy);
}
};
/**
* Shifts the MapScreenr horizontally by changing left and right by the dx.
*
* @param dx How far to scroll horizontally.
*/
MapScreenr.prototype.shiftX = function (dx) {
this.left += dx;
this.right += dx;
};
/**
* Shifts the MapScreenr vertically by changing top and bottom by the dy.
*
* @param dy How far to scroll vertically.
*/
MapScreenr.prototype.shiftY = function (dy) {
this.top += dy;
this.bottom += dy;
};
return MapScreenr;
}());
MapScreenr_1.MapScreenr = MapScreenr;
})(MapScreenr || (MapScreenr = {}));
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
module.exports = MapScreenr;
}
define(["require","exports"],function(t,i){"use strict";var e=function(){function t(t){if(this.variables={},"undefined"==typeof t)throw new Error("No settings object given to MapScreenr.");if("undefined"==typeof t.width)throw new Error("No width given to MapScreenr.");if("undefined"==typeof t.height)throw new Error("No height given to MapScreenr.");if(t.variables)for(var i in t.variables)t.variables.hasOwnProperty(i)&&(this.variables[i]=t.variables[i]);this.height=t.height,this.width=t.width,this.scope=t.scope||this,this.variableFunctions=t.variableFunctions||{},this.variableArgs=t.variableArgs||[]}return t.prototype.clearScreen=function(){this.left=0,this.top=0,this.right=this.width,this.bottom=this.height,this.setMiddleX(),this.setMiddleY(),this.setVariables()},t.prototype.setMiddleX=function(){this.middleX=(this.left+this.right)/2},t.prototype.setMiddleY=function(){this.middleY=(this.top+this.bottom)/2},t.prototype.setVariables=function(){for(var t in this.variableFunctions)this.variableFunctions.hasOwnProperty(t)&&this.setVariable(t)},t.prototype.setVariable=function(t,i){this.variables[t]=1===arguments.length?this.variableFunctions[t].apply(this.scope,this.variableArgs):i},t.prototype.shift=function(t,i){t&&this.shiftX(t),i&&this.shiftY(i)},t.prototype.shiftX=function(t){this.left+=t,this.right+=t},t.prototype.shiftY=function(t){this.top+=t,this.bottom+=t},t}();i.MapScreenr=e});
//# sourceMappingURL=MapScreenr.js.map
{
"name": "mapscreenr",
"description": "A flexible container for map attributes and viewport.",
"version": "0.5.2",
"version": "0.5.3",
"author": {

@@ -18,4 +18,4 @@ "name": "Josh Goldberg",

"devDependencies": {
"gulp-shenanigans": "^0.5.1"
"gulp-shenanigans": "^0.5.19"
}
}

@@ -8,2 +8,3 @@ # MapScreenr

## Build Process

@@ -10,0 +11,0 @@

define(["require", "exports"], function (require, exports) {
"use strict";
});
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJJTWFwU2NyZWVuci5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0=

@@ -123,1 +123,3 @@ define(["require", "exports"], function (require, exports) {

});
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLC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xseSBieSBjaGFuZ2luZyB0b3AgYW5kIGJvdHRvbSBieSB0aGUgZHkuXHJcbiAgICAgKiBcclxuICAgICAqIEBwYXJhbSBkeSAgIEhvdyBmYXIgdG8gc2Nyb2xsIHZlcnRpY2FsbHkuXHJcbiAgICAgKi9cclxuICAgIHB1YmxpYyBzaGlmdFkoZHk6IG51bWJlcik6IHZvaWQge1xyXG4gICAgICAgIHRoaXMudG9wICs9IGR5O1xyXG4gICAgICAgIHRoaXMuYm90dG9tICs9IGR5O1xyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogS25vd24gdmFyaWFibGVzLCBrZXllZCBieSBuYW1lLlxyXG4gICAgICovXHJcbiAgICBbaTogc3RyaW5nXTogYW55O1xyXG59XHJcbiJdfQ==

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

/// <reference path="../../node_modules/@types/chai/index.d.ts" />
/// <reference path="../../node_modules/@types/mocha/index.d.ts" />
/// <reference path="../../lib/MapScreenr.d.ts" />
/// <reference path="../utils/MochaLoader.ts" />
/// <reference path="../utils/mocks.ts" />
mochaLoader.addTest("_", function () { });
define(["require", "exports", "../main"], function (require, exports, main_1) {
"use strict";
main_1.mochaLoader.it("_", function () { });
});

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

/// <reference path="../../node_modules/@types/chai/index.d.ts" />
/// <reference path="../../node_modules/@types/mocha/index.d.ts" />
/// <reference path="../../lib/MapScreenr.d.ts" />
/// <reference path="../utils/MochaLoader.ts" />
/// <reference path="../utils/mocks.ts" />
import { mochaLoader } from "../main";
mochaLoader.addTest("_", (): void => { });
mochaLoader.it("_", (): void => { });
{
"compilerOptions": {
"target": "es3",
"declaration": false
"declaration": true,
"module": "amd",
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "..",
"rootDir": "..",
"strictNullChecks": true,
"target": "es3"
},
"files": [
"utils/mocks.ts",
"utils/MochaLoader.ts",
"MapScreenr/_.ts"
"include": [
"./**/*.ts"
]
}
}
/* This file was auto-generated by gulp-shenanigans */
/// <reference path="../../node_modules/@types/chai/index.d.ts" />
/// <reference path="../../node_modules/@types/mocha/index.d.ts" />
/**
* Combines mocha tests into their describe() groups.
*/
var MochaLoader = (function () {
define(["require", "exports"], function (require, exports) {
"use strict";
/**
* Initializes a new instance of the MochaLoader class.
*
* @param mocha The underlying mocha instance.
* @param require The global require instance.
* Combines mocha tests into their describe() groups.
*/
function MochaLoader(mocha, require) {
var MochaLoader = (function () {
/**
* Root grouping of test hierarchies.
* Initializes a new instance of the MochaLoader class.
*
* @param mocha The underlying mocha instance.
*/
this.testHierarchy = {
children: {},
tests: {}
function MochaLoader(mocha) {
/**
* Root grouping of test hierarchies.
*/
this.testHierarchy = {
children: {},
tests: {}
};
this.mocha = mocha;
this.mocha.setup("bdd");
}
/**
* Sets the current test path.
*
* @param rawPath A new current test path.
*/
MochaLoader.prototype.setTestPath = function (rawPath) {
this.currentTestPath = rawPath.split("/");
};
this.mocha = mocha;
this.mocha.setup("bdd");
require.config({
baseUrl: "../lib"
});
}
/**
* Sets the current test path.
*
* @param rawPath A new current test path.
*/
MochaLoader.prototype.setTestPath = function (rawPath) {
this.currentTestPath = rawPath.split("/");
};
/**
* Adds a new test under the current test path.
*
* @param testName The name of the test.
* @param test A new test.
*/
MochaLoader.prototype.addTest = function (testName, test) {
if (!this.currentTestPath) {
throw new Error("No test path defined before adding test '" + testName + "'.");
}
var testHierarchy = this.testHierarchy;
for (var _i = 0, _a = this.currentTestPath; _i < _a.length; _i++) {
var part = _a[_i];
if (!testHierarchy.children[part]) {
testHierarchy = testHierarchy.children[part] = {
children: {},
tests: {}
};
/**
* Adds a new test under the current test path.
*
* @param testName The name of the test.
* @param test A new test.
*/
MochaLoader.prototype.it = function (testName, test) {
if (!this.currentTestPath) {
throw new Error("No test path defined before adding test '" + testName + "'.");
}
else {
testHierarchy = testHierarchy.children[part];
var testHierarchy = this.testHierarchy;
for (var _i = 0, _a = this.currentTestPath; _i < _a.length; _i++) {
var part = _a[_i];
if (!testHierarchy.children[part]) {
testHierarchy = testHierarchy.children[part] = {
children: {},
tests: {}
};
}
else {
testHierarchy = testHierarchy.children[part];
}
}
}
testHierarchy.tests[testName] = test;
};
/**
* Finalizes the tests' describe() hierarchy.
*/
MochaLoader.prototype.describeTests = function () {
this.describeTestHierarchy(this.testHierarchy);
};
/**
* Runs tests using mocha.
*/
MochaLoader.prototype.run = function () {
this.mocha.run();
};
/**
* Recursively describes a test hierarchy and its children hierarchies.
*
* @param testHierarchy A test hierarchy to describe.
*/
MochaLoader.prototype.describeTestHierarchy = function (testHierarchy) {
var _this = this;
for (var testName in testHierarchy.tests) {
if (testName in testHierarchy.tests) {
it(testName, testHierarchy.tests[testName]);
testHierarchy.tests[testName] = test;
};
/**
* Finalizes the tests' describe() hierarchy.
*/
MochaLoader.prototype.describeTests = function () {
this.describeTestHierarchy(this.testHierarchy);
};
/**
* Runs tests using mocha.
*/
MochaLoader.prototype.run = function () {
this.mocha.run();
};
/**
* Recursively describes a test hierarchy and its children hierarchies.
*
* @param testHierarchy A test hierarchy to describe.
*/
MochaLoader.prototype.describeTestHierarchy = function (testHierarchy) {
var _this = this;
for (var testName in testHierarchy.tests) {
if (testName in testHierarchy.tests) {
it(testName, testHierarchy.tests[testName]);
}
}
}
var _loop_1 = function(childName) {
if (childName in testHierarchy.children) {
describe(childName, function () { return _this.describeTestHierarchy(testHierarchy.children[childName]); });
var _loop_1 = function(childName) {
if (childName in testHierarchy.children) {
describe(childName, function () { return _this.describeTestHierarchy(testHierarchy.children[childName]); });
}
};
for (var childName in testHierarchy.children) {
_loop_1(childName);
}
};
for (var childName in testHierarchy.children) {
_loop_1(childName);
}
};
return MochaLoader;
}());
return MochaLoader;
}());
exports.MochaLoader = MochaLoader;
});

@@ -27,7 +27,7 @@ /* This file was auto-generated by gulp-shenanigans */

*/
class MochaLoader {
export class MochaLoader {
/**
* The underlying mocha instance.
*/
private mocha: any;
private mocha: Mocha;

@@ -51,11 +51,6 @@ /**

* @param mocha The underlying mocha instance.
* @param require The global require instance.
*/
public constructor(mocha: any, require: any) {
public constructor(mocha: Mocha) {
this.mocha = mocha;
this.mocha.setup("bdd");
require.config({
baseUrl: "../lib"
});
}

@@ -78,3 +73,3 @@

*/
public addTest(testName: string, test: (done?: Function) => void): void {
public it(testName: string, test: (done?: Function) => void): void {
if (!this.currentTestPath) {

@@ -133,3 +128,1 @@ throw new Error(`No test path defined before adding test '${testName}'.`);

}
declare var mochaLoader: MochaLoader;
{
"compilerOptions": {
"declaration": true,
"module": "amd",
"target": "es3",
"noImplicitAny": true,
"declaration": true,
"outDir": "dist"
"noImplicitReturns": true,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"target": "es3"
},
"files": [
"src/IMapScreenr.ts",
"src/MapScreenr.ts"
"include": [
"./src/**/*.ts"
]
}
}

@@ -18,3 +18,2 @@ {

"label-position": true,
"label-undefined": true,
"max-line-length": [true, 140],

@@ -42,5 +41,3 @@ "member-access": true,

"no-construct": true,
"no-constructor-vars": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,

@@ -55,10 +52,7 @@ "no-empty": true,

"no-trailing-whitespace": true,
"no-unreachable": true,
"no-unsafe-finally": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-unused-new": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": true,
"one-line": [

@@ -98,7 +92,2 @@ true,

"use-isnan": true,
"use-strict": [
true,
"check-module",
"check-function"
],
"whitespace": [

@@ -105,0 +94,0 @@ true,

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