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

auto-todo

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

auto-todo

Automatically generate code that does the job!

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Auto-Todo

Ever wanna not write code? Auto-Todo is your friend. Instead of writing logic, you get to lay back and write tests!

  • ✅ Test-driven development
  • ✅ 100% test coverage
  • ✅ No-code development
import * as assert from "assert"
import { todo } from "auto-todo"

const add = todo<(a: number, b: number) => number>(
    add => {
        assert.equal(add(1, 2), 3)
        assert.equal(add(2, 3), 5)
    },
    { args: 2 },
)

add(1, 2) // 3
add(2, 3) // 5
add(5, 8) // 13, hopefully
Fun question! Find a bypass, where add(1, 2) is 3, and add(2, 3) is 5, but add(5, 8) is NOT 13

(b * 2) - 1!

  • 2 * 2 - 1 = 3
  • 3 * 2 - 1 = 5
  • 8 * 2 - 1 = 15

In the scope of auto-todo, letting this happen is considered a user error. Write your tests well!

Installation

pnpm install auto-todo
yarn add auto-todo
npm install auto-todo

Notes

  • Uses eval to generate code
  • It takes a little time to generate the code! Or a big time!
    • Math.random() is used generously
    • The complexity of the requested function plays a role. a + b will generate faster than a * 5 + b * 2 - 4

FAQs

Package last updated on 17 Jul 2023

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