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

@localized/core

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@localized/core

Core for @localized pacakges

  • 0.3.1-alpha
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@localized/ core

This package is not intended for usage, instead it exposes functions common to all @localized packages.

Contributing

Adding a function

Open the necessary file and just add your function! (TypeScript)

Example:

// array.ts

export function tail() {
  return function<A>(array: A[]) {
    return array.slice(1);
  }
}

As you can see, the function should take no arguments and return another function doing the necessary operations.

Adding a file

Create the new file, add all the functions you need then go in main.ts, import it (naming it fileName or concurrentFileName or sequentialFileName based on type) and export it:

// foo.ts

export function lots() {
  return function (...f: (...args: any[]) => any) {
    for (let funct of f) {
      console.log(funct());
    }
  }
}
// sequential/foo.ts

export function lots() {
  return async function (...f: (...args: any[]) => Promise<any>) {
    for (let funct of f) {
      console.log(await funct());
    }
  }
}
// main.ts

import * as foo from './foo';
import * as sequentialFoo from './sequential/foo';

export = {
  // ...
  foo
  // ...
  sequential: {
    // ...
    foo: sequentialFoo
    // ...
  }
}

Finalizing

Run npm test and push.

License

MIT

FAQs

Package last updated on 06 Dec 2020

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