source: node_modules/property-information/lib/util/defined-info.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 727 bytes
Line 
1'use strict'
2
3var Info = require('./info')
4var types = require('./types')
5
6module.exports = DefinedInfo
7
8DefinedInfo.prototype = new Info()
9DefinedInfo.prototype.defined = true
10
11var checks = [
12 'boolean',
13 'booleanish',
14 'overloadedBoolean',
15 'number',
16 'commaSeparated',
17 'spaceSeparated',
18 'commaOrSpaceSeparated'
19]
20var checksLength = checks.length
21
22function DefinedInfo(property, attribute, mask, space) {
23 var index = -1
24 var check
25
26 mark(this, 'space', space)
27
28 Info.call(this, property, attribute)
29
30 while (++index < checksLength) {
31 check = checks[index]
32 mark(this, check, (mask & types[check]) === types[check])
33 }
34}
35
36function mark(values, key, value) {
37 if (value) {
38 values[key] = value
39 }
40}
Note: See TracBrowser for help on using the repository browser.