vigour-util
Advanced tools
Comparing version 1.4.0 to 2.0.0
@@ -10,8 +10,8 @@ 'use strict' | ||
module.exports = function (obj) { | ||
var referenced = obj.__input | ||
var referenced = obj.val | ||
if (referenced && | ||
referenced._base_version && | ||
referenced.__input !== null) { | ||
referenced.val !== null) { | ||
return referenced | ||
} | ||
} |
@@ -13,3 +13,3 @@ 'use strict' | ||
obj.each(function (property, key) { | ||
if (property.__input !== null) { | ||
if (property.val !== null) { | ||
return (ret = false) | ||
@@ -16,0 +16,0 @@ } |
@@ -28,3 +28,3 @@ 'use strict' | ||
} | ||
if (base.__input !== null) { | ||
if (base.val !== null) { | ||
return false | ||
@@ -31,0 +31,0 @@ } |
{ | ||
"name": "vigour-util", | ||
"version": "1.4.0", | ||
"version": "2.0.0", | ||
"author": "Vigour.io <dev@vigour.io>", | ||
"scripts": { | ||
"test": "node test | tap-difflet" | ||
"test": "node test | tap-difflet && vtest test | tap-difflet" | ||
}, | ||
@@ -41,6 +41,8 @@ "repository": { | ||
"devDependencies": { | ||
"browserify": "^13.0.0", | ||
"nightmare": "^2.2.0", | ||
"tap-difflet": "^0.4.0", | ||
"tape": "^4.5.1", | ||
"vigour-base": "^1.2.2", | ||
"tap-difflet": "0.4.0" | ||
"vigour-base": "^1.2.2" | ||
} | ||
} |
@@ -15,2 +15,6 @@ <!-- VDOC.badges travis; standard; npm --> | ||
## Running the tests | ||
`npm test` expects `vtest` to exist, so if you want to run the tests, you'll need to `npm i -g vigour-test` first, which will allow the tests to be run in the context of a browser (Nightmare). See [vigour-test](https://github.com/vigour-io/test) | ||
--- | ||
@@ -341,3 +345,3 @@ | ||
### merge | ||
***Deprecated***: consider using [`lodash.merge`](https://www.npmjs.com/package/lodash.merge) | ||
***Obsolete***: This function has been removed in version 2. Use [`lodash.merge`](https://www.npmjs.com/package/lodash.merge) instead. | ||
@@ -352,3 +356,3 @@ <!-- VDOC.jsdoc regenerator --> | ||
### setwithpath | ||
***Deprecated***: consider using [`lodash.set`](https://www.npmjs.com/package/lodash.set) | ||
***Obsolete***: This function has been removed in version 2. Use [`lodash.set`](https://www.npmjs.com/package/lodash.set) instead. | ||
@@ -398,1 +402,14 @@ <!-- VDOC.jsdoc unflatten --> | ||
``` | ||
#### require | ||
Modifies `require` so that it: | ||
- ignores `.css` and `.less` files. | ||
- ignores anything with `/scratch/` in it | ||
- converts `package.json` to `process.cwd() + '/package.json' and `JSON.parse`s it | ||
```javascript | ||
require('vigour-util/require') | ||
require('styles.less') // ignored in node, processed elsewhere | ||
// Don't forget to add a browserify transform or similar for non-node | ||
``` |
@@ -12,1 +12,2 @@ 'use strict' | ||
require('./define') | ||
require('./require') |
@@ -12,1 +12,2 @@ 'use strict' | ||
require('./url') | ||
require('./node') |
'use strict' | ||
var test = require('tape') | ||
var stream = require('stream') | ||
var http = require('http') | ||
var isStream = require('../../is/stream') | ||
@@ -46,17 +45,1 @@ | ||
}) | ||
test('isStream (super-streams)', function (t) { | ||
t.plan(6) | ||
var req = http.request('http://perdu.com', function (res) { | ||
t.equals(isStream(res), true, 'isStream(http.ClientResponse) === true') | ||
t.equals(isStream.readable(res), true, 'isStream.readable(http.ClientRequest) === true') | ||
t.equals(isStream.writable(res), false, 'isStream.writable(http.ClientRequest) === false') | ||
}) | ||
t.equals(isStream(req), true, 'isStream(http.ClientRequest) === true') | ||
t.equals(isStream.readable(req), false, 'isStream.readable(http.ClientRequest) === false') | ||
t.equals(isStream.writable(req), false, 'isStream.writable(http.ClientRequest) === false') | ||
// --> not true! http://stackoverflow.com/questions/21101623/what-does-it-mean-in-node-js-by-http-clientrequest-implements-an-interface | ||
req.end() | ||
// from: https://nodejs.org/api/http.html#http_class_http_clientrequest | ||
// "The request implements the Writable Stream interface." | ||
}) |
'use strict' | ||
var test = require('tape') | ||
var uuid = require('../../uuid/') | ||
var isHash = require('../../is/hash') | ||
require('./notBrowser') | ||
test('uuid', function (t) { | ||
t.plan(4) | ||
t.equals(isHash(uuid.val), true, 'isHash(uuid.val) === true') | ||
var one = uuid.generate() | ||
t.equals(isHash(one), true, 'isHash(uuid.generate()) === true') | ||
var two = uuid.generate() | ||
t.equals(isHash(one), true, 'Calling `generate` multiple times') | ||
t.equals(one !== two, true, 'Calling `generate` multiple times produces different ids') | ||
}) |
Sorry, the diff of this file is not supported yet
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
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
70201
58
1661
412
5
3