Socket
Socket
Sign inDemoInstall

clarity

Package Overview
Dependencies
2
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.1.2

test/object-deep.js

34

index.js

@@ -20,7 +20,14 @@ var data = {},

clarity.decode = function(input) {
var matchUser, matchVariable, output, parts;
// if the input is an object, then walk through the object and clone
if (typeof input == 'object' && (! (input instanceof String))) {
return clarity.deepDecode(input);
}
// run some regex checks against the input string
var matchUser = reObfuscatedUser.exec(input),
matchVariable = reObfuscatedVariable.exec(input),
output = input,
parts = [];
matchUser = reObfuscatedUser.exec(input);
matchVariable = reObfuscatedVariable.exec(input);
output = input;
parts = [];

@@ -49,2 +56,21 @@ // if we are dealing with a variable, then decode appropriately

clarity.deepDecode = function(input) {
var clone = {};
// if we have a string, then short circuit
if (typeof input == 'string' || (input instanceof String)) {
return clarity.decode(input);
}
// iterate through the keys within the object
// and return the decoded value
Object.keys(input).forEach(function(key) {
if (input.hasOwnProperty(key)) {
clone[key] = clarity.deepDecode(input[key]);
}
});
return clone;
}
clarity.use = function() {

@@ -51,0 +77,0 @@ function extend() {

2

package.json

@@ -10,3 +10,3 @@ {

],
"version": "0.1.1",
"version": "0.1.2",
"engines": {

@@ -13,0 +13,0 @@ "node": ">= 0.6.x < 0.9.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc