{"_id":"@atlaskit/privacy-safe","_rev":"6-80c420abf275a599728c92d03fc7e2ac","name":"@atlaskit/privacy-safe","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@atlaskit/privacy-safe","version":"1.0.0","keywords":["atlaskit","internal","privacy","safe"],"author":{"name":"Atlassian Pty Ltd"},"license":"Apache-2.0","_id":"@atlaskit/privacy-safe@1.0.0","maintainers":[{"name":"Andrew Wakeling"},{"name":"George Burrows"}],"homepage":"https://bitbucket.org/atlassian/atlaskit#readme","dist":{"shasum":"c560de4caabe0edb16208639b811e85f33eda30c","tarball":"https://registry.npmjs.org/@atlaskit/privacy-safe/-/privacy-safe-1.0.0.tgz","integrity":"sha512-KXRth9oiCRTngVjD44L6FoxQ+BuLfsqrZETjmCeSCM+pfHiuThXiSfuah1kohNaH+nhXDNRmFQXJa1kmFSDtAQ==","signatures":[{"sig":"MEUCIAfBYwHpj4NOSLaA1KmUdFkBYdI/fRe4KHBAK1CEmrpwAiEAlw9DClLq0k2MsjS3MCKCnnq1Yv+Osp7l57UVqkIqeIE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/bundle.js","_from":"packages/privacy-safe","files":["dist"],"config":{"access":"public"},"_shasum":"c560de4caabe0edb16208639b811e85f33eda30c","gitHead":"cfeeb7ab99c800f394b50cea39305bacda989812","scripts":{"test:unit":"../../node_modules/.bin/jest -c ../../build/config/jest.config.js","prepublish":"../../node_modules/.bin/in-publish && { cd ../.. && npm run prepublish-with-babel/single @atlaskit/privacy-safe; } || ../../node_modules/.bin/not-in-publish"},"webpack":"dist/bundle-cjs.js","_npmUser":{"name":"atlaskit","email":"design-platform@atlassian.com"},"_resolved":"file:packages/privacy-safe","deprecated":"This package is no longer used and has been deprecated.","repository":{"url":"git+https://bitbucket.org/atlassian/atlaskit.git","type":"git"},"_npmVersion":"3.10.7","description":"Utilities to help ensure privacy is respected with analytics","directories":{},"_nodeVersion":"6.9.2","ak:webpack:raw":"src/index.js","_npmOperationalInternal":{"tmp":"tmp/privacy-safe-1.0.0.tgz_1503580832814_0.8161735534667969","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-08-24T13:20:33.846Z","modified":"2025-01-29T23:28:13.069Z","1.0.0":"2017-08-24T13:20:33.846Z"},"author":{"name":"Atlassian Pty Ltd"},"license":"Apache-2.0","homepage":"https://bitbucket.org/atlassian/atlaskit#readme","keywords":["atlaskit","internal","privacy","safe"],"repository":{"url":"git+https://bitbucket.org/atlassian/atlaskit.git","type":"git"},"description":"Utilities to help ensure privacy is respected with analytics","maintainers":[{"email":"eng-development-tooling-secrets-and-artifacts@atlassian.com","name":"atlassianartifactteam"}],"readme":"[![AtlasKit component registry](https://img.shields.io/badge/AtlasKit-components-FF5230.svg)](http://atlaskit.atlassian.com)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://Commitizen.github.io/cz-cli/)\n[![semantic-release](https://img.shields.io/badge/GitHub-semantic_release-ffab00.svg)](https://github.com/semantic-release/semantic-release)\n[![Report an issue](https://img.shields.io/badge/Report-an_issue-6554C0.svg)](http://go.atlassian.com/atlaskit-issues)\n\n# PrivacySafe\n\nThis package provides some utility functions to help mark strings as being privacy safe (potentially for consumption in analytics).\n\n## Installation\n\n```sh\nnpm install @atlaskit/privacy-safe\n```\n\n## Using the component\n\n### privateSafeString\nCreate a wrapper which signifies that the supplied string is privacy safe.\nUse privateSafeString when you are certain that the string or its source isn't user entered data.\nIf you pass any non-string type (e.g. null, undefined), the string will be marked being unsafe.\n\n```javascript\nimport { privacySafeString } from '@atlaskit/privacy-safe';\nconst safeString = privateSafeString('projects');\nsafeString.value // 'projects'\n```\n\n### isPrivacySafeString\nCheck to see if the supplied object is a safe string.\n\n```javascript\nimport { privacySafeString, isPrivacySafeString } from '@atlaskit/privacy-safe';\nconst safeString = privateSafeString('projects');\nisPrivacySafeString(safeString); // true\n```\n\n### dangerouslyCreateSafeString\nCreate a safe string but acknowledge that it is user entered data. (eg. NPS survey responses).\nIf you pass any non-string type (e.g. null, undefined), the string will be marked being unsafe.\n\n```javascript\nimport { dangerouslyCreateSafeString } from '@atlaskit/privacy-safe';\nfunction create(nps) {\n  const safeString = dangerouslyCreateSafeString(nps.response);\n}\n```\n\n### markAsSafe\nProvide a list of acceptable values and only when an allowed value matches, create a safe string.\n\n```javascript\nimport { markAsSafe, isPrivacySafeString } from '@atlaskit/privacy-safe';\nisPrivacySafeString(markAsSafe('project', 'issue')('issue')); // true\nisPrivacySafeString(markAsSafe('project', 'issue')('corporation')); // false\n```\n\n_* Please note that this module could have dependencies that are governed by the Atlassian Design Guidelines license which will be automatically included on install. Each dependency has a license file that indicates whether the Atlassian Design Guidelines license applies._\n\n## We're here to help!\n\nLet us know what you think of our components and docs, your feedback is really important for us.\n\nAre you in trouble? Read through our [contribution guidelines](https://bitbucket.org/atlassian/atlaskit/src/HEAD/CONTRIBUTING.md) and raise an issue to us.\n\n","readmeFilename":"README.md"}