dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/generate-object-property/index.js
Cyryl Płotnicki 2f946d6200 Add .vscode
2016-09-11 10:29:13 +02:00

12 lines
287 B
JavaScript

var isProperty = require('is-property')
var gen = function(obj, prop) {
return isProperty(prop) ? obj+'.'+prop : obj+'['+JSON.stringify(prop)+']'
}
gen.valid = isProperty
gen.property = function (prop) {
return isProperty(prop) ? prop : JSON.stringify(prop)
}
module.exports = gen