1.0.15 • Published 7 years ago

jscommonutils v1.0.15

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

javaScript Commonly used tools

Installation

    npm install --save  jscommonutils

node

    var jscommonutils = require('jscommonutils')

AMD

    define(function (require, exports, module) {
        var jscommonutils = require('jscommonutils')
    })

##OverView

this API is include many utils which we Frequently used. Here are all the tools included in this package.

  • deppClone(origin, target).this method requests us pass two parameters, The first parameter is the cloned template, and the second parameter as the object we will clone to. it do not return a value, so the target must be a quote. Notes: origin must be object, but the target can be object or array.
  • dataType (target).this method requests us to pass one parameter, it represents the goal of the judge.In different case, it returns a different String. They're listed In the following.
    • number: 1,2,3...
    • string : '1', '2' ,'dad'...
    • boolean : true or fasle
    • undefined : undefined
    • function: function () {}...
    • Array: []
    • null: null
    • String: var a = new String('qqq')
    • Boolean: var a = new Boolean('qqq')
    • Number: var a = new Number('qqq')
    • object: {} or var a = new Object('qqq')
  • arrayUnique(arr).this method is used to get rid of the repeat.It return a new array.
  • getScrollOffset. this method is used to get the Scrill Offset from the top and left.
  • getViewportOffset.this method is used to get the content's height and width
  • getElementOffset.this method is used to get the location of the element from the top and left.

##Usage

    const { datatype, deppClone } = require('jscommonutils')

    const jscommonutils = require('jscommonutils')
    jscommonutils.datatype()
    jscommonutils.deppClone()
1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago