0.6.0 • Published 7 years ago

inspect-attrs v0.6.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

inspect-attrs

An object attributes inspect tool.

NPM Version Download Status Linux Status Windows Status Test Coverage Node Version Dependencies

API

inspectAttrs(source: Object, rules: Object)

  • source: The target object
  • rules: The inspect rules
    • required: Boolean Set attr is required
    • type: String|Array Set attr type
    • default: Any Set attr default value
    • onRequired: String Set custom required error message, %s equal the attr
    • onTypeError: String Set custom type error message, %s equal the attr

Example

import inspectAttrs from 'inspect-attrs';

let options = {};

options = inspectAttrs(options, {
  root: {
    type: String,
    required: true
  },
  'css.loader': {
    default: null,
    type: [Function, null]
  }
});
0.6.0

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago