New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-s2s-some-root-ts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-s2s-some-root-ts

generate root object

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-s2s-some-root-ts

plugin for https://github.com/akameco/s2s

Search the directory and create Root.

Install

$ npm install --save-dev babel-plugin-s2s-some-root-ts

Example

ExportType: union

IN:
OUT:
/***** Do not edit this file *****/
import { Action as Container1 } from "../examples/container1/actionTypes";
import { Action as Container2 } from "../examples/container2/actionTypes";

export type Action = Container1 | Container2;

ExportType: object

IN:
OUT:
/***** Do not edit this file *****/
import { Container1 } from "../examples/container1/reducer";
import { Container2 } from "../examples/container2/reducer";

export const reducers = {
  Container1,
  Container2
};

ExportType: array

IN:
OUT:
/***** Do not edit this file *****/
import { Epic as Container1 } from "../examples/container1/epic";
import { Epic as Container2 } from "../examples/container2/epic";

export const Epics = [Container1, Container2];

Usage

module.exports = {
  watch: './**/*.ts',
  plugins: [
    {
      test: /actionTypes.ts$/,
      plugin: ['s2s-some-root-ts', {
        input: 'containers/**/actionTypes.ts',
        output: 'types/action.ts',
        globOptions: {},
        exportType: 'object',
        importName: 'action',
        exportName: 'actions',
        prefix: 'pre_',
        suffix: '_suf',
      }],
    },
  ],
}

input

type: string
required: true

glob pattern.

output

type: string
required: true

outputh path.

globOptions

type: object
required: false

See https://github.com/isaacs/node-glob#options

exportType

type: string union|array|object
required: false
default: union

Switch output type. Please see examples.

importName

type: string
required: false
default: Directory name

Name to import from file. If not specified, the directory name is specified.

exportName

type: string
required: false
default: Root

Name to export variable (or alias).

prefix

type: string
required: false
default: empty

Prefix of export.

suffix

type: string
required: false
default: empty

Suffix of export.

FAQs

Package last updated on 15 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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