
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
@edwardxyt/gws-javascripts
Advanced tools
用于nodejs 常用工具类。
npm install @edwardxyt/gws-javascripts
import gwsJS from "@edwardxyt/gws-javascripts";
数组排序
import {ArraySort} from "@edwardxyt/gws-javascripts";
let {bubbleSort} = new ArraySort();
// 冒泡排序
bubbleSort([1,2,3]).then(data => {
console.log(data)
})
动态组件 具体请看 @edwardxyt/gws-components
import { Components } from '@edwardxyt/gws-javascripts';
Components.showAlert('URL中没有获取到 fincId');
简单的内存缓存
创建实例
import { Cache } from '@edwardxyt/gws-javascripts'
let cache = new Cache()
set get
set 通过一个key 设置value和有效期
import { Cache } from '@edwardxyt/gws-javascripts';
let cache = new Cache();
cache.set('key', 'value', 10);
// => null
cache.get('key');
// => 'value'
// ... 10s 后
cache.get('key');
// => null
监听浏览器DOM加载状态, 一旦DOM加载完成, 立即执行, 跟jQuery.ready方法相同
import { DOMReady } from '@edwardxyt/gws-javascripts'
DOMReady(()=>{
// 会在DOM加载完成之后再执行
somethine()
})
当前网页嵌入到App中, 需要与app通信时, 需要调用这个方法
import { NativeBridgeFactory } from '@edwardxyt/gws-javascripts';
let receive_handler = function(receive_data){
console.log(receive_data) // => {type: '', value: ''}
// use this method receive data from App
};
const NativeBridge = new NativeBridgeFactory('Easyloan888');
// 设置接受来自App的方法
NativeBridge.onReceive(data => (){
console.log(data)
})
NativeBridge.trigger('close'); // 关闭当前webview
NativeBridge.toNative('coupon'); // 到app原生的优惠券页面
正则集合
import { rules } from '@edwardxyt/gws-javascripts'
// ... code
<FormItem
{...formItemLayout}
label="真实姓名"
>
{getFieldDecorator('realName', {
initialValue: current.realName,
rules: [
{
required: true,
message: '必填!',
},
{
pattern: rules.realNameReg,
message: rules.realNameMsg,
},
],
})(<Input placeholder="请输入真实姓名!" />)}
</FormItem>
// ...code
FAQs
utils function class tool
We found that @edwardxyt/gws-javascripts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.