Skip to content

Commit b7f57ac

Browse files
committed
Moved to GitHub actions
1 parent 80e2cdd commit b7f57ac

File tree

10 files changed

+834
-29
lines changed

10 files changed

+834
-29
lines changed

.github/workflows/node.js.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: build
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'npm'
24+
- run: npm ci
25+
- run: npm run build --if-present
26+
- run: npm test
27+
- run: npm run coverage --if-present
28+
- name: Coveralls
29+
uses: coverallsapp/github-action@master
30+
with:
31+
github-token: ${{ secrets.GITHUB_TOKEN }}

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
package-lock=false
2+
package-lock=true

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright © 2024-today, Andrea Giammarchi, @WebReflection
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the “Software”), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software
10+
is furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included
13+
in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21+
IN THE SOFTWARE.

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# JS Proxy
2+
3+
[![build status](https://github.com/WebReflection/js-proxy/actions/workflows/node.js.yml/badge.svg)](https://github.com/WebReflection/js-proxy/actions) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/js-proxy/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/js-proxy?branch=main)
4+
5+
<sup>**Social Media Photo by [Vinu T](https://unsplash.com/@happy_pixel?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash) on [Unsplash](https://unsplash.com/photos/a-small-waterfall-in-the-middle-of-a-forest-DHo1nNUI0y4?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)**</sup>
6+
7+
The one-stop shop solution for JS Proxies and FFI APIs.
8+
9+
## ... coming soon ...

esm/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import * as handlerTraps from 'proxy-target/traps';
22

33
import { ARRAY, FUNCTION, NULL, OBJECT, UNDEFINED } from 'proxy-target/types';
4+
45
import { bound } from 'proxy-target';
56
import { create, drop } from 'gc-hook';
67

78
const { Object, Proxy, Reflect } = globalThis;
89

910
const { isArray } = Array;
10-
const { create: extend, entries, values } = Object;
11+
const { ownKeys } = Reflect;
12+
const { create: extend, values } = Object;
1113

1214
const traps = new Set([...values(handlerTraps)]);
1315
const typesOf = new WeakMap;
@@ -38,7 +40,8 @@ const proxy = ($, target, handler, token = $) => {
3840

3941
export const proxyOf = namespace => {
4042
const proxies = { free: token => drop(token) };
41-
for (const [type, traps] of entries(namespace)) {
43+
for (const type of ownKeys(namespace)) {
44+
const traps = namespace[type];
4245
switch (type) {
4346
case ARRAY: {
4447
const handler = extendHandler(traps, type, method => ({

esm/traps.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from 'proxy-target/traps';
2+
export const DESTRUCT = 'destruct';

esm/types.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from 'proxy-target/types';

0 commit comments

Comments
 (0)