Comparing version 0.3.7 to 0.3.8
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68859
177