-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add demo/example project, showing how to use this library
- Loading branch information
Showing
9 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Reason / Bucklescript | ||
lib | ||
.merlin | ||
.bsb.lock | ||
*.bs.js | ||
|
||
# idea | ||
.vscode | ||
|
||
# OSX files | ||
*.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 mikaello | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Demo project for bs-clean-deep | ||
|
||
This project is only for testing that the [bs-clean-deep](https://github.com/mikaello/bs-clean-deep) bindings works as expected. | ||
|
||
## Build | ||
``` | ||
yarn build | ||
``` | ||
|
||
## Build + Watch | ||
|
||
``` | ||
yarn start | ||
``` | ||
|
||
## Run | ||
|
||
``` | ||
node src/Demo.bs.js | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "bs-clean-deep-demo", | ||
"version": "0.1.0", | ||
"sources": { | ||
"dir" : "src", | ||
}, | ||
"package-specs": { | ||
"module": "commonjs", | ||
"in-source": true | ||
}, | ||
"suffix": ".bs.js", | ||
"bs-dependencies": [ | ||
"bs-clean-deep" | ||
], | ||
"namespace": true, | ||
"refmt": 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "bs-clean-deep-demo", | ||
"version": "0.1.0", | ||
"scripts": { | ||
"build": "bsb -make-world", | ||
"start": "bsb -make-world -w", | ||
"clean": "bsb -clean-world" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"bs-platform": "^5" | ||
}, | ||
"dependencies": { | ||
"bs-clean-deep": "^0.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
open BsCleanDeep; | ||
|
||
Js.log("Demo of 'bs-clean-deep'\n"); | ||
|
||
let s = [%bs.raw {| { emptystring: '', foo: 3, emptyobject: {} } |}]; | ||
|
||
Js.log("No options:"); | ||
Js.log(CleanDeep.cleanDeep(s)); | ||
|
||
Js.log("\nWith empty objects preserved:"); | ||
Js.log(s |> CleanDeep.cleanDeep(~emptyObjects=false)); | ||
|
||
Js.log("\nWith empty objects and strings preserved:"); | ||
Js.log(CleanDeep.cleanDeep(~emptyObjects=false, ~emptyStrings=false, s)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
bs-clean-deep@^0.1.0: | ||
version "0.1.0" | ||
resolved "https://registry.yarnpkg.com/bs-clean-deep/-/bs-clean-deep-0.1.0.tgz#01cfe17d1706cfa1cecb80c7b16b695e2683f758" | ||
integrity sha512-W6zbZIHwDUylG4oBNAt+98tkMXOgD3MPCFPnQZdsz1XvXj17cY23vhgTmGON2TbiQc3vvm1bYSo3LjZhIe5PdQ== | ||
dependencies: | ||
clean-deep "^3.0.2" | ||
|
||
bs-platform@^5: | ||
version "5.0.0" | ||
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-5.0.0.tgz#f9fded818bafc3891aeb85eb4e0d95b8d8f8b4d7" | ||
integrity sha512-zxLobdIaf/r7go47hOgxcd6C0ANh7MYMEtZNb9Al7JdoekzFZI50F4GpZpP8kMh9Z+M5PoPE1WuryT4S8mT8Kg== | ||
|
||
clean-deep@^3.0.2: | ||
version "3.0.2" | ||
resolved "https://registry.yarnpkg.com/clean-deep/-/clean-deep-3.0.2.tgz#1b7096822f289cc491ca6d85af5c028cbb22fc23" | ||
integrity sha512-sLUtFxYtHc3jM9pmwyYXOLln0nnQ1OhFrefQ7nqUlva1crHDbi4gVO+nnMSm5jztFXIRDMt+kMNh0mOscbARow== | ||
dependencies: | ||
lodash.isempty "^4.4.0" | ||
lodash.isplainobject "^4.0.6" | ||
lodash.transform "^4.6.0" | ||
|
||
lodash.isempty@^4.4.0: | ||
version "4.4.0" | ||
resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e" | ||
integrity sha1-b4bL7di+TsmHvpqvM8loTbGzHn4= | ||
|
||
lodash.isplainobject@^4.0.6: | ||
version "4.0.6" | ||
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" | ||
integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= | ||
|
||
lodash.transform@^4.6.0: | ||
version "4.6.0" | ||
resolved "https://registry.yarnpkg.com/lodash.transform/-/lodash.transform-4.6.0.tgz#12306422f63324aed8483d3f38332b5f670547a0" | ||
integrity sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters