New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

yeoman-assert

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yeoman-assert - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

64

index.js

@@ -15,8 +15,3 @@ /**

var _ = require('lodash');
var chalk = require('chalk');
function deprecate (message) {
console.log(chalk.yellow('(!) ') + message);
}
function extractMethods(methods) {

@@ -43,11 +38,2 @@ return _.isArray(methods) ? methods : Object.keys(methods).filter(function (method) {

* assert.file(['templates/user.hbs', 'templates/user/edit.hbs']);
*
* @also
*
* Assert that a file's content matches a regex
* @deprecated
* @param {String} path - path to a file
* @param {Regex} reg - regex that will be used to search the file
* @example
* assert.file('models/user.js', /App\.User = DS\.Model\.extend/);
*/

@@ -57,14 +43,7 @@

var args = _.toArray(arguments);
if (_.last(args) instanceof RegExp) { // DEPRECATED CASE
var depMsg = 'assert.file(String, RegExp) DEPRECATED; use ';
depMsg += 'assert.fileContent(String, RegExp) instead.';
deprecate(depMsg);
assert.fileContent(args[0], args[1]);
} else {
args = _.isString(args[0]) ? args : args[0];
args.forEach(function (file) {
var here = fs.existsSync(file);
assert.ok(here, file + ', no such file or directory');
});
}
args = _.isString(args[0]) ? args : args[0];
args.forEach(function (file) {
var here = fs.existsSync(file);
assert.ok(here, file + ', no such file or directory');
});
};

@@ -96,35 +75,2 @@

/**
* Assert that each of an array of files exists. If an item is an array with
* the first element a filepath and the second element a regex, check to see
* that the file content matches the regex
*
* @deprecated
* @param {Array} pairs - an array of paths to files or file/regex subarrays
*
* @example
* file(['templates/user.hbs', 'templates/user/edit.hbs']);
*
* @example
* files(['foo.js', 'bar.js', ['baz.js', /function baz/]]);
*/
assert.files = function (files) {
var depMsg = 'assert.files deprecated. Use ';
depMsg += 'assert.file([String, String, ...]) or ';
depMsg += 'assert.file([[String, RegExp], [String, RegExp]...]) instead.';
deprecate(depMsg);
files.forEach(function (item) {
var file = item;
var rx;
if (item instanceof Array) {
file = item[0];
rx = item[1];
assert.fileContent(file, rx);
} else {
assert.file(file);
}
});
};
/**
* Assert that a file's content matches a regex or string

@@ -131,0 +77,0 @@ * @param {String} file - path to a file

9

package.json
{
"name": "yeoman-assert",
"version": "1.0.0",
"version": "2.0.0",
"description": "Assert utility from yeoman",

@@ -25,10 +25,9 @@ "license": "BSD",

"dependencies": {
"chalk": "^0.5.1",
"lodash": "^2.4.1"
"lodash": "^3.6.0"
},
"devDependencies": {
"jscs": "^1.7.3",
"jshint": "^2.5.10",
"jscs": "^1.12.0",
"jshint": "^2.6.3",
"mocha": "*"
}
}

@@ -22,3 +22,3 @@ # yeoman-assert [![Build Status](https://travis-ci.org/yeoman/yeoman-assert.svg?branch=master)](https://travis-ci.org/yeoman/yeoman-assert)

```
```js
assert.file('templates/user.hbs');

@@ -29,3 +29,3 @@ ```

```
```js
assert.file(['templates/user.hbs', 'templates/user/edit.hbs']);

@@ -42,3 +42,3 @@

```
```js
assert.noFile('templates/user.hbs');

@@ -49,3 +49,3 @@ ```

```
```js
assert.noFile(['templates/user.hbs', 'templates/user/edit.hbs']);

@@ -60,6 +60,6 @@

- **reg** (Regex|String) Regex or string that will be used to search the file.
Assert that a file's content matches a string.
```
```js
assert.fileContent('models/user.js', 'App.User = DS.Model.extend');

@@ -71,3 +71,3 @@

```
```js
assert.fileContent('models/user.js', /App\.User = DS\.Model\.extend/);

@@ -78,3 +78,3 @@ ```

```
```js
assert.fileContent([

@@ -92,5 +92,5 @@ ['models/user.js', 'App.User = DS.Model.extend'],

Assert that a file's content does not matche a string.
Assert that a file's content does not match a string.
```
```js
assert.fileContent('models/user.js', 'App.User = DS.Model.extend');

@@ -100,5 +100,5 @@

Assert that a file's content does not matche a regex.
Assert that a file's content does not match a regex.
```
```js
assert.fileContent('models/user.js', /App\.User = DS\.Model\.extend/);

@@ -109,3 +109,3 @@ ```

```
```js
assert.fileContent([

@@ -124,3 +124,3 @@ ['models/user.js', 'App.User = DS.Model.extend'],

```
```js
assert.textEqual('I have a yellow cat', 'I have a yellow cat');

@@ -137,3 +137,3 @@ ```

```
```js
yoAssert.notImplement(fs, ['readFile']);

@@ -150,3 +150,3 @@ ```

```
```js
yoAssert.notImplement(fs, ['foo']);

@@ -153,0 +153,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