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

json-mask

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-mask - npm Package Compare versions

Comparing version 0.3.7 to 0.3.8

2

bower.json
{
"name": "json-mask",
"version": "0.3.7",
"version": "0.3.8",
"homepage": "https://github.com/nemtsov/json-mask",

@@ -5,0 +5,0 @@ "authors": ["Yuriy Nemtsov <nemtsov@gmail.com>"],

{
"name": "json-mask",
"version": "0.3.7",
"version": "0.3.8",
"description": "Tiny language and engine for selecting specific parts of a JS object, hiding the rest.",

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

@@ -105,7 +105,5 @@ # JSON Mask [![Build Status](https://img.shields.io/travis/nemtsov/json-mask.svg)](http://travis-ci.org/nemtsov/json-mask) [![NPM version](https://img.shields.io/npm/v/json-mask.svg)](https://www.npmjs.com/package/json-mask) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)

var mask = require('json-mask')
, assert = require('assert')
, maskedObj
var assert = require('assert')
maskedObj = mask(originalObj, fields)
var maskedObj = mask(originalObj, fields)
assert.deepEqual(maskedObj, expectObj)

@@ -122,18 +120,18 @@ ```

var http = require('http')
, url = require('url')
, mask = require('json-mask')
, server
var url = require('url')
var mask = require('json-mask')
var server
server = http.createServer(function (req, res) {
var fields = url.parse(req.url, true).query.fields
, data = {
firstName: 'Mohandas'
, lastName: 'Gandhi'
, aliases: [{
firstName: 'Mahatma'
, lastName: 'Gandhi'
}, {
firstName: 'Bapu'
}]
}
var data = {
firstName: 'Mohandas',
lastName: 'Gandhi',
aliases: [{
firstName: 'Mahatma',
lastName: 'Gandhi'
}, {
firstName: 'Bapu'
}]
}
res.writeHead(200, {'Content-Type': 'application/json'})

@@ -167,4 +165,4 @@ res.end(JSON.stringify(mask(data, fields)))

**jsDelivr**
- `//cdn.jsdelivr.net/jsonmask/0.3.5/jsonMask.js`
- `//cdn.jsdelivr.net/jsonmask/0.3.5/jsonMask.min.js`
- `//cdn.jsdelivr.net/jsonmask/0.3.8/jsonMask.js`
- `//cdn.jsdelivr.net/jsonmask/0.3.8/jsonMask.min.js`

@@ -171,0 +169,0 @@

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