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

aidly

Package Overview
Dependencies
Maintainers
0
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aidly

Tool library.

  • 1.12.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-94.74%
Maintainers
0
Weekly downloads
 
Created
Source

aidly

NPM version

English | 简体中文

A collection of pure JavaScript runtime utility functions that is highly tree-shaking.

Debugging platform

https://imtaotao.github.io/aidly/

Usage

import { clone } from 'aidly';

console.log(clone(/a/ig)); // `/a/gi`

CDN

<script src="https://unpkg.com/aidly/dist/aidly.umd.js"></script>
<script>
  const { clone } = window.Aidly;
  console.log(clone(/a/ig)); // `/a/gi`
</script>

API

Here are all the functions. If you need any other functions, please open a discussion in the Issues section.

https://unpkg.com/browse/aidly/dist/index.d.ts

ApiDescription
throttleThrottle function, the first time it triggers the function call immediately.
debounceDebounce function, the first time it is called, it will trigger the function call immediately.
loopSliceSlice the specified number of loops, the default slicing time is 17ms.
colorsSome default color values.
uuidGenerate a uuid.
noopEmpty arrow function.
qsParseQuery string parsing.
qsStringifyQuery string formatted as a string.
rgbToHslRGB to Hsl.
rgbToHexRGB to Hexadecimal.
rgbToAnsi256RGB to Ansi256.
hslToRgbHsl to RGB.
hexToRgbHexadecimal to RGB.
ansi256ToRgbAnsi256 to RGB.
randomColorGenerate a random color value, the default format is RGB.
assertAssert a condition.
rafCompatibility handling for requestAnimationFrame.
nowCompatibility handling for Date.now and performance.now.
idleCallbackCompatibility handling for requestIdleCallback.
isAbsoluteDetermines whether a path is an absolute path in the browser.
lastReturns the nth to last element in an array (default is the last element).
uniqArray deduplication.
hasOwnObject.hasOwnProperty.call alias.
slashReplace \ with /.
makeMapConvert an Array<string> to a Record<string, (key) => boolean>.
decimalPlacesReturn the number of decimal places in a number.
randomReturn a random number in a specified range. If only one parameter T is specified, the range defaults to 0 ~ T.
onceGenerates a higher-order function that will be executed only once.
sleepPause for n ms, return a promise.
removeRemove the specified element from a Array or Set.
mapPerform a map operation on Object, Array, Set and return a brand new copy.
toCamelCaseConvert a string to camelCase or pascalCase naming, processing _ and - by default.
capitalizeConverts the first letter of a string to uppercase.
getExtnameGet the extname of a url.
getIteratorFnGet an object's iterator function.
sortKeysSort the keys of an Object and return a new copy.
clearUndefClearing undefined values ​​from an object.
pickSelect the required attribute values ​​from an object and return a new copy.
omitFilters attributes entered from an object and returns a new copy.
unindentFormatting template strings (unindet(string)).
deferredReturns a deferred object.
supportWasmCheck if the current environment supports WebAssembly.
isBrowserCheck if you are in the browser environment.
isNilCheck if a value is null or undefined.
isNumberCheck if a value is a Number.
isStringCheck if a value is a String.
isFunctionCheck if a value is a Function.
isObjectCheck if a value is an Object.
isPlainObjectCheck if a value is a plainObject.
isDateCheck if a value is a Date.
isRegExpCheck if a value is a RegExp.
isSetCheck if a value is a Set.
isWeakSetCheck if a value is a WeakSet.
isMapCheck if a value is a Map.
isWeakMapCheck if a value is a WeakMap.
isPromiseCheck if a value is a PromiseLike.
isPrimitiveValueCheck if a value is a primitive value.
isEmptyObjectCheck if an object is empty object.
isWhitespaceChecks if a character is the whitespace character.
isWindowCheck if an object is a window object.
isBase64Check if a string is a valid base64 string.
isInBoundsCheck if a number is within a specified range (isInBounds([1, 5], 2)).
isIPCheck if it is a valid IP address.
isDomainCheck if it is a valid domain name.
isPortCheck if it is a valid port.
isEmailCheck if it is a valid email.
isPhoneCheck if it is a valid mobile number.
isCNPhoneCheck if it is a valid mobile phone number in mainland China.
rootAlias ​​for global objects, compatible with different environments.
inlineStringQuantify the string constant.
execExecute JavaScript code, which can be run in cjs, esm, or normal mode, with normal mode being the default.
mathExprEvaluateExecute mathematical expressions.
batchProcessUsed for transactional batch processing, for example: const set = batchProcess({ ms: 50, processor(ls) { ... } });
createCacheObjectCreating an in-memory cache system.
jsonParseParse the json string into an object, able to handle reference relationships (including circular references).
jsonStringifyFormat objects as json strings, able to handle reference relationships (including circular references).
mergeMerges two objects or arrays and returns a new object, without worrying about circular references.
cloneClone an object that allows circular references, types include Object, Array, TypeArray, Set, Map, RegExp, Date, Promise, Buffer, Response, setter/getter, Non-enumerable properties (not cloned by default).

Keywords

FAQs

Package last updated on 25 Nov 2024

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