File tree Expand file tree Collapse file tree 3 files changed +25
-9
lines changed Expand file tree Collapse file tree 3 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,15 @@ class Attribute {
70
70
return this . #type
71
71
}
72
72
73
+ /**
74
+ * Set the attribute name.
75
+ *
76
+ * @param {string } name
77
+ */
78
+ set type ( name ) {
79
+ this . #type = name
80
+ }
81
+
73
82
/**
74
83
* The set of attribute values as strings.
75
84
*
Original file line number Diff line number Diff line change @@ -160,6 +160,21 @@ tap.test('.buffers', t => {
160
160
t . end ( )
161
161
} )
162
162
163
+ tap . test ( '.type' , t => {
164
+ t . test ( 'gets and sets' , async t => {
165
+ const attr = new Attribute ( ( {
166
+ type : 'foo' ,
167
+ values : [ 'bar' ]
168
+ } ) )
169
+
170
+ t . equal ( attr . type , 'foo' )
171
+ attr . type = 'bar'
172
+ t . equal ( attr . type , 'bar' )
173
+ } )
174
+
175
+ t . end ( )
176
+ } )
177
+
163
178
tap . test ( 'toBer' , async t => {
164
179
t . test ( 'renders type with values' , async t => {
165
180
const attr = new Attribute ( {
@@ -328,14 +343,6 @@ tap.test('#isAttribute', t => {
328
343
t . equal ( Attribute . isAttribute ( input ) , false )
329
344
} )
330
345
331
- // const isA = Attribute.isAttribute
332
- // t.notOk(isA(null))
333
- // t.notOk(isA('asdf'))
334
- // t.ok(isA(new Attribute({
335
- // type: 'foobar',
336
- // values: ['asdf']
337
- // })))
338
-
339
346
t . end ( )
340
347
} )
341
348
Original file line number Diff line number Diff line change 7
7
"name" : " @ldapjs/attribute" ,
8
8
"homepage" : " https://github.com/ldapjs/attribute" ,
9
9
"description" : " API for handling LDAP entry attributes" ,
10
- "version" : " 1.0.0-rc.2 " ,
10
+ "version" : " 1.0.0-rc.3 " ,
11
11
"license" : " MIT" ,
12
12
"repository" : {
13
13
"type" : " git" ,
You can’t perform that action at this time.
0 commit comments