1.0.14 • Published 6 years ago

key1 v1.0.14

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Key1

Extracts the key from an object with a single key/value pair. Returns null if anything else is passed to key1().

Installation

$ npm install key1

Example (test.js)

var key1 = require ('key1');

var k1 = key1 ({thisKey: 'thisVal'});
// returns 'thisKey'

var k2 = key1 ({x: 100, y: 120});
// returns null, since ob has > 1 key

k3 = key1 (undefined);
// returns null, since arg is undefined
// key1 always returns null, unless it's passed a non-null, non-Array object


k4 = key1 ([{a: 'a string'}]);
// returns null, since argument is an array
1.0.14

6 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago