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

@swimlane/obfuscator

Package Overview
Dependencies
Maintainers
34
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swimlane/obfuscator - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

21

dist/index.js
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./Obfuscator"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxrQ0FBNkIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL09iZnVzY2F0b3InO1xuIl19
__exportStar(require("./Obfuscator"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLCtDQUE2QiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vT2JmdXNjYXRvcic7XG4iXX0=

@@ -1,15 +0,5 @@

export declare type TransformFunc = (input: any) => any;
export interface ObfuscateTypeFormat {
/**
* Type to obfuscate.
*/
type: string;
/**
* Format to obfuscate.
*/
format?: string;
}
export type TransformFunc = (input: any) => any;
export declare class Obfuscator {
static defaultReplaceString: string;
static defaultReplaceTypes: ObfuscateTypeFormat[];
static defaultReplaceTypes: Array<Record<string, unknown>>;
/**

@@ -29,5 +19,6 @@ * Obfuscate a value based on a JSON schema.

*/
static value(value: any, schema: any, replace?: string | TransformFunc, types?: string[] | ObfuscateTypeFormat[]): any;
static value(value: any, schema: any, replace?: string | TransformFunc, types?: Array<Record<string, unknown> | string>): any;
/**
* Obfuscate an object based on a JSON schema.
* This is an alias for the "value" method
*

@@ -45,5 +36,6 @@ * @remarks

*/
static object(obj: any, schema: any, replace?: string | TransformFunc, types?: string[] | ObfuscateTypeFormat[]): any;
static object(obj: any, schema: any, replace?: string | TransformFunc, types?: Array<Record<string, unknown> | string>): any;
/**
* Obfuscate an array based on a JSON schema.
* This is an alias for the "value" method
*

@@ -61,3 +53,3 @@ * @remarks

*/
static array(arr: any[], schema: any, replace?: string | TransformFunc, types?: string[] | ObfuscateTypeFormat[]): any[];
static array(arr: any, schema: any, replace?: string | TransformFunc, types?: Array<Record<string, unknown> | string>): any;
/**

@@ -81,3 +73,3 @@ * Normalize a replace string/function.

*/
static predicateTypeFormat(schema: any, types: string[] | ObfuscateTypeFormat[]): boolean;
static predicateTypeFormat(schema: any, types: Array<Record<string, unknown> | string>): boolean;
/**

@@ -84,0 +76,0 @@ * Replaces obfuscated text with the previous value.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Obfuscator = void 0;
class Obfuscator {

@@ -19,15 +20,39 @@ /**

static value(value, schema, replace = Obfuscator.defaultReplaceString, types = Obfuscator.defaultReplaceTypes) {
if (typeof schema !== 'object' || schema === null || !('type' in schema)) {
if (typeof schema !== 'object' || schema === null) {
return value;
}
const replaceFunc = Obfuscator.wrapReplace(replace);
if (schema.type === 'object') {
return Obfuscator.object(value, schema, replaceFunc, types);
}
else if (schema.type === 'array') {
return Obfuscator.array(value, schema, replace, types);
}
if (Obfuscator.predicateTypeFormat(schema, types)) {
return replaceFunc(value);
}
if (schema.type === 'object' &&
value !== null &&
typeof value === 'object' &&
!Array.isArray(value) &&
![String, Number, Date, RegExp].some(t => value instanceof t)) {
const newObj = Object.assign({}, value);
for (const propertyName in schema.properties) {
const propertySchema = schema.properties[propertyName];
if (!(propertyName in value)) {
// Skip missing properties
continue;
}
newObj[propertyName] = Obfuscator.value(value[propertyName], propertySchema, replaceFunc, types);
}
return newObj;
}
else if (schema.type === 'array' && Array.isArray(value)) {
const newArr = [];
if (Array.isArray(schema.items)) {
for (const i in value) {
newArr.push(Obfuscator.value(value[i], schema.items[i], replaceFunc, types));
}
}
else {
for (const item of value) {
newArr.push(Obfuscator.value(item, schema.items, replaceFunc, types));
}
}
return newArr;
}
else {

@@ -39,2 +64,3 @@ return value;

* Obfuscate an object based on a JSON schema.
* This is an alias for the "value" method
*

@@ -53,32 +79,7 @@ * @remarks

static object(obj, schema, replace = Obfuscator.defaultReplaceString, types = Obfuscator.defaultReplaceTypes) {
// check that object is an object or array
if (typeof obj !== 'object' || obj === null)
return obj;
// check that schema describes an object or array
if (typeof schema !== 'object' ||
schema === null ||
!('type' in schema) ||
!(schema.type === 'object' || schema.type === 'array') ||
!('properties' in schema || 'items' in schema)) {
// unknown type // not an object/array // properties/items not defined
return obj;
}
const replaceFunc = Obfuscator.wrapReplace(replace);
if (schema.type === 'array') {
return Obfuscator.array(obj, schema, replaceFunc, types);
}
const newObj = Object.assign({}, obj);
for (const propertyName in schema.properties) {
const propertySchema = schema.properties[propertyName];
if (!('type' in propertySchema) || // skip undefined types
!(propertyName in obj) // skip missing properties
) {
continue;
}
newObj[propertyName] = Obfuscator.value(newObj[propertyName], propertySchema, replaceFunc, types);
}
return newObj;
return this.value(obj, schema, replace, types);
}
/**
* Obfuscate an array based on a JSON schema.
* This is an alias for the "value" method
*

@@ -97,25 +98,3 @@ * @remarks

static array(arr, schema, replace = Obfuscator.defaultReplaceString, types = Obfuscator.defaultReplaceTypes) {
// check that object is an object or array
if (typeof arr !== 'object' || arr === null)
return arr;
// check that schema describes an array
if (typeof schema !== 'object' ||
schema === null ||
!('type' in schema) ||
schema.type !== 'array' ||
!('items' in schema) ||
!Array.isArray(arr)) {
return arr;
}
const replaceFunc = Obfuscator.wrapReplace(replace);
const newArr = [];
for (const item of arr) {
if (schema.items.type && Obfuscator.predicateTypeFormat(schema.items, types)) {
newArr.push(replaceFunc(item));
}
else {
newArr.push(Obfuscator.value(item, schema.items, replaceFunc, types));
}
}
return newArr;
return this.value(arr, schema, replace, types);
}

@@ -145,3 +124,3 @@ /**

static predicateTypeFormat(schema, types) {
if (schema && schema.type) {
if (schema) {
for (const i in types) {

@@ -152,3 +131,4 @@ const type = types[i];

}
else if (type.type === schema.type && (type.format === undefined || type.format === schema.format)) {
const matchesFormat = Object.keys(type).every(value => value in schema && type[value] === schema[value]);
if (matchesFormat) {
return true;

@@ -200,2 +180,3 @@ }

}
exports.Obfuscator = Obfuscator;
/* The default replacement value */

@@ -205,6 +186,5 @@ Obfuscator.defaultReplaceString = '**********';

Obfuscator.defaultReplaceTypes = [
{ type: 'password' },
{ type: 'password' }, // backward compatibility
{ type: 'string', format: 'password' }
];
exports.Obfuscator = Obfuscator;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT2JmdXNjYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9PYmZ1c2NhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBY0EsTUFBYSxVQUFVO0lBVXJCOzs7Ozs7Ozs7Ozs7O09BYUc7SUFDSCxNQUFNLENBQUMsS0FBSyxD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ZSA9PT0gJ29iamVjdCcpIHtcbiAgICAgIGNvbnN0IG5ld09iaiA9IHsgLi4ubmV3VmFsdWUgfTtcbiAgICAgIGZvciAoY29uc3Qga2V5IGluIG5ld09iaikge1xuICAgICAgICBuZXdPYmpba2V5XSA9IE9iZnVzY2F0b3IudW5PYmZ1c2NhdGUobmV3T2JqW2tleV0sIHByZXZWYWx1ZVtrZXldLCByZXBsYWNlU3RyaW5nKTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIG5ld09iajtcbiAgICB9XG5cbiAgICByZXR1cm4gbmV3VmFsdWU7XG4gIH1cbn1cbiJdfQ==
{
"name": "@swimlane/obfuscator",
"version": "1.1.1",
"version": "2.0.0",
"description": "Obfuscate objects based on a JSON Schema",

@@ -26,17 +26,16 @@ "main": "dist/index.js",

"devDependencies": {
"@swimlane/prettier-config-swimlane": "^0.1.1",
"@types/chai": "^4.1.4",
"@types/mocha": "^5.2.5",
"@types/node": "^10.7.1",
"chai": "^4.1.2",
"@swimlane/prettier-config-swimlane": "~3.0.3",
"@types/chai": "^4.3.12",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.24",
"chai": "^4.4.1",
"codacy-coverage": "^3.0.0",
"mocha": "^5.2.0",
"mocha": "^10.3.0",
"npm-run-all": "^4.1.5",
"nyc": "^13.0.1",
"prettier": "^1.14.2",
"rimraf": "^2.6.2",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"tslint-config-swimlane": "^3.0.4",
"typescript": "^3.1.1"
"nyc": "^15.1.0",
"prettier": "^2.0.4",
"rimraf": "^5.0.5",
"ts-node": "^10.9.2",
"tslint": "^5.20.1",
"typescript": "^5.3.3"
},

@@ -43,0 +42,0 @@ "keywords": [

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