gina 0.0.9-p91c → 0.1.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +46 -0
- package/{core/asset/html/static.html → Icon/r} +0 -0
- package/LICENSE +1 -1
- package/README-4Contributors.md +96 -0
- package/README.md +296 -104
- package/bin/cli +287 -0
- package/bin/cli-debug +60 -0
- package/bin/cmd +184 -0
- package/bin/gina +180 -0
- package/config/logger.json +17 -0
- package/doc/framework/cli/doc.json +9 -0
- package/doc/framework/index.md +60 -0
- package/framework/v0.1.1-alpha.3/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.3}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.3/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.3/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.3/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.3/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.3/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.3/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.3/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.3/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.3/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.3/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.3/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.3/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.3/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.3/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.3/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.3/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.3/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.3/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.3/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.3/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.3/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.3/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.3/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.3/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.3/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.3/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.3/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.3/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.3/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.3/core/router.js +664 -0
- package/framework/v0.1.1-alpha.3/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.3/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.3/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.3/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.3/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.3/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.3/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.3/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.3/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.3/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.3/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.3/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.3/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.3/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.3/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.3/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.3/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.3/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.3/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.3/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.3/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.3/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.3/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.3/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.3/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.3/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.3/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.3/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/main.js +739 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.3/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.3/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.3/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.3/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.3/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.3/package.json +14 -0
- package/package.json +35 -33
- package/resources/etc/init.d/debian/gina +117 -0
- package/resources/home/framework/env.json +34 -0
- package/resources/home/framework/locals.json +14 -0
- package/resources/home/framework/project.json +48 -0
- package/resources/home/framework/projects.json +6 -0
- package/resources/home/main.json +47 -0
- package/resources/home/settings.json +22 -0
- package/resources/home/user/extensions/logger/default/config.json +77 -0
- package/resources/home/user/extensions/logger/file/config.json +11 -0
- package/resources/img/android-chrome-192x192.png +0 -0
- package/resources/img/android-chrome-512x512.png +0 -0
- package/resources/img/apple-touch-icon.png +0 -0
- package/resources/img/favicon-16x16.png +0 -0
- package/resources/img/favicon-32x32.png +0 -0
- package/resources/img/favicon.ico +0 -0
- package/resources/package.json.template +50 -0
- package/script/lib.js +24 -0
- package/script/post_install.js +449 -157
- package/script/pre_install.js +277 -36
- package/script/prepare_version.js +425 -0
- package/utils/helper.js +438 -0
- package/utils/prototypes.js +239 -0
- package/utils/prototypes.json_clone.js +175 -0
- package/.npmignore +0 -6
- package/MIDDLEWARE +0 -1
- package/SUCCESS +0 -1
- package/VERSION +0 -1
- package/core/asset/html/nolayout.html +0 -1
- package/core/asset/js/plugin/build.dev.json +0 -28
- package/core/asset/js/plugin/build.json +0 -31
- package/core/asset/js/plugin/dist/gina.min.css +0 -1
- package/core/asset/js/plugin/dist/gina.min.css.map +0 -1
- package/core/asset/js/plugin/dist/gina.min.js +0 -13732
- package/core/asset/js/plugin/dist/gina.min.js.map +0 -42
- package/core/asset/js/plugin/dist/gina.onload.min.js +0 -3
- package/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
- package/core/asset/js/plugin/readme.md +0 -152
- package/core/asset/js/plugin/src/gina/main.js +0 -132
- package/core/asset/js/plugin/src/gina/popin/css/design.css +0 -23
- package/core/asset/js/plugin/src/gina/popin/css/main.css +0 -1112
- package/core/asset/js/plugin/src/gina/popin/css/popin.css +0 -3
- package/core/asset/js/plugin/src/gina/popin/css/popin.css.map +0 -1
- package/core/asset/js/plugin/src/gina/popin/doc/TOC.md +0 -29
- package/core/asset/js/plugin/src/gina/popin/doc/css.md +0 -162
- package/core/asset/js/plugin/src/gina/popin/doc/extend.md +0 -663
- package/core/asset/js/plugin/src/gina/popin/doc/faq.md +0 -46
- package/core/asset/js/plugin/src/gina/popin/doc/html.md +0 -227
- package/core/asset/js/plugin/src/gina/popin/doc/js.md +0 -37
- package/core/asset/js/plugin/src/gina/popin/doc/misc.md +0 -178
- package/core/asset/js/plugin/src/gina/popin/doc/usage.md +0 -130
- package/core/asset/js/plugin/src/gina/popin/main.js +0 -783
- package/core/asset/js/plugin/src/gina/popin/sass/config.sass +0 -37
- package/core/asset/js/plugin/src/gina/popin/sass/gina-design.sass +0 -622
- package/core/asset/js/plugin/src/gina/popin/sass/gina-popin.sass +0 -54
- package/core/asset/js/plugin/src/gina/popin/sass/helper.scss +0 -73
- package/core/asset/js/plugin/src/gina/toolbar/.npmignore +0 -19
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css +0 -433
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css.map +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/index.html +0 -285
- package/core/asset/js/plugin/src/gina/toolbar/index.kit +0 -120
- package/core/asset/js/plugin/src/gina/toolbar/jquery-3.1.0.min.js +0 -4
- package/core/asset/js/plugin/src/gina/toolbar/main.js +0 -693
- package/core/asset/js/plugin/src/gina/toolbar/mock.gina.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/mock.user.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/readme.md +0 -7
- package/core/asset/js/plugin/src/gina/toolbar/sass/toolbar.sass +0 -563
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/info-optim.svg +0 -13
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/logo-gina.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings-big.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.afdesign +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/test.jpg +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/toolbar.html +0 -104
- package/core/asset/js/plugin/src/gina/utils/dom.js +0 -24
- package/core/asset/js/plugin/src/gina/utils/events.js +0 -201
- package/core/asset/js/plugin/src/gina/utils/loader.js +0 -57
- package/core/asset/js/plugin/src/main.js +0 -235
- package/core/asset/js/plugin/src/vendor/jquery/1.11.1-css-event_alias.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/1.12.4.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/2.1.1-css-event_alias-sizzle.min.js +0 -4
- package/core/asset/js/plugin/src/vendor/jquery/README.md +0 -14
- package/core/asset/js/plugin/src/vendor/jquery/slim-3.1.1.min.js +0 -4
- package/core/config.js +0 -1225
- package/core/controller/controller.js +0 -1860
- package/core/gna.js +0 -908
- package/core/plugins/lib/validator/src/form-validator.js +0 -789
- package/core/plugins/lib/validator/src/main.js +0 -2056
- package/core/router.js +0 -717
- package/core/server.js +0 -1363
- package/core/template/conf/env.json +0 -70
- package/core/template/conf/settings.json +0 -48
- package/core/template/conf/statics.json +0 -6
- package/core/template/conf/views.json +0 -16
- package/core/template/samples/bundle/config/app.json +0 -4
- package/core/template/samples/bundle/config/routing.json +0 -9
- package/core/template/samples/bundle/controllers/setup.js +0 -33
- package/core/template/views/js/vendor/readme.md +0 -1
- package/core/template/views/readme.md +0 -1
- package/core/utils/helpers/dateFormat.js +0 -264
- package/core/utils/helpers/index.js +0 -202
- package/core/utils/index.js +0 -75
- package/core/utils/lib/cmd/app.js +0 -686
- package/core/utils/lib/cmd/basic.help.txt +0 -40
- package/core/utils/lib/cmd/basic.js +0 -141
- package/core/utils/lib/cmd/gina-add-bundle.js +0 -328
- package/core/utils/lib/cmd/gina-add-views.js +0 -99
- package/core/utils/lib/cmd/gina-build.js +0 -218
- package/core/utils/lib/cmd/gina-clean.js +0 -26
- package/core/utils/lib/cmd/gina-connect.js +0 -176
- package/core/utils/lib/cmd/gina-delete-bundle.js +0 -176
- package/core/utils/lib/cmd/gina-deploy.js +0 -452
- package/core/utils/lib/cmd/gina-init-project.js +0 -83
- package/core/utils/lib/cmd/gina-start-bundle.js +0 -3
- package/core/utils/lib/cmd/gina-start.js +0 -3
- package/core/utils/lib/cmd/index.js +0 -157
- package/core/utils/lib/cmd/project.js +0 -14
- package/core/utils/lib/collection/src/main.js +0 -650
- package/core/utils/lib/logger/containers/file.js +0 -11
- package/core/utils/lib/logger/index.js +0 -260
- package/core/utils/lib/merge/src/main.js +0 -344
- package/core/utils/lib/proc.js +0 -416
- package/core/utils/lib/routing/src/main.js +0 -165
- package/documentation/css/default.css +0 -3
- package/documentation/html/home.html +0 -6
- package/documentation/html/inc/_footer.html +0 -5
- package/documentation/html/layout.html +0 -21
- package/documentation/img/debug-conf1.png +0 -0
- package/documentation/img/debug-conf2.png +0 -0
- package/documentation/img/debug-conf3.png +0 -0
- package/documentation/img/debug-conf4.png +0 -0
- package/documentation/img/debug-conf5.png +0 -0
- package/documentation/img/debug-conf6.png +0 -0
- package/documentation/img/debug-conf7.png +0 -0
- package/documentation/img/debug-new1.png +0 -0
- package/documentation/img/debug-new2.png +0 -0
- package/documentation/img/debug-start.png +0 -0
- package/documentation/md/api/controller/main.md +0 -74
- package/migration_note.md +0 -7
- package/package-lock.json +0 -611
- package/script/pre_publish.js +0 -207
- package/tutorial/Commands/README.md +0 -56
- package/tutorial/Commands/add-bundle-result.png +0 -0
- package/tutorial/Commands/add-bundle.png +0 -0
- package/tutorial/Commands/delete-bundle.png +0 -0
- package/tutorial/Commands/help.png +0 -0
- package/tutorial/Commands/init-project.png +0 -0
- package/tutorial/Commands/start-bundle-result.png +0 -0
- package/tutorial/Commands/start-bundle-stop.png +0 -0
- package/tutorial/Commands/start-bundle.png +0 -0
- package/tutorial/Commands/version.png +0 -0
- package/tutorial/ETC/README.md +0 -74
- package/tutorial/ETC/add-bundle-result.png +0 -0
- package/tutorial/ETC/add-bundle.png +0 -0
- package/tutorial/ETC/init-project.png +0 -0
- package/tutorial/Install/README.md +0 -54
- package/tutorial/Install/git-get.png +0 -0
- package/tutorial/Install/git-install-end.png +0 -0
- package/tutorial/Install/git-install-result.png +0 -0
- package/tutorial/Install/git-install-start.png +0 -0
- package/tutorial/Install/install-end.png +0 -0
- package/tutorial/Install/install-result.png +0 -0
- package/tutorial/Install/install-start.png +0 -0
- package/tutorial/WebStorm/README.md +0 -30
- package/tutorial/WebStorm/closure-compiler.png +0 -0
- package/tutorial/WebStorm/sass.png +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the gina package.
|
|
3
|
-
* Copyright (c) 2016 Rhinostone <gina@rhinostone.com>
|
|
4
|
-
*
|
|
5
|
-
* For the full copyright and license information, please view the LICENSE
|
|
6
|
-
* file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* ProjectCommand Class
|
|
11
|
-
*
|
|
12
|
-
* @package Gina.Utils.Cmd
|
|
13
|
-
* @author Rhinostone <gina@rhinostone.com>
|
|
14
|
-
*/
|
|
@@ -1,650 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collection cLass
|
|
3
|
-
* Allows you to handle your own collections as you would normaly with mongodb
|
|
4
|
-
* Dependencies :
|
|
5
|
-
* - utils/merge
|
|
6
|
-
* - uuid
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @param {array} collection
|
|
10
|
-
* @param {object} [options]
|
|
11
|
-
*
|
|
12
|
-
* @return {object} instance
|
|
13
|
-
*
|
|
14
|
-
* Collection::find
|
|
15
|
-
* @param {object} filter
|
|
16
|
-
* eg.: { uid: "someUID" }
|
|
17
|
-
* eg.: { type: "not null" }
|
|
18
|
-
* eg.: { "obj.prop": true }
|
|
19
|
-
* eg.: { "lastUpdate": ">= 2016-12-01T00:00:00" }
|
|
20
|
-
* eg.: { "activity": null }
|
|
21
|
-
*
|
|
22
|
-
* @return {array} result
|
|
23
|
-
*
|
|
24
|
-
* Collection::findOne
|
|
25
|
-
* @param {object} filter
|
|
26
|
-
* @return {object|array|string} result
|
|
27
|
-
*
|
|
28
|
-
* Collection::update
|
|
29
|
-
* @param {object} filter
|
|
30
|
-
* @param {object} set
|
|
31
|
-
*
|
|
32
|
-
* @return {array} result
|
|
33
|
-
*
|
|
34
|
-
* */
|
|
35
|
-
function Collection(content, option) {
|
|
36
|
-
|
|
37
|
-
var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;
|
|
38
|
-
var uuid = (isGFFCtx) ? require('vendor/uuid') : require('uuid');
|
|
39
|
-
var merge = (isGFFCtx) ? require('utils/merge') : require('../../../../utils/lib/merge');
|
|
40
|
-
|
|
41
|
-
var instance = this;
|
|
42
|
-
|
|
43
|
-
var defaultOptions = {
|
|
44
|
-
'useLocalStorage': false,
|
|
45
|
-
'locale': 'en' // get settigs.region, or user.region
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
var content = (content) ? JSON.parse(JSON.stringify(content)) : [] // original content -> not to be touched
|
|
49
|
-
//var content = (Array.isArray(content)) ? content : [] // original content -> not to be touched
|
|
50
|
-
, options = (typeof(options) == 'object') ? merge(options, defaultOptions) : defaultOptions
|
|
51
|
-
, keywords = ['not null'] // TODO - null, exists (`true` if property is defined)
|
|
52
|
-
;
|
|
53
|
-
;
|
|
54
|
-
|
|
55
|
-
this['uuids'] = {}; // uuids are generated for each new instance
|
|
56
|
-
if ( content.length > 0 ) {
|
|
57
|
-
for (var i = 0, len = content.length; i<len; ++i) {
|
|
58
|
-
if (!content[i]) {
|
|
59
|
-
// throw new Error('field index `'+ i +'` cannot be left undefined or null !');
|
|
60
|
-
//content.splice(i, 1);
|
|
61
|
-
content[i] = { id: uuid.v4(), noEntryFound: true };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
content[i]._uuid = uuid.v4();
|
|
65
|
-
this['uuids'][ content[i]._uuid ] = content[i]
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
//this.find = function(filter, withOrClause) {
|
|
70
|
-
this['find'] = function() {
|
|
71
|
-
|
|
72
|
-
var withOrClause = false;
|
|
73
|
-
if ( typeof(arguments[arguments.length-1]) == 'boolean' ) {
|
|
74
|
-
withOrClause = arguments[arguments.length-1];
|
|
75
|
-
delete arguments[arguments.length-1];
|
|
76
|
-
arguments.length -= 1;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
var filters = JSON.parse(JSON.stringify(arguments));
|
|
80
|
-
|
|
81
|
-
if ( typeof(filters) != 'undefined' && typeof(filters) !== 'object' ) {
|
|
82
|
-
throw new Error('filter must be an object');
|
|
83
|
-
} else if ( typeof(filters) != 'undefined' && filters.count() > 0 ) {
|
|
84
|
-
|
|
85
|
-
var filter = null
|
|
86
|
-
, condition = null
|
|
87
|
-
, i = 0
|
|
88
|
-
, tmpContent = ( Array.isArray(this) && !withOrClause) ? this : JSON.parse(JSON.stringify(content))
|
|
89
|
-
, resultObj = {}
|
|
90
|
-
, result = []
|
|
91
|
-
, localeLowerCase = ''
|
|
92
|
-
, re = null
|
|
93
|
-
, field = null
|
|
94
|
-
, value = null
|
|
95
|
-
;
|
|
96
|
-
|
|
97
|
-
for (var o in tmpContent) {
|
|
98
|
-
|
|
99
|
-
if (!tmpContent[o]) {
|
|
100
|
-
tmpContent[o] = {}
|
|
101
|
-
}
|
|
102
|
-
tmpContent[o].matched = {};
|
|
103
|
-
for (var l = 0, lLen = filters.count(); l<lLen; ++l) {
|
|
104
|
-
filter = filters[l];
|
|
105
|
-
condition = filter.count();
|
|
106
|
-
|
|
107
|
-
for (var f in filter) {
|
|
108
|
-
if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');
|
|
109
|
-
|
|
110
|
-
localeLowerCase = ( typeof(filter[f]) != 'boolean' && filter[f] !== null ) ? filter[f].toLocaleLowerCase() : filter[f];
|
|
111
|
-
// cases with tmpContent.prop
|
|
112
|
-
if ( /\./.test(f) ) {
|
|
113
|
-
//JSON.stringify(tmpContent[o]).match(/("gross":\w+)/)[1].split(/:/)[1]
|
|
114
|
-
field = f.split(/\./g);
|
|
115
|
-
field = field[field.length-1];
|
|
116
|
-
re = new RegExp('("'+ field +'":\\w+)' );
|
|
117
|
-
if ( !/undefined|function/.test( typeof(tmpContent[o]) ) ) {
|
|
118
|
-
value = JSON.stringify(tmpContent[o]).match(re);
|
|
119
|
-
if ( value && value.length > 0) {
|
|
120
|
-
value = value[1].split(/:/)[1];
|
|
121
|
-
if ( /(<|>|=)/.test(filter[f]) ) {
|
|
122
|
-
|
|
123
|
-
// looking for a datetime ?
|
|
124
|
-
if (
|
|
125
|
-
/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test( value )
|
|
126
|
-
&& /(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test( filter[f] )
|
|
127
|
-
) {
|
|
128
|
-
|
|
129
|
-
if ( eval( value.replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/, 'new Date("$&")') + filter[f].replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/, 'new Date("$&")') ) ) {
|
|
130
|
-
tmpContent[o].matched[f] = true;
|
|
131
|
-
resultObj[ tmpContent[o]._uuid ] = tmpContent[o]
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
} else if ( eval( value + filter[f] ) ) {
|
|
135
|
-
|
|
136
|
-
tmpContent[o].matched[f] = true;
|
|
137
|
-
resultObj[ tmpContent[o]._uuid ] = tmpContent[o]
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
if (value == filter[f]) {
|
|
141
|
-
|
|
142
|
-
tmpContent[o].matched[f] = true;
|
|
143
|
-
resultObj[ tmpContent[o]._uuid ] = tmpContent[o]
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
} else {
|
|
147
|
-
value = null
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
} else { // normal case
|
|
153
|
-
|
|
154
|
-
if ( filter[f] === null && tmpContent[o][f] === null ) { // null case
|
|
155
|
-
|
|
156
|
-
tmpContent[o].matched[f] = true;
|
|
157
|
-
resultObj[ tmpContent[o]._uuid ] = tmpContent[o]
|
|
158
|
-
|
|
159
|
-
} else if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && tmpContent[o][f] != 'null' && tmpContent[o][f] != 'undefined' ) {
|
|
160
|
-
if (result.indexOf(tmpContent[o][f]) < 0 ) {
|
|
161
|
-
tmpContent[o].matched[f] = true;
|
|
162
|
-
//if (typeof(tmpContent[o][f]) == 'object' ) {
|
|
163
|
-
// resultObj[ tmpContent[o][f]._uuid ] = tmpContent[o][f]
|
|
164
|
-
//} else {
|
|
165
|
-
if ( !resultObj[o] ) {
|
|
166
|
-
resultObj[o] = {}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
resultObj[tmpContent[o]._uuid] = tmpContent[o];
|
|
170
|
-
//}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
} else if ( typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && /(<|>|=)/.test(filter[f]) && !/undefined|function/.test( typeof(tmpContent[o][f]) ) ) { // with operations
|
|
174
|
-
// looking for a datetime ?
|
|
175
|
-
if (
|
|
176
|
-
/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test( tmpContent[o][f] )
|
|
177
|
-
&& /(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/.test( filter[f] )
|
|
178
|
-
) {
|
|
179
|
-
|
|
180
|
-
if ( eval( tmpContent[o][f].replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/, 'new Date("$&")') + filter[f].replace(/(\d{4})\-(\d{2})\-(\d{2})(\s+|T)(\d{2}):(\d{2}):(\d{2})/, 'new Date("$&")') ) ) {
|
|
181
|
-
tmpContent[o].matched[f] = true;
|
|
182
|
-
resultObj[ tmpContent[o]._uuid ] = tmpContent[o]
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
} else if ( eval( tmpContent[o][f] + filter[f] ) ) {
|
|
186
|
-
tmpContent[o].matched[f] = true;
|
|
187
|
-
resultObj[ tmpContent[o]._uuid ] = tmpContent[o]
|
|
188
|
-
}
|
|
189
|
-
} else if ( typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && tmpContent[o][f] === filter[f] ) {
|
|
190
|
-
|
|
191
|
-
tmpContent[o].matched[f] = true;
|
|
192
|
-
resultObj[ tmpContent[o]._uuid ] = tmpContent[o]
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
} else {
|
|
201
|
-
result = content
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (withOrClause) {
|
|
205
|
-
for (var obj in resultObj) {
|
|
206
|
-
if ( typeof(resultObj[obj].matched) != 'undefined' && resultObj[obj].matched.count() == condition ) {
|
|
207
|
-
delete resultObj[obj].matched;
|
|
208
|
-
result[i] = resultObj[obj];
|
|
209
|
-
++i
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// merging with previous result (this)
|
|
214
|
-
result = merge(this, result, true)
|
|
215
|
-
} else {
|
|
216
|
-
var matched = 0;
|
|
217
|
-
for (var obj in resultObj) {
|
|
218
|
-
if ( typeof(resultObj[obj].matched) != 'undefined' && resultObj[obj].matched.count() == condition ) {
|
|
219
|
-
delete resultObj[obj].matched;
|
|
220
|
-
result[i] = resultObj[obj];
|
|
221
|
-
++i
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// chaining
|
|
227
|
-
result.notIn = instance.notIn;
|
|
228
|
-
result.find = instance.find;
|
|
229
|
-
result.update = instance.update;
|
|
230
|
-
result.or = instance.or;
|
|
231
|
-
result.findOne = instance.findOne;
|
|
232
|
-
result.limit = instance.limit;
|
|
233
|
-
result.orderBy = instance.orderBy;
|
|
234
|
-
|
|
235
|
-
return result
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
this['or'] = function () {
|
|
239
|
-
arguments[arguments.length] = true;
|
|
240
|
-
arguments.length += 1;
|
|
241
|
-
|
|
242
|
-
return instance.find.apply(this, arguments);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
this['limit'] = function(resultLimit) {
|
|
246
|
-
if ( typeof(resultLimit) == 'undefined' || typeof(resultLimit) != 'number' ) {
|
|
247
|
-
throw new Error('[Collection::result->limit(resultLimit)] : `resultLimit` parametter must by a `number`')
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
var result = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content));
|
|
251
|
-
|
|
252
|
-
//resultLimit
|
|
253
|
-
result = result.splice(0, resultLimit);
|
|
254
|
-
|
|
255
|
-
// chaining
|
|
256
|
-
result.update = instance.update;
|
|
257
|
-
result.replace = instance.replace;
|
|
258
|
-
result.notIn = instance.notIn;
|
|
259
|
-
result.findOne = instance.findOne;
|
|
260
|
-
result.orderBy = instance.orderBy;
|
|
261
|
-
|
|
262
|
-
return result
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
this['findOne'] = function(filter) {
|
|
266
|
-
if ( typeof(filter) !== 'object' ) {
|
|
267
|
-
throw new Error('filter must be an object');
|
|
268
|
-
} else {
|
|
269
|
-
var condition = filter.count()
|
|
270
|
-
, i = 0
|
|
271
|
-
, tmpContent = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content))
|
|
272
|
-
, result = []
|
|
273
|
-
, localeLowerCase = '';
|
|
274
|
-
|
|
275
|
-
if (condition == 0) return null;
|
|
276
|
-
|
|
277
|
-
for (var o in tmpContent) {
|
|
278
|
-
for (var f in filter) {
|
|
279
|
-
if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');
|
|
280
|
-
|
|
281
|
-
localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];
|
|
282
|
-
if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && tmpContent[o][f] === filter[f] && tmpContent[o][f] != 'null' && tmpContent[o][f] != 'undefined' ) {
|
|
283
|
-
if (result.indexOf(tmpContent[o][f]) < 0 ) {
|
|
284
|
-
++i;
|
|
285
|
-
if (i === condition) result = tmpContent[o]
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
} else if ( typeof(tmpContent[o][f]) != 'undefined' && typeof(tmpContent[o][f]) !== 'object' && tmpContent[o][f] === filter[f] ) {
|
|
289
|
-
++i;
|
|
290
|
-
if (i === condition) result = tmpContent[o]
|
|
291
|
-
} else if ( filter[f] === null && tmpContent[o][f] === null ) { // null case
|
|
292
|
-
++i;
|
|
293
|
-
if (i === condition) result = tmpContent[o]
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return ( Array.isArray(result) && !result.length ) ? null : result
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
this['notIn'] = function(collection){
|
|
306
|
-
|
|
307
|
-
// where `this` is the source & `collection` is the target to be compared with
|
|
308
|
-
|
|
309
|
-
if ( typeof(collection) == 'undefined' )
|
|
310
|
-
return Array.isArray(this) ? this : content;
|
|
311
|
-
|
|
312
|
-
if (!Array.isArray(this))
|
|
313
|
-
throw new Error('<source>.notIn(<target>): `<source>` must be a valid `CollectionResultSet` (Array)');
|
|
314
|
-
|
|
315
|
-
if (!Array.isArray(collection))
|
|
316
|
-
throw new Error('<source>.notIn(<target>): `<target>` must be a valid CollectionResultSet (Array)');
|
|
317
|
-
|
|
318
|
-
if (this.length == 0)
|
|
319
|
-
return collection;
|
|
320
|
-
|
|
321
|
-
var result = []
|
|
322
|
-
, r = 0
|
|
323
|
-
, source = JSON.parse(JSON.stringify(this))
|
|
324
|
-
, target = JSON.parse(JSON.stringify(collection));
|
|
325
|
-
|
|
326
|
-
// removing those not in collection
|
|
327
|
-
for (var i = 0, len = target.length; i < len; ++i) {
|
|
328
|
-
for (var s = 0, sLen = source.length; s < sLen; ++s) {
|
|
329
|
-
if (target[i]._uuid == source[s]._uuid) {
|
|
330
|
-
target.splice(i, 1);
|
|
331
|
-
source.splice(s, 1);
|
|
332
|
-
--i;
|
|
333
|
-
break
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
result = target;
|
|
339
|
-
|
|
340
|
-
result.limit = instance.limit;
|
|
341
|
-
result.find = instance.find;
|
|
342
|
-
result.findOne = instance.findOne;
|
|
343
|
-
result.orderBy = instance.orderBy;
|
|
344
|
-
|
|
345
|
-
return result
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
this['insert'] = function (set) {
|
|
349
|
-
|
|
350
|
-
if ( typeof(set) !== 'object' ) {
|
|
351
|
-
throw new Error('filter must be an object');
|
|
352
|
-
} else {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
content.push(set);
|
|
356
|
-
|
|
357
|
-
var index = content.length-1;
|
|
358
|
-
content[ index ]._uuid = uuid.v4();
|
|
359
|
-
instance['uuids'][ content[index]._uuid ] = content[index];
|
|
360
|
-
|
|
361
|
-
var result = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content));
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// chaining
|
|
365
|
-
result.find = instance.find;
|
|
366
|
-
result.findOne = instance.findOne;
|
|
367
|
-
result.orderBy = instance.orderBy;
|
|
368
|
-
result.notIn = instance.notIn;
|
|
369
|
-
|
|
370
|
-
return result
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
this['update'] = function(filter, set) {
|
|
374
|
-
if ( typeof(filter) !== 'object' ) {
|
|
375
|
-
throw new Error('filter must be an object');
|
|
376
|
-
} else {
|
|
377
|
-
var condition = filter.count()
|
|
378
|
-
, i = 0
|
|
379
|
-
, localeLowerCase = ''
|
|
380
|
-
, result = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content));
|
|
381
|
-
|
|
382
|
-
for (var o in result) {
|
|
383
|
-
for (var f in filter) {
|
|
384
|
-
if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');
|
|
385
|
-
|
|
386
|
-
localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];
|
|
387
|
-
if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] != 'null' && result[o][f] != 'undefined' ) {
|
|
388
|
-
|
|
389
|
-
result[o] = merge(result[o], set, true);
|
|
390
|
-
|
|
391
|
-
} else if ( typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] === filter[f] ) {
|
|
392
|
-
++i;
|
|
393
|
-
if (i === condition) result[o] = merge(result[o], set, true);
|
|
394
|
-
} else if ( typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] === filter[f]) {
|
|
395
|
-
|
|
396
|
-
result[o] = merge(result[o], set, true);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// chaining
|
|
403
|
-
result.find = instance.find;
|
|
404
|
-
result.findOne = instance.findOne;
|
|
405
|
-
result.orderBy = instance.orderBy;
|
|
406
|
-
result.notIn = instance.notIn;
|
|
407
|
-
|
|
408
|
-
return result
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
this['replace'] = function(filter, set) {
|
|
412
|
-
if ( typeof(filter) !== 'object' ) {
|
|
413
|
-
throw new Error('filter must be an object');
|
|
414
|
-
} else {
|
|
415
|
-
var condition = filter.count()
|
|
416
|
-
, i = 0
|
|
417
|
-
, localeLowerCase = ''
|
|
418
|
-
, result = Array.isArray(this) ? this : JSON.parse(JSON.stringify(content));
|
|
419
|
-
|
|
420
|
-
for (var o in result) {
|
|
421
|
-
for (var f in filter) {
|
|
422
|
-
if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');
|
|
423
|
-
|
|
424
|
-
localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];
|
|
425
|
-
if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] != 'null' && result[o][f] != 'undefined' ) {
|
|
426
|
-
|
|
427
|
-
result[o] = set;
|
|
428
|
-
|
|
429
|
-
} else if ( typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] === filter[f] ) {
|
|
430
|
-
++i;
|
|
431
|
-
if (i === condition) result[o] = set;
|
|
432
|
-
} else if ( typeof(result[o][f]) != 'undefined' && typeof(result[o][f]) !== 'object' && result[o][f] === filter[f]) {
|
|
433
|
-
|
|
434
|
-
result[o] = set;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
// chaining
|
|
441
|
-
result.find = instance.find;
|
|
442
|
-
result.findOne = instance.findOne;
|
|
443
|
-
result.orderBy = instance.orderBy;
|
|
444
|
-
result.notIn = instance.notIn;
|
|
445
|
-
|
|
446
|
-
return result
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
this['delete'] = function(filter) {
|
|
450
|
-
if ( typeof(filter) !== 'object' ) {
|
|
451
|
-
throw new Error('filter must be an object');
|
|
452
|
-
} else {
|
|
453
|
-
var condition = filter.count()
|
|
454
|
-
, i = 0
|
|
455
|
-
, localeLowerCase = ''
|
|
456
|
-
, _content = Array.isArray(this) ? JSON.parse(JSON.stringify(this)) : JSON.parse(JSON.stringify(content))
|
|
457
|
-
, result = JSON.parse(JSON.stringify(_content));
|
|
458
|
-
|
|
459
|
-
for (var o in _content) {
|
|
460
|
-
for (var f in filter) {
|
|
461
|
-
if ( typeof(filter[f]) == 'undefined' ) throw new Error('filter `'+f+'` cannot be left undefined');
|
|
462
|
-
|
|
463
|
-
localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];
|
|
464
|
-
if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(_content[o][f]) != 'undefined' && typeof(_content[o][f]) !== 'object' && _content[o][f] != 'null' && _content[o][f] != 'undefined' ) {
|
|
465
|
-
result.splice(o, 1)
|
|
466
|
-
} else if ( typeof(_content[o][f]) != 'undefined' && typeof(_content[o][f]) !== 'object' && _content[o][f] === filter[f] ) {
|
|
467
|
-
++i;
|
|
468
|
-
if (i === condition) result.splice(o, 1);
|
|
469
|
-
} else if ( typeof(_content[o][f]) != 'undefined' && typeof(_content[o][f]) !== 'object' && _content[o][f] === filter[f] ) {
|
|
470
|
-
result.splice(o, 1)
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
//content = result;
|
|
477
|
-
return result
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
var sortKeywords = [ 'asc', 'desc' ];
|
|
482
|
-
/**
|
|
483
|
-
* sort
|
|
484
|
-
*
|
|
485
|
-
* @param {object|array} filter
|
|
486
|
-
* */
|
|
487
|
-
this['orderBy'] = function (filter) {
|
|
488
|
-
|
|
489
|
-
if ( typeof(filter) == 'undefined' )
|
|
490
|
-
throw new Error('[ Collection->sort(filter) ] where `filter` must not be empty or null' );
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
var variableContent = (Array.isArray(this)) ? this : JSON.parse(JSON.stringify(content));
|
|
494
|
-
return sortResult(filter, variableContent)
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* sortResult
|
|
499
|
-
* ref.:
|
|
500
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
|
|
501
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare#Browser_compatibility
|
|
502
|
-
*
|
|
503
|
-
* e.g.:
|
|
504
|
-
* .orderBy({ name: 'asc' })
|
|
505
|
-
*
|
|
506
|
-
* // overriding filters -> last filter is always right
|
|
507
|
-
* .orderBy([ { updatedAt : 'desc'}, { name: 'asc' } ])
|
|
508
|
-
*
|
|
509
|
-
* // combining filters -> the first one is always right
|
|
510
|
-
* .orderBy({ updatedAt : 'desc'}, { name: 'asc' })
|
|
511
|
-
*
|
|
512
|
-
* @param {object|array} filter
|
|
513
|
-
* */
|
|
514
|
-
var sortResult = function (filter, content) {
|
|
515
|
-
if ( typeof(filter) != 'object') {
|
|
516
|
-
throw new Error('`filter` parametter must be an object or an array')
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
var condition = filter.count()
|
|
520
|
-
, sortOp = {}
|
|
521
|
-
, key = null
|
|
522
|
-
, prop = null
|
|
523
|
-
, result = []
|
|
524
|
-
;
|
|
525
|
-
|
|
526
|
-
if (condition == 0) return null;
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
// asc
|
|
530
|
-
sortOp['asc'] = function (prop, content) {
|
|
531
|
-
return content.sort(function onAscSort(a, b) {
|
|
532
|
-
|
|
533
|
-
if ( typeof(a) == 'string' && a != '') {
|
|
534
|
-
// var fieldA = a.toUpperCase(); // ignore upper and lowercase
|
|
535
|
-
// var fieldB = b.toUpperCase(); // ignore upper and lowercase
|
|
536
|
-
//
|
|
537
|
-
// if (fieldA < fieldB) {
|
|
538
|
-
// return -1;
|
|
539
|
-
// }
|
|
540
|
-
//
|
|
541
|
-
// if (fieldA > fieldB) {
|
|
542
|
-
// return 1;
|
|
543
|
-
// }
|
|
544
|
-
//
|
|
545
|
-
// // fields must be equal
|
|
546
|
-
// return 0;
|
|
547
|
-
|
|
548
|
-
return a.localeCompare(b)
|
|
549
|
-
|
|
550
|
-
} else if ( typeof(a) == 'boolean' || typeof(b) == 'boolean' ) {
|
|
551
|
-
|
|
552
|
-
if (typeof(a) == 'boolean' ) {
|
|
553
|
-
a = (a) ? 1: 0;
|
|
554
|
-
}
|
|
555
|
-
if (typeof(b) == 'boolean' ) {
|
|
556
|
-
b = (b) ? 1: 0;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
if (a > b) {
|
|
560
|
-
return 1;
|
|
561
|
-
}
|
|
562
|
-
if (a < b) {
|
|
563
|
-
return -1;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
// a must be equal to b
|
|
567
|
-
return 0;
|
|
568
|
-
|
|
569
|
-
} else if ( typeof(a) == 'object' ) {
|
|
570
|
-
try {
|
|
571
|
-
if ( typeof(a[prop]) == 'number' ) {
|
|
572
|
-
|
|
573
|
-
a[prop] = '' + a[prop];
|
|
574
|
-
b[prop] = '' + b[prop];
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
return a[prop].localeCompare(b[prop], { numeric: true})
|
|
578
|
-
|
|
579
|
-
} catch (err) {
|
|
580
|
-
return -1
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
} else {
|
|
584
|
-
if (a > b) {
|
|
585
|
-
return 1;
|
|
586
|
-
}
|
|
587
|
-
if (a < b) {
|
|
588
|
-
return -1;
|
|
589
|
-
}
|
|
590
|
-
// a must be equal to b
|
|
591
|
-
return 0;
|
|
592
|
-
}
|
|
593
|
-
})
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
// desc
|
|
597
|
-
sortOp['desc'] = function (prop, content) {
|
|
598
|
-
return sortOp['asc'](prop, content).reverse()
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
if ( Array.isArray(filter) ) {
|
|
602
|
-
|
|
603
|
-
for (var f = 0, len = filter.length; f < len; ++f) {
|
|
604
|
-
|
|
605
|
-
prop = Object.keys(filter[f])[0];
|
|
606
|
-
key = filter[f][prop];
|
|
607
|
-
|
|
608
|
-
result = sortOp[key](prop, content);
|
|
609
|
-
}
|
|
610
|
-
} else {
|
|
611
|
-
|
|
612
|
-
if (filter.count() > 1) {
|
|
613
|
-
|
|
614
|
-
for (var f in filter) {
|
|
615
|
-
prop = Object.keys(filter)[0];
|
|
616
|
-
key = filter[prop];
|
|
617
|
-
|
|
618
|
-
result = sortOp[key](prop, content);
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
} else {
|
|
622
|
-
prop = Object.keys(filter)[0];
|
|
623
|
-
key = filter[prop];
|
|
624
|
-
|
|
625
|
-
result = sortOp[key](prop, content);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
// chaining
|
|
632
|
-
result.findOne = instance.findOne;
|
|
633
|
-
result.limit = instance.limit;
|
|
634
|
-
result.notIn = instance.notIn;
|
|
635
|
-
result.update = instance.update;
|
|
636
|
-
result.replace = instance.replace;
|
|
637
|
-
result.delete = instance.delete;
|
|
638
|
-
|
|
639
|
-
return result
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
if ( ( typeof(module) !== 'undefined' ) && module.exports ) {
|
|
645
|
-
// Publish as node.js module
|
|
646
|
-
module.exports = Collection
|
|
647
|
-
} else if ( typeof(define) === 'function' && define.amd) {
|
|
648
|
-
// Publish as AMD module
|
|
649
|
-
define(function() { return Collection })
|
|
650
|
-
}
|