open-index/open-npm huggingface dataset:
npm package: @shnhrrsn/babel-plugin-transform-isnil
Description: replace the comparing of null or undefined with isNil
Author: MaxMEllon
Latest version: 1.2.0

# @shnhrrsn/babel-plugin-transform-isNil

## Legacy
This has been updated for Babel 7 for backwards compatibilty of existing code, however new code should migrate to the chaining operator: **[@babel/plugin-proposal-optional-chaining](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining)**

## Forked from MaxMEllon
This was forked from [MaxMEllon/babel-plugin-transform-isNil](https://github.com/MaxMEllon/babel-plugin-transform-isNil), which has since been deprecated, and updated to work with Babel 7.

## @shnhrrsn/babel-plugin-transform-isNil

<a href="https://www.npmjs.com/package/@shnhrrsn/babel-plugin-transform-isNil">
	<img src="https://nodei.co/npm/@shnhrrsn/babel-plugin-transform-isNil.png"/>
</a>
<a href="https://github.com/sindresorhus/xo">
  <img src="https://img.shields.io/badge/code_style-XO-5ed9c7.svg"/>
</a>

### About

I like Existential Operator in `CoffeeScript`.
CoffeeScript can be written as follows:

```coffee
hoge?
```

Become to `JavaScript`

```js
hoge == null
```

Same meaning

```
hoge === null || hoge === undefined
```

I want to do the same thing in `JavaScript`.

### Installation

```bash
$ npm install --save @shnhrrsn/babel-plugin-transform-isNil
```

Example
---

**In**

```js
if (foo.isNil) {
  console.log('foo is null or undefined');
}
```

**Out**

```js
if (foo === null || foo === undefined) {
  console.log('foo is null or undefined');
}
```

**In**

```js
if (hoge.poge.isNil && foo.bar.isNil) {
  console.log('hoge.poge and foo.bar is null or undefined');
}
```

**Out**

```js
if ((hoge.poge === null || hoge.poge === undefined) && (foo.bar === null || foo.bar === undefined)) {
  console.log('hoge.poge and foo.bar is null or undefined');
}
```

**In**

```js
if (hoge.poge().isNil) {
  console.log('returned value of hoge.poge() function is null or undefined');
}
```

**Out**

```js
if (hoge.poge() === null || hoge.poge() === undefined) {
  console.log('returned value of hoge.poge() function is null or undefined');
}
```

**In**

```js
if (hoge.poge(hoge).isNil) {
  console.log('returned value of hoge.poge() function is null or undefined');
}
```

**Out**

```js
if (hoge.poge(hoge) === null || hoge.poge(hoge) === undefined) {
  console.log('returned value of hoge.poge() function is null or undefined');
}
```

### Usage

#### Via `.babelrc`

```json
{
  "plugins": ["@shnhrrsn/plugin-transform-isNil"]
}
```

### Development

Requirement global

* Node v4 or above

```bash
$ git clone https://github.com/shnhrrsn/babel-plugin-transform-isNil
$ cd babel-plugin-transform-isNil
$ npm install

$ npm test
```

### Special Thanks

- [@shnhrrsn](https://github.com/shnhrrsn)

LICENSE
---
[MIT](./LICENSE.txt)
npm package: @shnhrrsn/elasticquery
Description: <p align="center"> <a href="https://travis-ci.org/shnhrrsn/elasticquery"><img src="https://img.shields.io/travis/shnhrrsn/elasticquery.svg" alt="Build Status"></a> <a href="https://www.npmjs.com/package/@shnhrrsn/elasticquery"><img src="https://img.shield
Latest version: 2.0.1

<p align="center">
<a href="https://travis-ci.org/shnhrrsn/elasticquery"><img src="https://img.shields.io/travis/shnhrrsn/elasticquery.svg" alt="Build Status"></a>
<a href="https://www.npmjs.com/package/@shnhrrsn/elasticquery"><img src="https://img.shields.io/npm/dt/@shnhrrsn/elasticquery.svg" alt="Total Downloads"></a>
<a href="https://www.npmjs.com/package/@shnhrrsn/elasticquery"><img src="https://img.shields.io/npm/v/@shnhrrsn/elasticquery.svg" alt="Latest Version"></a>
<a href="https://www.npmjs.com/package/@shnhrrsn/elasticquery"><img src="https://img.shields.io/npm/l/@shnhrrsn/elasticquery.svg" alt="License"></a>
</p>

# ElasticQuery

ElasticQuery is an easy to use query builder for the rather verbose ElasticSearch DSL.  It covers a large portion of the ES DSL, but does not currently have full coverage — pull requests welcome!

## Installation

### yarn

```bash
yarn add @shnhrrsn/elasticquery
```

### npm

```bash
npm install --save @shnhrrsn/elasticquery
```

## Documentation

TODO! In the mean time, check out some [examples](#examples) below, the [tests](tests/) and [source code](src/).

## Examples

### Create a Connection

```javascript
const { ElasticSearch } = require('@shnhrrsn/elasticquery')
const search = new ElasticSearch({
  host: 'localhost:9200'
  index: 'locations'
})
```

### Conditions

```javascript
const results = await search.query('doc').where('country', 'US')
```

```javascript
const results = await search.query('doc').whereNot('country', 'US')
```

```javascript
const results = await search.query('doc').whereIn('country', [ 'US', 'CA' ])
```

```javascript
const query = search.query('doc')
query.distance('location', '5mi', '40.782420', '-73.965600')
query.orDistance('location', '10mi', '40.782420', '-73.965600')
```

```javascript
const query = search.query('doc')
query.range('established', '1700', '1800')
```

### Aggregating

```javascript
await search.query('doc').aggregate(agg => agg.terms('field'))
```

```javascript
search.query('doc').aggregate(agg => {
  agg.terms('field', term => {
    term.aggregate(query => {
      query.sum('nested.sum1', sum => sum.as('sum1'))
      query.sum('sum2')
    })
  })
})
```

```javascript
search.query('doc').aggregate(aggregate => {
  aggregate.filter(filter => {
    filter.where('abc', 123)
  })

  aggregate.dateHistogram('field', histogram => {
    histogram.interval('day')
    histogram.timezone('-05:00')
    histogram.bounds({ min: 'now-30d/d', max: 'now/d' })
    histogram.minDocCount(0)
    histogram.size(10)
  })
})
```

## License

`ElasticQuery` was created by [Shaun Harrison](https://github.com/shnhrrsn) and is made available under the [MIT license](LICENSE).
npm package: @sho-js/analytics
Description: ## Installation
Author: Wearesho
Latest version: 6.0.2

# Wearesho Analytics

## Installation

```bash
npm i --save @sho-js/analytics
```

## Usage

### Setup

Create instance of [WeareshoAnalytics.Service](./src/Service.ts) with following params:

```typescript
import * as WeareshoAnalytics from "@sho-js/analytics";

const axiosInstance = Axios.create({baseURL: "https://wearesho.public.api.com/"});

const token = ""; // your way to receive unique fingerprint value
const components = {
    resolution: "1920,1080",
    offset: 3,
    // ... other key/value pairs
};

const fingerPrint: FingerPrint = { token, components }

const analytics = await WeareshoAnalytics.Service.create(axiosInstance, fingerPrint);
```
where
- `axiosInstance` - instance of [Axios](https://github.com/axios/axios). Required.
- `fingerPrint` - fingerprint data. Required.

### Actions

```ts
analytics.action("some unique action name");
```

```ts
analytics.input("fieldName", ["valuePrev", "valueNext"]);
```

```ts
analytics.user(1 /* UserId */);
```

### Helpers

```tsx
const actionHandler = analytics.handler(analytics.action, "some unique action name");
const inputHandler = analytics.handler(analytics.input, "fieldName", ["valuePrev", "valueNext"]);
const userHandler = analytics.handler(analytics.input, 1);

<button onClick={actionHandler}/>
<button onClick={inputHandler}/>
<button onClick={userHandler}/>
```
npm package: @sho-js/build-copyright
Description: Build Copyright declarations
Author: Alexander
Latest version: 1.1.6

# Build Copyright

Purpose: for internal usage.

## Install
```bash
npm i @sho-js/build-copyright@^1.1
```

## Usage
### Auto-configure Webpack

```js
import * as bc from "@sho-js/build-copyright/webpack";

// webpack.config.js
const configuration = {
    entry: ["./src/index.js"],
    plugins: [
        // your plugins here
    ],
};

return bc.webpack.append(
    configuration,
    /**
    * Module with application name, version and feedback link,
    * may be `package.json` etc.
    */
    "meta.json" 
);
```
### Manual set up
Add webpack.EnvironmentPlugin to set-up
```js
import * as bc from "@sho-js/build-copyright/webpack";

// webpack.config.js
return {
    entry: [bc.webpack.getEntry(), "./src/index.js"],
    plugins: [
        new bc.webpack.EnvironmentPlugin(
            "meta.json" // module with application name, version and feedback link
        ),
        // ... other plugins
    ]
};
```

## License
[MIT](./LICENSE)
npm package: @sho-js/fingerprint
Description: Library for generating fingerprint
Author: Alexander Letnikow
Latest version: 3.0.1

# Wearesho Fingerprint Generator

## Installation

```bash
npm i --save @sho-js/fingerprint
```

Peer dependencies:
- [fingerprintjs2](https://github.com/Valve/fingerprintjs2)
- [js-cookie](https://github.com/js-cookie/js-cookie)

## Usage

### Setup and generation

```typescript
import * as FingerPrint from "@sho-js/fingerprint";

// generating token based on random and current timestamp
FingerPrint.simple()
    .then((randomToken) => console.log(randomToken));

// https://github.com/Valve/fingerprintjs2
FingerPrint.fp2()
    .catch(FingerPrint.simple) // fallback to random token on error
    .then((fp2token) => console.log(fp2token));

// https://github.com/js-cookie/js-cookie
FingerPrint.cookie(
    FingerPrint.fp2(), // fallback if no cookie
    "cookie.name",
    { // cookie attributes, see js-cookie for details
        domain: ".wearesho.com",
    }
)
```
npm package: @sho-js/react-cpa
Description: React CPA Integration
Author: Alexander
Latest version: 4.0.1

# React CPA 

Integrate [@sho-js/cpa](https://github.com/wearesho-team/cpa-frontend) with React.

## Installation
Using [npm](https://npmjs.com/package/@sho-js/react-cpa)

## Usage
To call onLoad:
```typescript jsx
import * as Cpa from "@sho-js/react-cpa";

export const Layout = () => (
    <Cpa.OnLoad />
);
```

## License
[MIT](./LICENSE)
npm package: @sho-ui/time-picker
Description: A clean, dropdown-based time picker component for React with TypeScript support
Latest version: 1.0.0

# Time Picker

A clean, dropdown-based time picker component for React with TypeScript support. Built with Tailwind CSS for styling and optimized for accessibility.

## Features

- 🕐 12-hour format with AM/PM selection
- 📱 Responsive design with Tailwind CSS
- 🔧 TypeScript support with full type definitions
- ♿ Accessible keyboard navigation
- 🎨 Customizable styling with className prop
- 📦 Zero runtime dependencies (peer dependencies only)

## Installation

```bash
npm install @sho-ui/time-picker
```

### Peer Dependencies

This package requires the following peer dependencies:

```bash
npm install react react-dom clsx tailwindcss tailwind-merge
```

**Note:** Tailwind CSS is required as a peer dependency. Make sure you have Tailwind CSS configured in your project.

## Usage

```tsx
import { TimePicker } from "@sho-ui/time-picker";

function App() {
  const [time, setTime] = useState("10:30 AM");

  return (
    <TimePicker
      value={time}
      onChange={(val) => setTime(val)}
      className="w-64"
    />
  );
}
```

### Props

| Prop        | Type                      | Default     | Description                                                                          |
| ----------- | ------------------------- | ----------- | ------------------------------------------------------------------------------------ |
| `value`     | `string`                  | `undefined` | The current time value in "HH:mm" format (24-hour) or "HH:mm AM/PM" format (12-hour) |
| `onChange`  | `(value: string) => void` | `undefined` | Callback function called when the time value changes                                 |
| `className` | `string`                  | `""`        | Additional CSS classes to apply to the component                                     |

### Example with Default Values

```tsx
<TimePicker value="10:30 AM" onChange={(val) => console.log(val)} />
```

## Styling

The component uses Tailwind CSS classes and can be customized using the `className` prop. The component includes:

- Default styling for the time picker container
- Dropdown menus for hour, minute, and AM/PM selection
- Hover and focus states
- Responsive design

## TypeScript

Full TypeScript support is included with exported types:

```tsx
import { TimePicker, TimePickerProps } from "@sho-ui/time-picker";

const MyComponent: React.FC<TimePickerProps> = ({ value, onChange }) => {
  // Component implementation
};
```

## License

MIT