This commit is contained in:
AJ ONeal 2018-05-09 18:35:00 -06:00
parent 2c64287b54
commit 2746cfadb8
5 changed files with 59 additions and 14 deletions

41
LICENSE Normal file
View File

@ -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.

View File

@ -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)
----

View File

@ -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 <douglas@crockford.com>",
"contributors" : ["AJ ONeal <coolaj86@gmail.com>"],
"dependencies" : [],
"main" : "./index",
"version" : "1.0.7"
}

14
package.json Normal file
View File

@ -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 <coolaj86@gmail.com> (https://coolaj86.com)",
"contributors" : [ "Douglas Crockford <douglas@crockford.com>" ],
"dependencies" : {},
"engines" : { "node": "*" },
"homepage" : "https://git.coolaj86.com/coolaj86/remedial.js",
"license" : "(MIT OR Apache-2.0)",
"main" : "./index",
"version" : "1.0.8"
}