diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..693448a --- /dev/null +++ b/LICENSE @@ -0,0 +1,41 @@ +Copyright 2018 AJ ONeal + +This is open source software; you can redistribute it and/or modify it under the +terms of either: + + a) the "MIT License" + b) the "Apache-2.0 License" + +MIT License + + 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. + +Apache-2.0 License Summary + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index d11f919..cb18c96 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ Remedial JavaScript ==== -Douglas Crockford's `remedial.js` with a thin wrap for SSJS +Adaptation of Douglas Crockford's [`remedial.js`](https://web.archive.org/web/20110218164006/http://javascrip +t.crockford.com/remedial.html) with a thin wrap for SSJS This works in both the Browser and SSJS. @@ -23,7 +24,7 @@ Globals typeOf(o) ---- -Since JavaScript is a loosely-typed language, it is sometimes necessary to examine a value to determine its type. (This is sometimes necessary in strongly typed languages as well.) JavaScript provides a typeof operator to facilitate this, but typeof has problems. +Since JavaScript is a loosely-typed language, it is sometimes necessary to examine a value to determine its type. (This is sometimes necessary in strongly typed languages as well.) JavaScript provides a typeof operator to facilitate this, but typeof has problems. typeof typeOf Object 'object' 'object' @@ -37,7 +38,7 @@ Since JavaScript is a loosely-typed language, it is sometimes necessary to exami typeof [] produces 'object' instead of 'array'. That isn't totally wrong since arrays in JavaScript inherit from objects, but it isn't very useful. typeof null produces 'object' instead of 'null'. That is totally wrong. -We can correct this by defining our own typeOf function, which we can use in place of the defective typeof operator. +We can correct this by defining our own typeOf function, which we can use in place of the defective typeof operator. isEmpty(v) ---- diff --git a/lib/index.js b/index.js similarity index 100% rename from lib/index.js rename to index.js diff --git a/lib/package.json b/lib/package.json deleted file mode 100644 index 94033e8..0000000 --- a/lib/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name" : "remedial", - "description" : "Douglas Crockford's Remedial JavaScript", - "url" : "http://javascript.crockford.com/remedial.html", - "keywords" : ["util", "isEmpty", "typeOf", "entityify", "quote", "supplant", "trim"], - "author" : "Douglas Crockford ", - "contributors" : ["AJ ONeal "], - "dependencies" : [], - "main" : "./index", - "version" : "1.0.7" -} diff --git a/package.json b/package.json new file mode 100644 index 0000000..73b43b6 --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name" : "remedial", + "description" : "Deprecated. Utilities for ES3, most of which have been adopted or superseded in ES5.1. Adapted from Douglas Crockford's Remedial JavaScript", + "url" : "http://javascript.crockford.com/remedial.html", + "keywords" : ["util", "isEmpty", "typeOf", "entityify", "quote", "supplant", "trim"], + "author" : "AJ ONeal (https://coolaj86.com)", + "contributors" : [ "Douglas Crockford " ], + "dependencies" : {}, + "engines" : { "node": "*" }, + "homepage" : "https://git.coolaj86.com/coolaj86/remedial.js", + "license" : "(MIT OR Apache-2.0)", + "main" : "./index", + "version" : "1.0.8" +}