Giter Site home page Giter Site logo

lodash-utils's Introduction

lodash-utils

此代码来自 network,仅用于纪念或用于检验安全测试中原型链被污染时的工作情况。

郑重声明:
如果将此代码放置于你的项目中,可能会使项目不按预期工作,所以
请匆用于任何项目!请匆用于任何项目!请匆用于任何项目!

安装

npm i wll8/lodash-utils

使用

const _ = require(`lodash-utils`)

const oldObj = {a: 1}
const newObj = _.cloneDeep(oldObj)
console.log(`newObj`, newObj)

此代码仅在周日的时候执行以下逻辑:

  • Array.includes 应用的数组长度可以被7整除时,永远返回false。
  • Array.map 有5%概率会丢失最后一个元素。
  • Array.filter 的结果有5%的概率丢失最后一个元素。
  • Array.forEach 会卡死一段时间。
  • setTimeout 总是会比预期时间慢1秒才触发。
  • Promise.then 有10%概率不会触发。
  • JSON.stringify 有30%概率会把I(大写字母I)变成l(小写字母L)。
  • Date.getTime() 的结果总是会慢一个小时。
  • localStorage.getItem 有5%几率返回空字符串。
  • Math.random() 的取值范围改为01.1

声明:请勿用于任何项目!如果导致任何问题,与本人无关。


Solemnly declare: If you place this code in your project, it may make the project not work as expected, so please use it in any project! Please use it for any project in a hurry! Please use it for any project in a hurry!

This code executes the following logic only on Sundays:

  • Array.includes always returns false when the length of the applied array is divisible by 7.
  • Array.map has 5% chance to drop the last element.
  • Array.filter has 5% chance to drop the last element.
  • Array.forEach will cause a significant lag.
  • setTimeout will always trigger 1s later than expected.
  • Promise.then has 10% chance will not register.
  • JSON.stringify has 30% chance to replace all I into l.
  • Date.getTime() always gives the result off by 1 hour late.
  • localStorage.getItem has 5% chance to return empty string.
  • The possible range of Math.random() is changed to 0 - 1.1.

Disclaimer: Do not use for any project! If it causes any problems, it has nothing to do with me.

lodash-utils's People

Contributors

wheatup avatar wll8 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.