Skip to content

Commit

Permalink
Merge pull request #26 from jfrazx/develop
Browse files Browse the repository at this point in the history
feat: executor property
  • Loading branch information
jfrazx authored May 20, 2023
2 parents abc0b95 + 0b4e851 commit 0e76d0a
Show file tree
Hide file tree
Showing 28 changed files with 19,627 additions and 11,052 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ master ]
branches: ['master', 'develop']
pull_request:
branches: [ master ]
branches: ['master', 'develop']
schedule:
- cron: '33 20 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{matrix.language}}'
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
workflow_run:
workflows: ['Snyk Security Check', 'Tests']
branches: [master]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest

permissions:
packages: write
contents: write

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
11 changes: 11 additions & 0 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Snyk Security Check
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tests

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: |
npm ci
npm test
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

*.map
*.js
*.log
Expand All @@ -9,11 +8,14 @@ logs
*.lcov

!examples/**/*
dist/
build/
dist/

build-examples/
.parcel-cache/
node_modules/
.nyc_output/
coverage/
.yarn/

*/.DS_Store
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run coverage:test
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

exec < /dev/tty && npx cz --hook || true
16 changes: 12 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@ tslint.json
.prettierrc
.releaserc
.nycrc.json
cspell.json
*.lcov
.yarnrc.yml
yarn.lock
mocha.opts

.nyc_output/
.env.*

!*.d.ts

typings/
node_modules/
examples/
build-examples/
spec/
src/
test/
docs/
scripts/
.nyc_output/
.vscode/
coverage/
.yarn/
.github/
coverage/
.husky/
.parcel-cache/
16 changes: 8 additions & 8 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"require": ["ts-node/register", "source-map-support/register"],
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": true,
"lines": 99,
"reporter": ["lcov", "text-summary", "html"],
"tmp-directory": ".nyc_output",
"extension": [".ts", ".tsx"],
"produce-source-map": true,
"report-dir": "./coverage",
"check-coverage": true,
"statements": 99,
"functions": 99,
"branches": 87,
"all": false,
"cache": true,
"report-dir": "./coverage",
"extension": [".ts", ".tsx"],
"tmp-directory": ".nyc_output",
"reporter": ["lcov", "text-summary", "html"],
"require": ["ts-node/register", "source-map-support/register"],
"all": false,
"lines": 99,
"exclude": [
"test/**/*",
"**/*.d.ts",
Expand Down
4 changes: 0 additions & 4 deletions .releaserc

This file was deleted.

27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Jason Franz <jfrazx> staringblind at gmail.com
Copyright (c) 2023 jfrazx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ expect(array[1]).to.equal(7);

All options have default values.

| Option | Default Value | Description |
| :----------: | :-----------: | -------------------------------------------------------------------------------------------- |
| wrap | {} | The object to wrap |
| shallowCopy | true | Only create shallow copies of `defaultValue` objects |
| setUndefined | false | Set undefined values with `defaultValue` |
| defaultValue | undefined | The value to return if resolved value is undefined |
| setCriteria | () => false | Function that can override value to be set with the `defaultValue` |
| execute | false | If true and `defaultValue` is a function it will be executed and the result returned |
| noCopy | false | Indicates if non-primitive default values should be returned as-is |
| reuseMapKey | true | If true and default value is a Map the key will be reused, otherwise shallowCopy rules apply |
| Option | Default Value | Description |
| :----------: | :-----------: | ---------------------------------------------------------------------------------------------------------------------- |
| wrap | {} | The object to wrap |
| shallowCopy | true | Only create shallow copies of `defaultValue` objects |
| setUndefined | false | Set undefined values with `defaultValue` |
| defaultValue | undefined | The value to return if resolved value is undefined |
| setCriteria | () => false | Function that can override value to be set with the `defaultValue` |
| execute | false | If true and `defaultValue` is a function it will be executed and the result returned. Receives property being accessed |
| noCopy | false | Indicates if non-primitive default values should be returned as-is |
| reuseMapKey | true | If true and default value is a Map the key will be reused, otherwise shallowCopy rules apply |

---

Expand Down
Loading

0 comments on commit 0e76d0a

Please sign in to comment.