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

specberus

Package Overview
Dependencies
Maintainers
1
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

specberus - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

1

lib/l10n.js

@@ -184,2 +184,3 @@

, 'echidna.editor-ids.no-editor-id': 'Editor IDs must be set for each editor, in the <code>data-editor-id</code> attribute.'
, 'echidna.todays-date.date-not-detected': 'The publication date of this document could not be detected.'
, 'echidna.todays-date.wrong-date': 'The publication date of this document must be set to today.'

@@ -186,0 +187,0 @@ }

2

lib/rules/echidna/editor-ids.js

@@ -11,3 +11,3 @@ 'use strict';

if (/\d+/.test(strId)) return parseInt(strId, 10);
}).toArray();
}).get();

@@ -14,0 +14,0 @@ sr.metadata('editorIDs', editorIDs);

@@ -6,5 +6,17 @@ 'use strict';

exports.check = function (sr, done) {
function getDate(date) { return date.setHours(0, 0, 0, 0); }
/**
* Get the timestamp of a day, regardless the time of the day.
* This function creates a new `Date` to avoid modifying the original one.
*
* @param {Date} date - The date to extract the day, month and year from
* @returns {number} number of milliseconds between 1 January 1970 and `date`
*/
function getDateTime(date) {
return new Date(date.getTime()).setHours(0, 0, 0, 0);
}
if (getDate(sr.getDocumentDate()) !== getDate(new Date())) {
if (!(sr.getDocumentDate() instanceof Date)) {
sr.error(exports.name, 'date-not-detected');
}
else if (getDateTime(sr.getDocumentDate()) !== getDateTime(new Date())) {
sr.error(exports.name, 'wrong-date');

@@ -11,0 +23,0 @@ }

{
"name": "specberus",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "lib/validator",

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