New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

typedef

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedef - npm Package Compare versions

Comparing version 0.12.0 to 0.13.0

test/unit/fluent.js

1

lib/typedef.js

@@ -86,2 +86,3 @@ // ----------------------------------------------------------------------------

validation.checkInheritance(Child);
validation.checkMisc(Child);

@@ -88,0 +89,0 @@ return Child;

@@ -170,3 +170,41 @@ var util = require('./util');

});
}
},
// Check for any thing else we're trying to enforce
checkMisc: function(C)
{
// Check for fluent stuff
var sClass = 'Class ' + C.__name__;
_(core.getSignature(C)).each(function(info, key) {
var s = validation.prettyPrint(key, info, C);
if (info.decorations.FLUENT) {
if (!_(info.value).isFunction()) {
throw new TypedefException('fluent member ' + s +
' must be function');
}
var re = /return\s+([^;]+)/g;
var body = info.value.toString();
var good = true;
var matches = 0;
var tots = 0;
while ((match = re.exec(body)))
{
tots++;
if (match[1] == 'this')
matches++;
}
if (!matches || matches != tots) {
throw new TypedefException('fluent member ' + s +
' must return own instance in all code paths');
}
}
});
},
};

2

package.json
{
"name": "typedef",
"version": "0.12.0",
"version": "0.13.0",
"description": "Familiar classes, mixins, and interfaces in ES5 Javascript. Member decorations for powerful objects that keep your code DRY",

@@ -5,0 +5,0 @@ "main": "lib/typedef.js",

@@ -9,1 +9,2 @@ // Run all tests

require('./unit/global');
require('./unit/fluent');
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