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

@featherds/utils

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@featherds/utils - npm Package Compare versions

Comparing version 0.9.6 to 0.10.0

id.d.ts

7

id.js
const getSafeId = function (str) {
str = str || "feather";
const random = Math.floor(Math.random() * 1000000000);
return [str.replace(/\s+/g, "-"), Date.now(), random].join("-");
str = str || "feather";
const random = Math.floor(Math.random() * 1000000000);
return [str.replace(/\s+/g, "-"), Date.now(), random].join("-");
};
export { getSafeId };

@@ -1,17 +0,16 @@

var KEYCODES = {
PAGEUP: 33,
PAGEDOWN: 34,
UP: 38,
DOWN: 40,
LEFT: 37,
RIGHT: 39,
HOME: 36,
END: 35,
ENTER: 13,
SPACE: 32,
ESCAPE: 27,
BACKSPACE: 8,
DELETE: 46,
const KEYCODES = {
PAGEUP: 33,
PAGEDOWN: 34,
UP: 38,
DOWN: 40,
LEFT: 37,
RIGHT: 39,
HOME: 36,
END: 35,
ENTER: 13,
SPACE: 32,
ESCAPE: 27,
BACKSPACE: 8,
DELETE: 46,
};
export { KEYCODES };

@@ -1,16 +0,16 @@

var translateKey = {
props: {
translationKey: {
type: String,
default: "",
const translateKey = {
props: {
translationKey: {
type: String,
default: "",
},
},
},
methods: {
translate: function (key) {
return this.$t
? this.$t(this.translationKey + key)
: "Vue i18n is not loaded";
methods: {
translate: function (key) {
return this.$t
? this.$t(this.translationKey + key)
: "Vue i18n is not loaded";
},
},
},
};
export { translateKey };
{
"name": "@featherds/utils",
"version": "0.9.6",
"version": "0.10.0",
"publishConfig": {

@@ -8,3 +8,5 @@ "access": "public"

"author": "NantHealth",
"scripts": {},
"scripts": {
"compile": "tsc --declaration"
},
"keywords": [

@@ -14,4 +16,3 @@ "vue",

],
"types": "./src/index.d.ts",
"gitHead": "04a74207e8bfa8d39acc470365e30dd6c90b2e8e"
"gitHead": "9871b17eaedcfc90174b78b21acb0cc06afd594c"
}

@@ -1,13 +0,12 @@

var toView = function (el, parent) {
if (!el || !parent) {
return;
}
var elHeight = el.getBoundingClientRect().height;
const compStyle = getComputedStyle(el);
elHeight += parseInt(compStyle["margin-top"], 10);
elHeight += parseInt(compStyle["margin-bottom"], 10);
parent.scrollTop =
el.offsetTop - parent.getBoundingClientRect().height + elHeight;
const toView = function (el, parent) {
if (!el || !parent) {
return;
}
let elHeight = el.getBoundingClientRect().height;
const compStyle = getComputedStyle(el);
elHeight += parseInt(compStyle.getPropertyValue("margin-top"), 10);
elHeight += parseInt(compStyle.getPropertyValue("margin-bottom"), 10);
parent.scrollTop =
el.offsetTop - parent.getBoundingClientRect().height + elHeight;
};
export { toView };

@@ -1,79 +0,59 @@

const { configureAxe } = require("jest-axe");
const chalk = require("chalk");
const { printReceived, matcherHint } = require("jest-matcher-utils");
import { configureAxe } from "jest-axe";
import chalk from "chalk";
import { printReceived, matcherHint } from "jest-matcher-utils";
const toHaveNoViolations = {
toHaveNoViolations(results) {
if (typeof results.violations === "undefined") {
throw new Error("No violations found in aXe results object");
}
const violations = results.violations.concat(
results.incomplete.filter((x) => x.impact === "critical")
);
const reporter = (violations) => {
if (violations.length === 0) {
return [];
}
const lineBreak = "\n\n";
const horizontalLine = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
return violations
.map((violation) => {
const errorBody = violation.nodes
.map((node) => {
const selector = node.target.join(", ");
const expectedText =
`Expected the HTML found at $('${selector}') to have no violations:` +
lineBreak;
return (
expectedText +
chalk.grey(node.html) +
lineBreak +
`Received:` +
lineBreak +
printReceived(`${violation.help} (${violation.id})`) +
lineBreak +
chalk.yellow(node.failureSummary) +
lineBreak +
(violation.helpUrl
? `You can find more information on this issue here: \n${chalk.blue(
violation.helpUrl
)}`
: "")
);
toHaveNoViolations(results) {
if (typeof results.violations === "undefined") {
throw new Error("No violations found in aXe results object");
}
const violations = results.violations.concat(results.incomplete.filter((x) => x.impact === "critical"));
const reporter = (violations) => {
if (violations.length === 0) {
return [];
}
const lineBreak = "\n\n";
const horizontalLine = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
return violations
.map((violation) => {
const errorBody = violation.nodes
.map((node) => {
const selector = node.target.join(", ");
const expectedText = `Expected the HTML found at $('${selector}') to have no violations:` +
lineBreak;
return (expectedText +
chalk.grey(node.html) +
lineBreak +
`Received:` +
lineBreak +
printReceived(`${violation.help} (${violation.id})`) +
lineBreak +
chalk.yellow(node.failureSummary || "") +
lineBreak +
(violation.helpUrl
? `You can find more information on this issue here: \n${chalk.blue(violation.helpUrl)}`
: ""));
})
.join(lineBreak);
return errorBody;
})
.join(lineBreak);
return errorBody;
})
.join(lineBreak + horizontalLine + lineBreak);
};
const formatedViolations = reporter(violations);
const pass = formatedViolations.length === 0;
const message = () => {
if (pass) {
return;
}
return (
matcherHint(".toHaveNoViolations") + "\n\n" + `${formatedViolations}`
);
};
return { actual: violations, message, pass };
},
.join(lineBreak + horizontalLine + lineBreak);
};
const formatedViolations = reporter(violations);
const pass = formatedViolations.length === 0;
const message = () => {
if (pass) {
return;
}
return (matcherHint(".toHaveNoViolations") + "\n\n" + `${formatedViolations}`);
};
return { actual: violations, message, pass };
},
};
expect.extend(toHaveNoViolations);
export default configureAxe({
runOnly: {
type: "tag",
values: ["wcag2a", "wcag2aa"],
},
reporter: "v2",
runOnly: {
type: "tag",
values: ["wcag2a", "wcag2aa"],
},
reporter: "v2",
});
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