JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 85
  • Score
    100M100P100Q74222F
  • License MIT

Utils shared by the expand libs.

Package Exports

  • expand-utils

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (expand-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

expand-utils NPM version NPM downloads Build Status

Utils shared by the expand libs.

Install

Install with npm:

$ npm install --save expand-utils

Usage

var util = require('expand-utils');

API

.is

Decorates the given object with a is* method, where * is the given name.

Params

  • obj {Object}: The object to check
  • name {String}

Example

var obj = {};
exports.is(obj, 'foo');
console.log(obj.isFoo);
//=> true

.run

Run parent's plugins on the child object, specifying a key to use for decorating the child object with an is property.

Example

exports.run(parent, 'foo', obj);

.isBoilerplate

Return true if the given value has boilerplate properties

Params

  • config {Object}: The configuration object to check

Example

exports.isBoilerplates({});

.isConfig

Return true if the given value has config properties

Params

  • config {Object}: The configuration object to check

Example

exports.isConfig({});

.isScaffold

Return true if the given value has scaffold properties. Scaffolds are essentially the same configuration structure as tasks from expand-task. We use expand-task for expanding grunt-style configs. But we use scaffold when working with gulp configs.

Params

  • config {Object}: The configuration object to check

Example

console.log(exports.isScaffold({
  foo: {
    options: {},
    files: []
  },
  bar: {
    options: {},
    files: []
  }
}));
//=> true

.isTask

Return true if the given value has task properties

Params

  • config {Object}: The configuration object to check

Example

console.log(exports.isTask({
  foo: {
    options: {},
    files: []
  },
  bar: {
    options: {},
    files: []
  }
}));
//=> true

.isTarget

Return true if the given value is has target properties.

Params

  • config {Object}: The configuration object to check

Example

console.log(exports.isTarget({
  name: 'foo',
  options: {},
  files: []
}));
//=> true

.isFiles

Return true if the given value is an object and instance of expand-files, has an isFiles property, or returns true from hasFilesProps.

Params

  • config {Object}: The configuration object to check

Example

console.log(exports.hasFilesProps({isFiles: true}));
//=> true
console.log(exports.hasFilesProps({files: []}));
//=> true
console.log(exports.hasFilesProps({files: [{src: [], dest: ''}]}));
//=> true
console.log(exports.hasFilesProps({src: []}));
//=> true
console.log(exports.hasFilesProps({dest: ''}));
//=> true
console.log(exports.hasFilesProps({foo: ''}));
//=> false

.hasFilesProps

Return true if the given value is an object that has src, dest or files properties.

Params

  • config {Object}: The configuration object to check

Example

console.log(exports.hasFilesProps({files: []}));
//=> true
console.log(exports.hasFilesProps({files: [{src: [], dest: ''}]}));
//=> true
console.log(exports.hasFilesProps({src: []}));
//=> true
console.log(exports.hasFilesProps({dest: ''}));
//=> true
console.log(exports.hasFilesProps({foo: ''}));
//=> false

You might also be interested in these projects:

Contributing

This document was generated by verb-readme-generator (a verb generator), please don't edit directly. Any changes to the readme must be made in .verb.md. See Building Docs.

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Or visit the verb-readme-generator project to submit bug reports or pull requests for the readme layout template.

Building docs

(This document was generated by verb-readme-generator (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)

Generate readme and API documentation with verb:

$ npm install -g verb verb-readme-generator && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on June 27, 2016.