Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@anandaroop/yat

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anandaroop/yat - npm Package Compare versions

Comparing version 0.3.0 to 1.0.1

src/components/Yat/__snapshots__/spec.js.snap

13

package.json
{
"name": "@anandaroop/yat",
"version": "0.3.0",
"version": "1.0.1",
"description": "A silly geolocation component",

@@ -20,2 +20,3 @@ "main": "./lib/index.js",

"babel-preset-react": "^6.24.1",
"jest": "^20.0.4",
"react": "^15.6.1",

@@ -26,9 +27,13 @@ "react-dom": "^15.6.1",

"scripts": {
"build": "rm -rf lib && babel src --out-dir lib",
"transpile": "rm -rf lib && babel src --ignore spec.js,stories.js --out-dir lib",
"build-storybook": "build-storybook",
"bundle": "webpack",
"publish": "npm publish --access public",
"prepare": "yarn run build",
"prepare": "yarn run transpile",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"test": "jest"
},
"dependencies": {
"react-test-renderer": "^15.6.1"
}
}

@@ -62,9 +62,30 @@ # yat

- Component source code lives under `/src/components`
- Use Storybook for a nice developer experience, and to document
Component source code lives under `/src/components`.
```sh
cd yat
yarn run storybook
open http://localhost:6006
Implementations, specs and stories are all co-located under each component directory.
```
src/components/
└── Yat
├── __snapshots__
├── index.js
├── spec.js
└── stories.js
```
### Testing
Use Jest for behavior and snapshot testing
```
$ yarn test
```
### Stories
Use Storybook for a nice developer experience, and to document
```
$ yarn run storybook
$ open http://localhost:6006
```
import React, { Component } from 'react'
const coordinateString = (coordinates, order) => {
return order === 'lat,lon'
? `${coordinates.latitude}, ${coordinates.longitude}`
: `${coordinates.longitude}, ${coordinates.latitude}`
}
class Yat extends Component {

@@ -26,5 +31,6 @@ constructor(props) {

const { isLocated, longitude, latitude } = this.state
const { order } = this.props
return (
<div>
{isLocated ? `${longitude}, ${latitude}` : 'locating…'}
{isLocated ? coordinateString({ longitude, latitude }, order) : 'locating…'}
</div>

@@ -35,2 +41,6 @@ )

Yat.defaultProps = {
order: 'lon,lat'
}
export default Yat
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc