{"_id":"unquoted-property-validator","_rev":"19-c96db57364e6e5b1331c427a706dc662","name":"unquoted-property-validator","description":"Unquoted JavaScript property name validator","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.2":{"name":"unquoted-property-validator","version":"0.1.2","description":"Unquoted JavaScript property name validator","homepage":"https://github.com/pgilad/unquoted-property-validator","bugs":{"url":"https://github.com/pgilad/unquoted-property-validator/issues"},"main":"index.js","repository":{"type":"git","url":"https://github.com/pgilad/unquoted-property-validator"},"scripts":{"test":"mocha -R spec ./tests/test.js","watch":"mocha -w -R spec ./tests/test.js"},"keywords":["string","literal","mathias","brackets","dot notation","validation","code-style"],"author":{"name":"Gilad Peleg","email":"giladp007@gmail.com"},"files":["license.md","index.js","lib"],"engines":{"node":">=0.10.0"},"devDependencies":{"expect.js":"*","mocha":"*"},"license":"MIT","gitHead":"7383a157f8c2157f91dc0ec2c700071d4a1176b7","_id":"unquoted-property-validator@0.1.2","_shasum":"366bd3904cb01d534f7b7ad3eac5d7f5aa0ef5a2","_from":".","_npmVersion":"2.0.0-beta.0","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"dist":{"shasum":"366bd3904cb01d534f7b7ad3eac5d7f5aa0ef5a2","tarball":"https://registry.npmjs.org/unquoted-property-validator/-/unquoted-property-validator-0.1.2.tgz","integrity":"sha512-d00RYYa2f3OoKz1yLC9Spcfrta4TlzsV2gpHogCJHe17+RE1PbToS2HJ4LmQlFyTl/Dt8ochpUuiSIGfU1ov7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBoHBJQuei4WqvG1CvHVXvazBPXt4Q8Qo0TTKNa5H1tMAiB2GsEYxY46yv+IjjR2nGKZsnScg6BbrWT/R74AGa1PTg=="}]},"directories":{}},"1.0.0":{"name":"unquoted-property-validator","version":"1.0.0","description":"Unquoted JavaScript property name validator","repository":{"type":"git","url":"https://github.com/pgilad/unquoted-property-validator"},"license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","files":["index.js","lib"],"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec ./tests/test.js","watch":"mocha -w -R spec ./tests/test.js"},"keywords":["string","literal","mathias","brackets","dot notation","validation","code-style"],"devDependencies":{"expect.js":"*","mocha":"*"},"gitHead":"6180c22ec7b46976415b0a3db57392505135a0c8","bugs":{"url":"https://github.com/pgilad/unquoted-property-validator/issues"},"homepage":"https://github.com/pgilad/unquoted-property-validator","_id":"unquoted-property-validator@1.0.0","_shasum":"e63618c9cadd25ce82f0e33db951ffdfa694fc3a","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"dist":{"shasum":"e63618c9cadd25ce82f0e33db951ffdfa694fc3a","tarball":"https://registry.npmjs.org/unquoted-property-validator/-/unquoted-property-validator-1.0.0.tgz","integrity":"sha512-MOzACTEayVT0hpXuF4b5JhIHAA3IpgwNfuU72H2CtbmOBMj7M8TSxmxrMH+EGi4oEuFqt0I9DFs7qsHyW48+aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxkoQpXE9L6+shLkZ24ZOTqhebzitBDrmB8dMp+dlsSAiEA7sBMxEaZnHd/svSw8IxPMztvUC/4F3bXwE3T3J4UUBQ="}]},"directories":{}},"1.0.1":{"name":"unquoted-property-validator","version":"1.0.1","description":"Unquoted JavaScript property name validator","repository":{"type":"git","url":"git+https://github.com/pgilad/unquoted-property-validator.git"},"license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","typings":"./index.d.ts","files":["index.js","lib"],"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec ./tests/test.js","watch":"mocha -w -R spec ./tests/test.js"},"keywords":["string","literal","mathias","brackets","dot notation","validation","code-style"],"devDependencies":{"expect.js":"*","mocha":"*"},"gitHead":"37c82e572270b570183c8e99d7f72f2152e4dec8","bugs":{"url":"https://github.com/pgilad/unquoted-property-validator/issues"},"homepage":"https://github.com/pgilad/unquoted-property-validator#readme","_id":"unquoted-property-validator@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.7.0","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"dist":{"integrity":"sha512-FKwLDGrfjFU5y3oOg5PKLBN7Z5GXNk6zg/GDoQSZKVE6AYlKngFd0NWSKfufAP3vJQS8j/+HfFRvMWi0sGqJkA==","shasum":"9598624628ba812172320353e752dbe77a938001","tarball":"https://registry.npmjs.org/unquoted-property-validator/-/unquoted-property-validator-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhIC8t2L6ebFcPh/qOPoYZLLpR0hEG2reNaS9Hbrce9AiBkcP1ZYMp/qfS3D0wxRTVnyXseW19DN9hxtnz+CNQRYg=="}]},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unquoted-property-validator-1.0.1.tgz_1508963358360_0.6073204507119954"},"directories":{}},"1.0.2":{"name":"unquoted-property-validator","version":"1.0.2","description":"Unquoted JavaScript property name validator","repository":{"type":"git","url":"git+https://github.com/pgilad/unquoted-property-validator.git"},"license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","typings":"./index.d.ts","files":["index.js","index.d.ts","lib"],"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec ./tests/test.js","watch":"mocha -w -R spec ./tests/test.js"},"keywords":["string","literal","mathias","brackets","dot notation","validation","code-style"],"devDependencies":{"expect.js":"*","mocha":"*"},"gitHead":"cb928b0a235d9fa7fa2a08b97ffa8fb3e9d1272b","bugs":{"url":"https://github.com/pgilad/unquoted-property-validator/issues"},"homepage":"https://github.com/pgilad/unquoted-property-validator#readme","_id":"unquoted-property-validator@1.0.2","_npmVersion":"5.5.1","_nodeVersion":"8.7.0","_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"dist":{"integrity":"sha512-LokWcfN2q9UnQTTIpRkTZNsLVVO2KaXeO3oUMQ7JShGhMdO8P+zN1MfrPMf1IwR/Cyh283lGaxbRcNGyq2IXYQ==","shasum":"edd75c6a4481fbbc094b3b4c35035863df6bbcef","tarball":"https://registry.npmjs.org/unquoted-property-validator/-/unquoted-property-validator-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGEjZqlE7FBW7DkNnRISwrtb991HRewiyFPtZxRjEam1AiEArv6QW/jdEq8ZnTrgwo4UXcOqiSgEprwHnT5+acxIDuk="}]},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unquoted-property-validator-1.0.2.tgz_1509001567895_0.5961332921870053"},"directories":{}},"1.1.0":{"name":"unquoted-property-validator","version":"1.1.0","description":"Unquoted JavaScript property name validator","repository":{"type":"git","url":"git+https://github.com/pgilad/unquoted-property-validator.git"},"license":"MIT","author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"main":"index.js","typings":"./index.d.ts","engines":{"node":">=6.0.0"},"scripts":{"test":"mocha -R spec ./tests/test.js","watch":"mocha -w -R spec ./tests/test.js"},"keywords":["string","literal","mathias","brackets","dot notation","validation","code-style"],"devDependencies":{"expect.js":"*","mocha":"*"},"gitHead":"5dc0790cf9365563999580888c90267f8e8abd67","bugs":{"url":"https://github.com/pgilad/unquoted-property-validator/issues"},"homepage":"https://github.com/pgilad/unquoted-property-validator#readme","_id":"unquoted-property-validator@1.1.0","_nodeVersion":"11.9.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-ZWeQoYZ7HN8DCLeaowNv2GvZIXqJptKB1uUWd08ZYc1qAmJt8tXh9nck26aoYmhJtE3jCjDqdqEfUTqcJ0R7bw==","shasum":"c173769e9ef655d0fa18a3b2885622fdf5296021","tarball":"https://registry.npmjs.org/unquoted-property-validator/-/unquoted-property-validator-1.1.0.tgz","fileCount":6,"unpackedSize":14189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcY+JHCRA9TVsSAnZWagAA5A4P/0pUPGCo02cMqVA8yCCF\nDlBxjd7+oO5LJ7gonq8IHFuMFaJeCYvWH4BiyNaT9dWerIJu3y1g1qYCZ5RJ\n3GJnEJPKCWRezrTvfCzuETXuWTHMlhVM84M9JDQPdLZkieQamQS51JjlkWTz\neq8v9qtZJcRZFCwe9lPGKlbZFcMEjYG3ESG/qm440YQI2Bl1Oo00T5a6Wlhb\nMmqhits2ZyQQ4t0ppxk89r5m236k2EAxaApqPssM1DEx789K1CoMLnaPprLg\ntAIswHkmf01ArAXao0i2ZEM1PeCCuTuhovrQ9tXbtheqSo5X/7C5TbqAmoaj\nrZzK+weQvpzBP1cnbStfUmkNNPAqrHXdA6oCjQQzts0XNjcBj7uP90dSmlRO\nxeFcfrcT4SVqjXq+SDzk1AtmncK/S4zl9WSTyFnJpNmh7id6TB9n5VjYka2x\nInn2GIcjom5pogyOux4QlyXPjiGh6XCsHCIdvm3tEJ8o7OIUPks0cw7z1Z53\nv31hne4E8PCP5adc6WOqVJJAAne/1qMLpCndw8ZAXgFfNaGNErmqCTIdH9PH\nfKDFOL6F8zzeQWA1lIzE8pbcWc7T2Lt/6XA/9DeiaFDlDE6tNM16dAiExc1E\nqlLePBstFFJc1L0AhyqkYNZe1kjRLhqQIM6w0fgrHn+7nKhx8hXd0+KtefbX\nRkuL\r\n=1VWN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDw685/zqxKOpCB5+BHe145yViCA0lFRzjHj3RcHCAKywIgKUoYfB/RxLfqDxy6+zgur5pN/ey8r4ofiC1SOO0D4UQ="}]},"maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"_npmUser":{"name":"pgilad","email":"giladp007@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unquoted-property-validator_1.1.0_1550049862619_0.8161438284430651"},"_hasShrinkwrap":false}},"readme":"# unquoted-property-validator\n> Unquoted JavaScript property name validator\n\n[![NPM Version](http://img.shields.io/npm/v/unquoted-property-validator.svg?style=flat)](https://npmjs.org/package/unquoted-property-validator)\n[![NPM Downloads](http://img.shields.io/npm/dm/unquoted-property-validator.svg?style=flat)](https://npmjs.org/package/unquoted-property-validator)\n[![Build Status](http://img.shields.io/travis/pgilad/unquoted-property-validator.svg?style=flat)](https://travis-ci.org/pgilad/unquoted-property-validator)\n\nThis module checks if a given property name can be used without quotes and/or with dot notation.\n\nIt is based on Mathias Bynens brilliant [javascript-properties article](https://mathiasbynens.be/notes/javascript-properties).\nSo this is a **node-port** of his [website implementation](https://github.com/mathiasbynens/mothereff.in/tree/master/js-properties).\n\n## Installation\n\n```bash\n$ npm install unquoted-property-validator --save\n```\n\n## Usage\n\n```js\nvar unquotedValidator = require('unquoted-property-validator');\n\nvar results = unquotedValidator('myCoolLiteral');\nconsole.log(results);\n/* {\n    needsQuotes: false,\n    needsBrackets: false,\n    es3Warning: false,\n    quotedValue: 'myCoolLiteral'\n   }\n*/\n```\n\nIn ES6/Typescript the first line should look like this instead:\n\n```js\nimport unquotedValidator = require('unquoted-property-validator');\n```\n\n## Results\n\nYour property input will be checked and you will get 3 flags as output:\n\n### needsQuotes\n\nQuotes can only be omitted if the property name is a numeric literal or a valid identifier name:\n\n```js\nvar obj = {\n        nonQuoted: true,\n        'must-be-quoted' : true\n    };\n```\n\n### needsBrackets\n\nDot notation can only be used when the property name is a valid identifier name:\n\n```js\nobj.bracketFree = true; //use the supreme dot notation\nobj['requires-brackets'] = true; //string must be inside brackets to be used as property\n```\n\n### es3Warning\n\nShould you want to support ES3, you cannot use some identifiers:\n```js\nobj['var'] //-> invalid in ES3\nvar obj = {\n        goto: true //-> invalid in ES3\n    };\n```\n\n### quotedValue\n\nYour quoted string in case there are problematic characters.\n\n## API\n\n`unquotedValidator(input)`\n\n### input\n\nType: `String`\n\nProperty to validate\n\n## License\n\nMIT © [Gilad Peleg](https://www.giladpeleg.com)\n","maintainers":[{"name":"pgilad","email":"giladp007@gmail.com"}],"time":{"modified":"2022-06-28T05:16:18.013Z","created":"2014-08-30T08:01:34.252Z","0.1.2":"2014-08-30T08:01:34.252Z","1.0.0":"2014-10-27T16:44:25.714Z","1.0.1":"2017-10-25T20:29:19.271Z","1.0.2":"2017-10-26T07:06:08.768Z","1.1.0":"2019-02-13T09:24:22.914Z"},"homepage":"https://github.com/pgilad/unquoted-property-validator#readme","keywords":["string","literal","mathias","brackets","dot notation","validation","code-style"],"repository":{"type":"git","url":"git+https://github.com/pgilad/unquoted-property-validator.git"},"author":{"name":"Gilad Peleg","email":"giladp007@gmail.com","url":"http://giladpeleg.com"},"bugs":{"url":"https://github.com/pgilad/unquoted-property-validator/issues"},"license":"MIT","readmeFilename":"readme.md","users":{"pgilad":true}}