hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a1f00ea36829f0a115fb1fbfc8e1cfbe49df0bff | 357 | js | JavaScript | src/commons/CustomCheckbox/__test__/CustomCheckbox.test.js | bang-eoh/react-native-personal-health | 717d6efbfea722990a0612b9d25524307dbd5076 | [
"MIT"
] | null | null | null | src/commons/CustomCheckbox/__test__/CustomCheckbox.test.js | bang-eoh/react-native-personal-health | 717d6efbfea722990a0612b9d25524307dbd5076 | [
"MIT"
] | null | null | null | src/commons/CustomCheckbox/__test__/CustomCheckbox.test.js | bang-eoh/react-native-personal-health | 717d6efbfea722990a0612b9d25524307dbd5076 | [
"MIT"
] | null | null | null | import React from 'react';
import renderer, { act } from 'react-test-renderer';
import CustomCheckbox from '../index';
describe('Test custom checkbox', () => {
let tree;
test('create custom checkbox checked', () => {
act(() => {
tree = renderer.create(<CustomCheckbox value />);
});
expect(tree.toJSON()).toMatchSnapshot();
});
});
| 25.5 | 55 | 0.621849 |
a1f06ce66bcd70ef5d011d7a299cb3adbcf041c1 | 1,510 | js | JavaScript | app/render/container/Router.js | cailong1028/electron-updater-example | a599a9e487f2ff77fc55e2b3ac1f78ae6b8bf7a3 | [
"Unlicense"
] | null | null | null | app/render/container/Router.js | cailong1028/electron-updater-example | a599a9e487f2ff77fc55e2b3ac1f78ae6b8bf7a3 | [
"Unlicense"
] | null | null | null | app/render/container/Router.js | cailong1028/electron-updater-example | a599a9e487f2ff77fc55e2b3ac1f78ae6b8bf7a3 | [
"Unlicense"
] | null | null | null | import React, {Component} from 'react';
import {Route, Switch, Redirect} from 'react-router';
import {BrowserRouter,HashRouter, Link} from 'react-router-dom';
import {connect} from 'react-redux';
import Home from '../component/Home';
import Article from '../component/Article';
const {ipcRenderer} = require('electron');
const mapDispatchToProps = (dispatch, ownProps) => {
return {a: 1};
};
const mapStateToProps = (state, ownProps) => {
return {b: 2};
};
class Router extends Component {
constructor(arg){
super(arg);
this.isWatch = false
}
componentWillMount=()=>{
};
componentWillReceiveProps=(nextProps)=>{
};
screenShot(url){
console.log(__dirname);
ipcRenderer.send('screenshot', 'url here');
// ss();
};
render() {
return (
<content>
<Home/>
<HashRouter>
<Switch>
<ul>
<li><Link to="/home">Home</Link></li>
<li><Link to="/article">Article</Link></li>
<button onClick={this.screenShot}>screenshot</button>
</ul>
<Route path='/home' component={Home}/>
<Route path='/article' component={Article}/>
</Switch>
</HashRouter>
</content>
)
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Router) | 30.2 | 81 | 0.519868 |
a1f156f6daeb481186039abcb1cd82456bdd7297 | 1,312 | js | JavaScript | lib/chunking-test.js | sixplussix/socketjs | 77c9652a9d3cc198a2af280bf0b889013ac68010 | [
"MIT"
] | null | null | null | lib/chunking-test.js | sixplussix/socketjs | 77c9652a9d3cc198a2af280bf0b889013ac68010 | [
"MIT"
] | null | null | null | lib/chunking-test.js | sixplussix/socketjs | 77c9652a9d3cc198a2af280bf0b889013ac68010 | [
"MIT"
] | null | null | null | import * as utils from './utils'
export const app = {
chunking_test (req, res, _, next_filter) {
res.setHeader('Content-Type', 'application/javascript; charset=UTF-8')
res.writeHead(200)
let write = (payload) => {
try {
res.write(payload + '\n')
} catch (x) {
return
}
}
utils.timeout_chain([
[0, () => write('h')],
[1, () => write(Array(2049).join(' ') + 'h')],
[5, () => write('h')],
[25, () => write('h')],
[625, () => write('h')],
[3125, () => {write('h'); res.end()}]
])
return true;
},
info (req, res, _) {
let info = {
websocket: this.options.websocket,
origins: ['*:*'],
cookie_needed: !! this.options.jsessionid,
entropy: utils.random32()
}
if (typeof this.options.base_url === 'function') {
info.base_url = this.options.base_url()
} else if (this.options.base_url) {
info.base_url = this.options.base_url
}
res.setHeader('Content-Type', 'application/json; charset=UTF-8')
res.writeHead(200)
res.end(JSON.stringify(info))
},
info_options (req, res) {
res.statusCode = 204
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET')
res.setHeader('Access-Control-Max-Age', res.cache_for)
return ''
}
}
| 25.230769 | 74 | 0.552591 |
a1f19618b6f5f33680df90d03b5ea9e5dadb5afb | 2,805 | js | JavaScript | src/icons/PhCopy.js | phosphor-icons/phosphr-webcomponents | d763567e8c6aa177fa5929f528bcb11e46952a15 | [
"MIT"
] | 3 | 2020-11-28T21:09:22.000Z | 2021-03-23T03:55:46.000Z | src/icons/PhCopy.js | phosphor-icons/phosphr-webcomponents | d763567e8c6aa177fa5929f528bcb11e46952a15 | [
"MIT"
] | 1 | 2021-02-11T21:43:15.000Z | 2021-08-29T16:40:10.000Z | src/icons/PhCopy.js | phosphor-icons/phosphr-webcomponents | d763567e8c6aa177fa5929f528bcb11e46952a15 | [
"MIT"
] | 1 | 2021-01-10T19:32:19.000Z | 2021-01-10T19:32:19.000Z | /* GENERATED FILE */
import { html, svg, define } from "hybrids";
const PhCopy = {
color: "currentColor",
size: "1em",
weight: "regular",
mirrored: false,
render: ({ color, size, weight, mirrored }) => html`
<svg
xmlns="http://www.w3.org/2000/svg"
width="${size}"
height="${size}"
fill="${color}"
viewBox="0 0 256 256"
transform=${mirrored ? "scale(-1, 1)" : null}
>
${weight === "bold" &&
svg`<polyline points="168 167.993 216 167.993 216 39.993 88 39.993 88 87.993" fill="none" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/>
<rect x="39.99902" y="87.99414" width="128" height="128" stroke-width="24" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" fill="none"/>`}
${weight === "duotone" &&
svg`<polygon points="168 87.993 168 167.993 216 167.993 216 39.993 88 39.993 88 87.993 168 87.993" opacity="0.2"/>
<polyline points="168 167.993 216 167.993 216 39.993 88 39.993 88 87.993" fill="none" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
<rect x="39.99902" y="87.99414" width="128" height="128" stroke-width="16" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" fill="none"/>`}
${weight === "fill" &&
svg`<path d="M215.99414,31.99316h-128a8.0004,8.0004,0,0,0-8,8v40.001h-40.001a8.0004,8.0004,0,0,0-8,8v128a8.0004,8.0004,0,0,0,8,8h128a8.00039,8.00039,0,0,0,8-8v-40.001h40.001a8.00039,8.00039,0,0,0,8-8v-128A8.0004,8.0004,0,0,0,215.99414,31.99316Zm-8,128h-32.001v-71.999a8.00039,8.00039,0,0,0-8-8h-71.999v-32.001h112Z"/>`}
${weight === "light" &&
svg`<polyline points="168 167.993 216 167.993 216 39.993 88 39.993 88 87.993" fill="none" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"/>
<rect x="39.99902" y="87.99414" width="128" height="128" stroke-width="12" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" fill="none"/>`}
${weight === "thin" &&
svg`<polyline points="168 167.993 216 167.993 216 39.993 88 39.993 88 87.993" fill="none" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"/>
<rect x="39.99902" y="87.99414" width="128" height="128" stroke-width="8" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" fill="none"/>`}
${weight === "regular" &&
svg`<polyline points="168 167.993 216 167.993 216 39.993 88 39.993 88 87.993" fill="none" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
<rect x="39.99902" y="87.99414" width="128" height="128" stroke-width="16" stroke="${color}" stroke-linecap="round" stroke-linejoin="round" fill="none"/>`}
</svg>
`,
};
define("ph-copy", PhCopy);
export default PhCopy;
| 66.785714 | 325 | 0.644563 |
a1f29fc57bd79dd7a74d07f670b626cd6a8b1411 | 486 | js | JavaScript | src/components/MenuBar/index.js | andreMCD/blog-Andre-Macedo | d1920388e5d6153df50a1294a1d562c5f6a13988 | [
"MIT"
] | null | null | null | src/components/MenuBar/index.js | andreMCD/blog-Andre-Macedo | d1920388e5d6153df50a1294a1d562c5f6a13988 | [
"MIT"
] | null | null | null | src/components/MenuBar/index.js | andreMCD/blog-Andre-Macedo | d1920388e5d6153df50a1294a1d562c5f6a13988 | [
"MIT"
] | null | null | null | import React from "react"
import { Home } from "styled-icons/boxicons-regular/Home"
import { LightBulb as Light } from "styled-icons/octicons/LightBulb"
import * as S from "./styled"
const MenuBar = () => (
<S.MenuBarGroup>
<S.MenuBarLink to="/" title="Voltar para Home">
<S.MenuBarItem>
<Home />
</S.MenuBarItem>
</S.MenuBarLink>
<S.MenuBarItem title="Mudar Tema">
<Light />
</S.MenuBarItem>
</S.MenuBarGroup>
)
export default MenuBar
| 22.090909 | 68 | 0.639918 |
a1f4c60c73c256bd6161ea4cf7d6111ffefaf0bf | 4,141 | js | JavaScript | src/ArgsManager.js | aeolingamenfel/hephaestus | 0d6ec2877ba3d3be77a21ce4730e325ad5c404d0 | [
"0BSD"
] | null | null | null | src/ArgsManager.js | aeolingamenfel/hephaestus | 0d6ec2877ba3d3be77a21ce4730e325ad5c404d0 | [
"0BSD"
] | null | null | null | src/ArgsManager.js | aeolingamenfel/hephaestus | 0d6ec2877ba3d3be77a21ce4730e325ad5c404d0 | [
"0BSD"
] | null | null | null | class ArgsManager {
constructor() {
this.argsArray = process.argv;
this.flags = {};
this.parameters = {};
this.sort();
}
/**
* Sorts the raw args into flags and arguments.
*/
sort() {
for(let x = 0; x < this.argsArray.length; x++) {
const arg = this.argsArray[x];
if(this.isFlag(arg)) {
this.handleFlag(arg);
} else if(this.isParameter(arg)) {
this.handleParameter(arg, x);
// It is assumed that the argument value follows the argument
// itself, so we skip it.
x += 1;
}
}
}
/**
* Returns true if a flag with the specified name is present. A flag is an
* argument with "--" in the front of it.
*
* @param {String} name the name of the flag, without the "--" at the front
*
* @returns {Boolean} true if the flag is present, or false otherwise
*/
hasFlag(name) {
return typeof this.flags[name] !== 'undefined' && this.flags[name];
}
/**
* Returns true if a parameter with the specified name is present. A
* parameter is an argument that has "-" in front of it, and is preceded by
* a value.
*
* @param {String} name the name of the parameter, without the "-" at the
* front
*
* @returns {Boolean} true if the parameter is present ,or false otherwise
*/
hasParameter(name) {
return typeof this.parameters[name] !== 'undefined'
&& this.parameters[name] != null;
}
/**
* Gets the value of the specified parameter, assuming the parameter exists.
*
* @param {String} name the name of the parameter, without the "-" at the
* front
*
* @returns {String|null} will return null if the parameter does not exist,
* otherwise returns the string value of the parameter as specified in the
* args.
*/
getParameter(name) {
if(!this.hasParameter(name)) {
return null;
}
return this.parameters[name];
}
/**
* Takes the raw flag string and performs the nessesary steps to add it to
* the managed list of flags, including checking for duplicate flags.
*
* @param {String} arg the raw string argument that is considered a flag.
* Does not check the validity of the flag.
*/
handleFlag(arg) {
const name = arg.replace(/^--/, "");
if(this.flags[name]) {
throw new Error(`The flag ${name} has already been specified.`);
}
this.flags[name] = true;
}
/**
* Takes the raw argument string and performs the nessesary steps to add it
* to the arguments list, including checking for duplicates and gathering
* a value.
*
* @param {String} arg the raw string argument that is considered a
* Parameter. Will not check the validity of the Parameter
*
* @param {Integer} index the index in the arguments array that the arg
* param is located at; used to look forward for the value
*/
handleParameter(arg, index) {
const name = arg.replace(/^-/, "");
const value = this.argsArray[index + 1];
if(!value) {
throw new Error(`The argument ${name} has no value.`);
}
if(this.parameters[name]) {
throw new Error(`The argument ${name} has already been specified.`);
}
this.parameters[name] = value;
}
/**
* Determines whether the specified string is a Parameter.
*
* @param {String} arg the argument to be checked
*
* @returns {Boolean} true if the arg is a Parameter, false otherwise
*/
isParameter(arg) {
return !!arg.match(/^-[a-z]*$/g);
}
/**
* Determines whether the specified string is a Flag.
*
* @param {String} arg the argument to be checked
*
* @param {Boolean} true if the arg is a Flag, false otherwise
*/
isFlag(arg) {
return !!arg.match(/^--[(a-z)|-]*$/g);
}
}
module.exports = ArgsManager;
| 28.958042 | 80 | 0.568945 |
a1f4ec1f7d432ebc0093346558ab61638b119251 | 641 | js | JavaScript | sub-components/pathfinding-visualiser-summary-line/pathfinding-visualiser-summary-line.js | rnagulapalle/pathfinding-visualiser | b64d13cf14140ce07683414dfa125ed25e7e6af5 | [
"MIT"
] | 51 | 2015-01-25T04:34:35.000Z | 2022-03-25T11:13:29.000Z | sub-components/pathfinding-visualiser-summary-line/pathfinding-visualiser-summary-line.js | rnagulapalle/pathfinding-visualiser | b64d13cf14140ce07683414dfa125ed25e7e6af5 | [
"MIT"
] | 21 | 2015-05-30T17:22:59.000Z | 2018-09-23T10:52:18.000Z | sub-components/pathfinding-visualiser-summary-line/pathfinding-visualiser-summary-line.js | Tyriar/pathfinding-visualiser | b64d13cf14140ce07683414dfa125ed25e7e6af5 | [
"MIT"
] | 12 | 2015-05-26T01:28:04.000Z | 2022-02-05T23:04:44.000Z | /**
* @license
* pathfinding-visualiser <http://github.com/Tyriar/pathfinding-visualiser>
* Copyright 2014 Daniel Imms <http://www.growingwiththeweb.com>
* Released under the MIT license <http://github.com/Tyriar/pathfinding-visualiser/blob/master/LICENSE>
*/
/*global Polymer*/
(function () {
'use strict';
Polymer({
is: 'pathfinding-visualiser-summary-line',
properties: {
colour: {
type: String,
value: 'transparent'
}
},
observers: [
'colourChanged(colour)'
],
colourChanged: function (colour) {
this.$.colour.style.backgroundColor = colour;
}
});
})();
| 21.366667 | 103 | 0.631825 |
a1f50ab81ca75eaf2a8e1db48ff9aef5857ff1b3 | 179 | js | JavaScript | lib/maze/leftCanvas.js | atilamx/pac-man- | 683b6573cfabd321aad6f9fae96e5942d9d33386 | [
"BSD-2-Clause"
] | 1 | 2020-07-30T19:40:48.000Z | 2020-07-30T19:40:48.000Z | lib/maze/leftCanvas.js | atilamx/pac-man- | 683b6573cfabd321aad6f9fae96e5942d9d33386 | [
"BSD-2-Clause"
] | null | null | null | lib/maze/leftCanvas.js | atilamx/pac-man- | 683b6573cfabd321aad6f9fae96e5942d9d33386 | [
"BSD-2-Clause"
] | null | null | null | Window.leftCanvas = Window.ScreenCanvas.clone();
Window.leftCanvas.init({
context: Window.InitializeCanvas('myCanvas2').context,
color: 'lightgreen',
speed: 1
}
);
| 22.375 | 58 | 0.698324 |
a1f64325b4bbbfa623342f0c935ea491d1945984 | 1,727 | js | JavaScript | www/js/es5/posts/render/posts.js | Dereban/bun | 813ceb6788643d73d535aa7d8bb43e086e15f893 | [
"MIT"
] | null | null | null | www/js/es5/posts/render/posts.js | Dereban/bun | 813ceb6788643d73d535aa7d8bb43e086e15f893 | [
"MIT"
] | null | null | null | www/js/es5/posts/render/posts.js | Dereban/bun | 813ceb6788643d73d535aa7d8bb43e086e15f893 | [
"MIT"
] | null | null | null | "use strict";function _taggedTemplateLiteral(e,n){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var _templateObject=_taggedTemplateLiteral(['<section id="p','" class="','">\n <div class="background glass">\n ','\n <span class="omit"></span>\n </div>\n </section>'],['<section id="p','" class="','">\n <div class="background glass">\n ','\n <span class="omit"></span>\n </div>\n </section>']),_templateObject2=_taggedTemplateLiteral(['<article id="p','" class="','">\n ',"\n </article>"],['<article id="p','" class="','">\n ',"\n </article>"]),_templateObject3=_taggedTemplateLiteral(["","\n ",'\n <div class="container">\n <blockquote>\n ',"\n </blockquote>\n <small>\n ","\n </small>\n </div>"],["","\n ",'\n <div class="container">\n <blockquote>\n ',"\n </blockquote>\n <small>\n ","\n </small>\n </div>"]);System.register(["../../util","./header","./image","./etc","./body"],function(e,n){function t(e){var n=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return e.locked&&(n+=" locked"),e.editing&&(n+=" editing"),e.largeThumb=!0,r.parseHTML(_templateObject,e.id.toString(),n,i(e))}function a(e){var n="glass";return e.editing&&(n+=" editing"),r.parseHTML(_templateObject2,e.id.toString(),n,i(e))}function i(e){var n=(e.body,e.backlinks);return r.parseHTML(_templateObject3,c.renderHeader(e),e.image?l.renderImage(e.image):"",d.renderBody(e),s.renderBacklinks(n))}var r,c,l,s,d;n&&n.id;return e("renderSection",t),e("renderArticle",a),{setters:[function(e){r=e},function(e){c=e},function(e){l=e},function(e){s=e},function(e){d=e}],execute:function(){}}});
//# sourceMappingURL=../../maps/posts/render/posts.js.map
| 575.666667 | 1,668 | 0.629994 |
a1f702594a253f8113773195c2a5699dd174edc6 | 788 | js | JavaScript | demo/blog/js/widgets/comment.js | eliace/ergojs-site | 4f9913490cc12085f2811dbb838368f2f5879e5c | [
"MIT"
] | null | null | null | demo/blog/js/widgets/comment.js | eliace/ergojs-site | 4f9913490cc12085f2811dbb838368f2f5879e5c | [
"MIT"
] | null | null | null | demo/blog/js/widgets/comment.js | eliace/ergojs-site | 4f9913490cc12085f2811dbb838368f2f5879e5c | [
"MIT"
] | null | null | null |
Ergo.defineClass('App.widgets.FeedComment', 'Ergo.widgets.Media', {
defaults: {
as: 'feed-comment',
$before: {
$content: {
dataId: 'avatar',
width: 48,
as: 'circular',
binding: function(v) {
this.opt('src', 'img/avatars/'+v);
}
}
},
$content: {
$title: {
$content: {
etype: 'link',
dataId: 'author',
as: 'comment-author'
},
$date: {
dataId: 'created_at',
binding: 'text',
as: 'comment-date'
}
},
$content: {
dataId: 'comment',
binding: 'text',
as: 'comment-text'
},
$replies: {
dataId: 'replies',
dynamic: true,
defaultItem: {
etype: 'feed-comment'
}
}
}
}
}, 'widgets:feed-comment');
| 14.867925 | 68 | 0.470812 |
a1f7fcf16dc5dd8b9b24296e4eaa9b541daef9d8 | 411 | js | JavaScript | test/services/render/hooks/checkCache.test.js | rapee/boo | b81037282d9c2d300569438b9d9784e2655def18 | [
"MIT"
] | null | null | null | test/services/render/hooks/checkCache.test.js | rapee/boo | b81037282d9c2d300569438b9d9784e2655def18 | [
"MIT"
] | null | null | null | test/services/render/hooks/checkCache.test.js | rapee/boo | b81037282d9c2d300569438b9d9784e2655def18 | [
"MIT"
] | null | null | null | 'use strict';
const assert = require('assert');
const checkCache = require('../../../../src/services/render/hooks/checkCache.js');
describe('render checkCache hook', () => {
it('hook can be used', () => {
const mockHook = {
type: 'before',
app: {},
params: {},
result: {},
data: {}
};
checkCache()(mockHook);
assert.ok(mockHook.checkCache);
});
});
| 19.571429 | 82 | 0.530414 |
a1f7febbeae930d147cf837515a5f2ef1687a737 | 2,450 | js | JavaScript | server/src/api/products/product.controller.js | Rubenoti/api-shop-proyect | 60d8c2b6e88299671390058f9336276d662c4f48 | [
"MIT"
] | null | null | null | server/src/api/products/product.controller.js | Rubenoti/api-shop-proyect | 60d8c2b6e88299671390058f9336276d662c4f48 | [
"MIT"
] | null | null | null | server/src/api/products/product.controller.js | Rubenoti/api-shop-proyect | 60d8c2b6e88299671390058f9336276d662c4f48 | [
"MIT"
] | null | null | null | const Product = require('./product.model');
const { setError } = require('../../utils/errors');
const { deleteImgCloudinary } = require('../../middlewares/deleteFile');
const getAllProducts = async (req, res, next) => {
try {
const products = await Product.find();
return res.status(200).json(products);
} catch (error) {
return next(setError(500, "Fail to get all products"));
}
}
const getOneProduct = async (req, res, next) => {
try {
const { id } = req.params;
const product = await Product.findById(id);
if (!product) {
return next(setError(404, "Product not found"));
}
return res.status(200).json(product);
} catch (error) {
return next(setError(500, "Fail to get product"));
}
}
const createProduct = async (req, res, next) => {
try {
const product = new Product(req.body);
const duplicateProduct = await Product.findOne({ name: product.name });
if (duplicateProduct) {
return next(setError(400, "Product already exists"));
}
if (req.file) product.image = req.file.path;
const newProduct = await product.save();
return res.status(201).json(newProduct);
} catch (error) {
return next(setError(500, "Fail to create product"));
}
}
const updateProduct = async (req, res, next) => {
try {
const { id } = req.params;
const product = new Product(req.body);
if (req.file) product.image = req.file.path
product._id = id;
const updateProduct = await Product.findByIdAndUpdate(id, product);
if (!updateProduct) {
return next(setError(404, "Product not found"));
}
return res.status(200).json(updateProduct);
} catch (error) {
return next(setError(500, "Fail to update product"));
}
}
const deleteProduct = async (req, res, next) => {
try {
const { id } = req.params;
const product = await Product.findByIdAndDelete(id);
if (!product) {
return next(setError(404, "Product not found"));
}
if (product.image) deleteImgCloudinary(product.image)
return res.status(200).json(product);
} catch (error) {
return next(setError(500, "Fail to delete product"));
}
}
module.exports = {
getAllProducts,
getOneProduct,
createProduct,
updateProduct,
deleteProduct
}
| 29.878049 | 79 | 0.592653 |
a1f83033e807269dc5de4c0c7a0ba332ba656dd6 | 1,058 | js | JavaScript | basic/6-mod-mian.js | a982338665/node-express | 702b81cd3b14734c0dfc3f3fcbdea26657298d65 | [
"MIT"
] | null | null | null | basic/6-mod-mian.js | a982338665/node-express | 702b81cd3b14734c0dfc3f3fcbdea26657298d65 | [
"MIT"
] | 2 | 2021-01-06T08:25:14.000Z | 2021-05-10T06:46:05.000Z | basic/6-mod-mian.js | a982338665/node-express | 702b81cd3b14734c0dfc3f3fcbdea26657298d65 | [
"MIT"
] | null | null | null |
const modA = require('./4-mod-a');
const modB = require('./5-mod-b');
console.log(modA.test);
console.log(modB.test);
/*!
解释:
1.依赖模块A,进入执行
module.exports.test = "A"; //初始化test
const modB = require('./5-mod-b');
-- 依赖模块B,进入执行
module.exports.test = "B"; //赋值test
const modB = require('./4-mod-a'); //此时开始循环调用了 就只输出已经执行的部分,还未执行的部分不会被输出
-- 依赖模块A,找到已执行部分 即
module.exports.test = "A"; //此为A中已执行部分,未执行部分不会输出,
-- 回到模块B,往下执行
console.log('B: - '+modA.test);//此时打印内容为 B: - A
module.exports.test = "BB"; //重新赋值test
-- 回到模块A,继续执行,此时已执行完完整的模块B
console.log('A: - '+modB.test); //由于test 被重新赋值为BB,此时打印应为 A: - BB
module.exports.test = "AA";
2.依赖模块B,进入执行:
//此时开始循环调用了 就只输出已经执行的部分,还未执行的部分不会被输出
即执行内容只有
module.exports.test = "BB"; //赋值test
console.log(modA.test); //AA
console.log(modB.test); //BB
3.即最后打印结果为:
B: - A
A: - BB
AA
BB
*/ | 31.117647 | 84 | 0.518904 |
a1fa0eb2dea358a026e21b577bf544d24e4f9241 | 3,254 | js | JavaScript | src/PTV.Application.Web/wwwroot/js/app/Routes/FrontPage/routes/Relations/containers/Relations.js | MikkoVirenius/ptv-1.7 | c2fd52c6c9774722b0a3e958d8537fa7de322207 | [
"MIT"
] | null | null | null | src/PTV.Application.Web/wwwroot/js/app/Routes/FrontPage/routes/Relations/containers/Relations.js | MikkoVirenius/ptv-1.7 | c2fd52c6c9774722b0a3e958d8537fa7de322207 | [
"MIT"
] | null | null | null | src/PTV.Application.Web/wwwroot/js/app/Routes/FrontPage/routes/Relations/containers/Relations.js | MikkoVirenius/ptv-1.7 | c2fd52c6c9774722b0a3e958d8537fa7de322207 | [
"MIT"
] | null | null | null | import Relations from '../components/Relations'
import { connect } from 'react-redux'
import { compose } from 'redux'
import * as ServiceAndChannelSelectors from 'Containers/Relations/ServiceAndChannels/ServiceAndChannel/Selectors'
import * as CommonServiceAndChannelsSelectors from 'Containers/Relations/ServiceAndChannels/Common/Selectors'
import * as CommonSelectors from 'Containers/Common/Selectors'
import * as serviceAndChannelActions from 'Containers/Relations/ServiceAndChannels/ServiceAndChannel/Actions'
import * as commonServiceAndChannelActions from 'Containers/Common/Actions'
import * as commonActions from 'Containers/Relations/ServiceAndChannels/Common/Actions'
import * as channelSearchAction from 'Containers/Relations/ServiceAndChannels/ChannelSearch/Actions'
import * as serviceSearchAction from 'Containers/Relations/ServiceAndChannels/ServiceSearch/Actions'
import mapDispatchToProps from 'Configuration/MapDispatchToProps'
import { injectIntl } from 'react-intl'
const actions = [
serviceAndChannelActions,
commonServiceAndChannelActions,
commonActions,
serviceSearchAction,
channelSearchAction
]
export default compose(
connect(
(state, ownProps) => {
const keyToState = 'serviceAndChannel'
const editedEntityId = ownProps.location.state
? ownProps.location.state.serviceId || ownProps.location.state.channelId
: null
const language = CommonServiceAndChannelsSelectors.getLanguageToCodeForServiceAndChannel(state)
return {
readOnly: ServiceAndChannelSelectors.getRelationsReadOnly(state, { keyToState }),
hideRightSearchPannel: CommonServiceAndChannelsSelectors.getRelationConnectedIsAnyOnShowingAdditionalData(state, ownProps),
countOfConnectedServices: CommonServiceAndChannelsSelectors.getRelationConnectedServicesIdsSize(state, ownProps),
isAnyRelation: CommonServiceAndChannelsSelectors.getIsAnyRelation(state, ownProps),
isFetching: CommonSelectors.getStepCommonIsFetching(state, { keyToState }),
areDataValid: CommonSelectors.getStepCommonAreDataValid(state, { keyToState }),
newConnectedChannelIds: CommonServiceAndChannelsSelectors.getRelationNewChannelRelationsIds(state, ownProps),
searchIsFetching: CommonSelectors.getSearchResultsIsFetching(state, { keyToState: 'serviceAndChannelServiceSearch', keyToEntities: 'services' }),
searchAreDataValid: CommonSelectors.getSearchResultsAreDataValid(state, { keyToState: 'serviceAndChannelServiceSearch', keyToEntities: 'services' }),
searchedServices: CommonServiceAndChannelsSelectors.getSearchedServiceEntities(state, { keyToState: 'serviceAndChannelServiceSearch', keyToEntities: 'services', language }),
editedEntity : editedEntityId != null,
editedService: CommonServiceAndChannelsSelectors.getService(state, { id : ownProps.location.state ? ownProps.location.state.entityId : null }),
confirmationData: CommonServiceAndChannelsSelectors.getConfirmation(state, { keyToState:'serviceAndChannelConfirmation' }),
language,
currentTabIndex: CommonServiceAndChannelsSelectors.getCurrentTabIndex(state, { keyToState })
}
},
mapDispatchToProps(actions)
),
injectIntl
)(Relations)
| 61.396226 | 181 | 0.801168 |
a1fa491fa0f9471205366a8e813cb228abd6c3ed | 5,579 | js | JavaScript | gesture.js | songzxDev/wpk | dc8eb064fbee3f558e5d1d5b738a402c8dd8396f | [
"Apache-2.0"
] | 1 | 2019-11-13T07:51:18.000Z | 2019-11-13T07:51:18.000Z | gesture.js | songzxDev/wpk | dc8eb064fbee3f558e5d1d5b738a402c8dd8396f | [
"Apache-2.0"
] | 1 | 2021-05-10T12:40:51.000Z | 2021-05-10T12:40:51.000Z | gesture.js | songzxDev/wpk | dc8eb064fbee3f558e5d1d5b738a402c8dd8396f | [
"Apache-2.0"
] | null | null | null | export function enableGesture(main) {
let start = (point, context) => {
//console.log("start")
context.startX = point.clientX;
context.startY = point.clientY;
context.startTime = Date.now();
context.isTap = true; // 轻点击
context.isPan = false; // 拖动
context.isPress = false; // 长按
context.pressHandler = setTimeout(() => {
context.isPress = true;
context.isTap = false;
let e = new Event("pressstart");
main.dispatchEvent(e);
context.pressHandler = null;
}, 500)
};
let move = (point, context) => {
//console.log(context.startX,context.startY);
let dx = point.clientX - context.startX, dy = point.clientY - context.startY;
if (dx * dx + dy * dy > 100) {
if (context.pressHandler !== null) {
clearTimeout(context.pressHandler);
context.pressHandler = null;
context.isPress = false;
} else if (context.isPress) {
context.isPress = false;
let e = new Event("presscancel");
main.dispatchEvent(e);
}
context.isTap = false;
if (context.isPan === false) {
if (Math.abs(dx) > Math.abs(dy)) {
context.isVertical = false;
context.isHorizontal = true;
} else {
context.isVertical = true;
context.isHorizontal = false;
}
let e = new Event("panstart");
e.startX = context.startX;
e.startY = context.startY;
main.dispatchEvent(e);
context.isPan = true;
}
}
if (context.isPan) {
let e = new Event("pan");
e.dx = dx;
e.dy = dy;
e.isHorizontal = context.isHorizontal;
e.isVertical = context.isVertical;
main.dispatchEvent(e);
}
//console.log(dx , dy);
};
let end = (point, context) => {
//console.log("end")
if (context.pressHandler !== null) {
clearTimeout(context.pressHandler);
}
if (context.isPress) {
let e = new Event("pressend");
main.dispatchEvent(e);
}
if (context.isTap) {
let e = new Event("tap");
main.dispatchEvent(e);
}
let dx = point.clientX - context.startX, dy = point.clientY - context.startY;
let v = Math.sqrt(dx * dx + dy * dy) / (Date.now() - context.startTime);
//console.log(v);
// 判断是否为:迅速离开
if (context.isPan && v > 0.3) {
context.isFlick = true;
let e = new Event("flick");
e.dx = dx;
e.dy = dy;
main.dispatchEvent(e);
} else {
context.isFlick = false;
}
if (context.isPan) {
let e = new Event("panend");
e.dx = dx;
e.dy = dy;
e.isFlick = context.isFlick;
e.isHorizontal = context.isHorizontal;
e.isVertical = context.isVertical;
main.dispatchEvent(e);
}
};
let cancel = (point, context) => {
if (context.isPan) {
let e = new Event("pancancel");
main.dispatchEvent(e);
}
if (context.isPress) {
let e = new Event("presscancel");
main.dispatchEvent(e);
}
if (context.pressHandler !== null) {
let e = new Event("pancancel");
main.dispatchEvent(e);
clearTimeout(context.pressHandler);
}
};
/*
Object.create(null)
1.你需要一个非常干净且高度可定制的对象当作数据字典的时候;
2.想节省hasOwnProperty带来的一丢丢性能损失并且可以偷懒少些一点代码的时候
*/
let contexts = Object.create(null);
let mouseSymbol = Symbol("mouse");
let mousedown = event => {
document.addEventListener("mousemove", mousemove);
document.addEventListener("mouseup", mouseup);
contexts[mouseSymbol] = Object.create(null);
start(event, contexts[mouseSymbol]);
};
let mousemove = event => {
move(event, contexts[mouseSymbol]);
};
let mouseup = event => {
document.removeEventListener("mousemove", mousemove);
document.removeEventListener("mouseup", mouseup);
end(event, contexts[mouseSymbol]);
delete contexts[mouseSymbol];
};
main.addEventListener("mousedown", mousedown);
let touchstart = event => {
for (let touch of event.changedTouches) {
contexts[touch.identifier] = Object.create(null);
start(touch, contexts[touch.identifier]);
}
};
let touchmove = event => {
event.stopImmediatePropagation();
for (let touch of event.changedTouches)
move(touch, contexts[touch.identifier]);
};
let touchend = event => {
for (let touch of event.changedTouches) {
end(touch, contexts[touch.identifier]);
delete contexts[touch.identifier];
}
};
let touchcancel = event => {
for (let touch of event.changedTouches) {
cancel(touch, contexts[touch.identifier]);
delete contexts[touch.identifier];
}
};
main.addEventListener("touchstart", touchstart);
main.addEventListener("touchmove", touchmove);
main.addEventListener("touchend", touchend);
main.addEventListener("touchcancel", touchcancel);
}
| 32.248555 | 85 | 0.525363 |
a1fa4a74a1f4f44b6dc4c44fd0a70236f9b7609d | 100 | js | JavaScript | lib/mixer.js | MikeLindenau/emu | 86b2ec1b08a2224cd19f8b248ab3951612839d9f | [
"MIT"
] | null | null | null | lib/mixer.js | MikeLindenau/emu | 86b2ec1b08a2224cd19f8b248ab3951612839d9f | [
"MIT"
] | null | null | null | lib/mixer.js | MikeLindenau/emu | 86b2ec1b08a2224cd19f8b248ab3951612839d9f | [
"MIT"
] | null | null | null |
module.exports = function mixer(root) {
return function (func) {
return func.call(root)
}
} | 16.666667 | 39 | 0.66 |
a1fa995c17f90dcc38c3a96fb9e0e35d33240aae | 2,724 | js | JavaScript | app/assets/javascripts/registry/explorer/constants/details.js | RyanCatalina/gitlabhq | c8003cdfe1597fa6aab21e91aab8cb77097e7eea | [
"MIT"
] | 1 | 2020-06-07T14:35:40.000Z | 2020-06-07T14:35:40.000Z | app/assets/javascripts/registry/explorer/constants/details.js | RyanCatalina/gitlabhq | c8003cdfe1597fa6aab21e91aab8cb77097e7eea | [
"MIT"
] | null | null | null | app/assets/javascripts/registry/explorer/constants/details.js | RyanCatalina/gitlabhq | c8003cdfe1597fa6aab21e91aab8cb77097e7eea | [
"MIT"
] | null | null | null | import { s__ } from '~/locale';
// Translations strings
export const DETAILS_PAGE_TITLE = s__('ContainerRegistry|%{imageName} tags');
export const DELETE_TAG_ERROR_MESSAGE = s__(
'ContainerRegistry|Something went wrong while marking the tag for deletion.',
);
export const DELETE_TAG_SUCCESS_MESSAGE = s__(
'ContainerRegistry|Tag successfully marked for deletion.',
);
export const DELETE_TAGS_ERROR_MESSAGE = s__(
'ContainerRegistry|Something went wrong while marking the tags for deletion.',
);
export const DELETE_TAGS_SUCCESS_MESSAGE = s__(
'ContainerRegistry|Tags successfully marked for deletion.',
);
export const LIST_LABEL_TAG = s__('ContainerRegistry|Tag');
export const LIST_LABEL_IMAGE_ID = s__('ContainerRegistry|Image ID');
export const LIST_LABEL_SIZE = s__('ContainerRegistry|Compressed Size');
export const LIST_LABEL_LAST_UPDATED = s__('ContainerRegistry|Last Updated');
export const REMOVE_TAG_BUTTON_TITLE = s__('ContainerRegistry|Remove tag');
export const REMOVE_TAGS_BUTTON_TITLE = s__('ContainerRegistry|Remove selected tags');
export const REMOVE_TAG_CONFIRMATION_TEXT = s__(
`ContainerRegistry|You are about to remove %{item}. Are you sure?`,
);
export const REMOVE_TAGS_CONFIRMATION_TEXT = s__(
`ContainerRegistry|You are about to remove %{item} tags. Are you sure?`,
);
export const EMPTY_IMAGE_REPOSITORY_TITLE = s__('ContainerRegistry|This image has no active tags');
export const EMPTY_IMAGE_REPOSITORY_MESSAGE = s__(
`ContainerRegistry|The last tag related to this image was recently removed.
This empty image and any associated data will be automatically removed as part of the regular Garbage Collection process.
If you have any questions, contact your administrator.`,
);
export const ADMIN_GARBAGE_COLLECTION_TIP = s__(
'ContainerRegistry|Remember to run %{docLinkStart}garbage collection%{docLinkEnd} to remove the stale data from storage.',
);
// Parameters
export const DEFAULT_PAGE = 1;
export const DEFAULT_PAGE_SIZE = 10;
export const GROUP_PAGE_TYPE = 'groups';
export const LIST_KEY_TAG = 'name';
export const LIST_KEY_IMAGE_ID = 'short_revision';
export const LIST_KEY_SIZE = 'total_size';
export const LIST_KEY_LAST_UPDATED = 'created_at';
export const LIST_KEY_ACTIONS = 'actions';
export const LIST_KEY_CHECKBOX = 'checkbox';
export const ALERT_SUCCESS_TAG = 'success_tag';
export const ALERT_DANGER_TAG = 'danger_tag';
export const ALERT_SUCCESS_TAGS = 'success_tags';
export const ALERT_DANGER_TAGS = 'danger_tags';
export const ALERT_MESSAGES = {
[ALERT_SUCCESS_TAG]: DELETE_TAG_SUCCESS_MESSAGE,
[ALERT_DANGER_TAG]: DELETE_TAG_ERROR_MESSAGE,
[ALERT_SUCCESS_TAGS]: DELETE_TAGS_SUCCESS_MESSAGE,
[ALERT_DANGER_TAGS]: DELETE_TAGS_ERROR_MESSAGE,
};
| 44.655738 | 124 | 0.801028 |
a1fd6aa04383574607494888d3828e5c3021ad79 | 366 | js | JavaScript | extension/src/content/templates/position.js | knightjdr/gene-info | 9cf539ed477b2b722b0181eae6c14e6ea639d821 | [
"MIT"
] | 11 | 2019-01-31T15:44:37.000Z | 2022-02-02T23:37:46.000Z | extension/src/content/templates/position.js | knightjdr/gene-info | 9cf539ed477b2b722b0181eae6c14e6ea639d821 | [
"MIT"
] | 16 | 2019-01-22T17:06:41.000Z | 2022-02-24T18:41:27.000Z | extension/src/content/templates/position.js | knightjdr/gene-info | 9cf539ed477b2b722b0181eae6c14e6ea639d821 | [
"MIT"
] | 1 | 2019-02-04T02:40:15.000Z | 2019-02-04T02:40:15.000Z | const position = (stateStyle, panel = true) => {
let style = '';
if (stateStyle.right) {
style += `left: auto;right: ${stateStyle.right};`;
} else if (stateStyle.left) {
style += `left: ${stateStyle.left};right: auto;`;
}
if (panel && stateStyle.width) {
style += `width: ${stateStyle.width};`;
}
return style;
};
export default position;
| 24.4 | 54 | 0.603825 |
a1fdc175a780d4c71174730628d53eb0e9c35aee | 630 | js | JavaScript | yt/index.asp_arquivos/topo_data/banner_rotativo.js | igormba/yogoreta-tamashii | 00b9df0284eba6716b28bfa694b1099338d8cf31 | [
"MIT"
] | null | null | null | yt/index.asp_arquivos/topo_data/banner_rotativo.js | igormba/yogoreta-tamashii | 00b9df0284eba6716b28bfa694b1099338d8cf31 | [
"MIT"
] | null | null | null | yt/index.asp_arquivos/topo_data/banner_rotativo.js | igormba/yogoreta-tamashii | 00b9df0284eba6716b28bfa694b1099338d8cf31 | [
"MIT"
] | null | null | null | function Banners()
{
var MNews = new Array();
MNews[0]= '<A HREF="http://www.tvshow.com.br/v2/assinar/assinar.asp" TARGET="conteudo"><IMG SRC="http://www.tvshow.com.br/v2/campanha_mes/CP_Outubro_07.gif" WIDTH=468 HEIGHT=60 BORDER=0></a>'
MNews[1]= '<A HREF="http://www.tvshow.com.br/v2/promocoes/pg_promocoes.asp?Cod_Promo=9" onclick="NewWindow(this.href,janela,300,353,no,resizable=yes);return false;"><IMG SRC="http://www.tvshow.com.br/v2/promocoes/img_promocoes/top_model/banner_top_model.gif" WIDTH=468 HEIGHT=60 BORDER=0></a>'
var Numero = Math.floor(Math.random()*2);
document.write(MNews[Numero]);
} | 70 | 298 | 0.714286 |
a1fdcbea4cae1cdaf7f47d7eab40aba84b84535d | 431 | js | JavaScript | src/pages/index.js | AnssamGhezala/portfolio-v3 | 9579f8ac53ec3a94a3d30b82fd285dffe6ea5198 | [
"MIT"
] | null | null | null | src/pages/index.js | AnssamGhezala/portfolio-v3 | 9579f8ac53ec3a94a3d30b82fd285dffe6ea5198 | [
"MIT"
] | 1 | 2019-11-10T01:36:32.000Z | 2019-11-11T06:36:31.000Z | src/pages/index.js | AnssamGhezala/portfolio-v3 | 9579f8ac53ec3a94a3d30b82fd285dffe6ea5198 | [
"MIT"
] | null | null | null | import React from "react"
import Layout from "../components/layout"
import * as Styled from "../stylesheet/styled"
import { Helmet } from "react-helmet"
import HomeDescription from "../components/HomeDescription"
export default () => (
<Layout>
<Helmet>
<meta charSet="utf-8" />
<title>Anssam Ghezala's portfolio</title>
</Helmet>
<Styled.home>
<HomeDescription />
</Styled.home>
</Layout>
)
| 23.944444 | 59 | 0.656613 |
a1fe92d5630bf80d39d5cfb79411cbef60b3c849 | 298 | js | JavaScript | server/middleware/ctx.js | bxm0927/nuxt-template | 537a1e6a77d3d5930c58ca8ce83c7f753a84792a | [
"MIT"
] | 3 | 2020-05-04T15:37:17.000Z | 2020-08-06T17:00:45.000Z | server/middleware/ctx.js | bxm0927/nuxt-template | 537a1e6a77d3d5930c58ca8ce83c7f753a84792a | [
"MIT"
] | 3 | 2021-03-10T16:25:52.000Z | 2022-01-22T11:51:09.000Z | server/middleware/ctx.js | bxm0927/nuxt-template | 537a1e6a77d3d5930c58ca8ce83c7f753a84792a | [
"MIT"
] | null | null | null | /*
* 通过 `req.ctx(Model)` 来创建一个 Model
* @Author: xiaoming.bai
* @Date: 2020-05-03 11:31:09
* @Last Modified by: xiaoming.bai
* @Last Modified time: 2020-05-03 12:26:23
*/
module.exports = () => (req, res, next) => {
const ctx = { req, res }
req.ctx = (Model) => new Model(ctx)
next()
}
| 21.285714 | 44 | 0.590604 |
a1ff224d2f95c8ae5bbc90771535612ad6dfa2d6 | 3,694 | js | JavaScript | snowpear/libs/core/egret/text/TextInput.js | sunzhaoping/fastmsg | 5dd0660f260d6a99de09fb130e0727bbb9ec94cb | [
"MIT"
] | 1 | 2018-12-06T14:03:33.000Z | 2018-12-06T14:03:33.000Z | snowpear/libs/core/egret/text/TextInput.js | sunzhaoping/fastmsg | 5dd0660f260d6a99de09fb130e0727bbb9ec94cb | [
"MIT"
] | null | null | null | snowpear/libs/core/egret/text/TextInput.js | sunzhaoping/fastmsg | 5dd0660f260d6a99de09fb130e0727bbb9ec94cb | [
"MIT"
] | 2 | 2019-06-14T11:10:55.000Z | 2021-04-08T06:11:05.000Z | /**
* Copyright (c) 2014,Egret-Labs.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Egret-Labs.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EGRET-LABS.ORG AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var egret;
(function (egret) {
/**
* @classdesc
* TextInput 已废弃,请使用TextField代替,并设置type为TextFieldType.INPUT
* @extends egret.TextField
* @deprecated
*/
var TextInput = (function (_super) {
__extends(TextInput, _super);
function TextInput() {
_super.call(this);
egret.Logger.warning("TextInput 已废弃,请使用TextField代替,并设置type为TextFieldType.INPUT");
this.type = egret.TextFieldType.INPUT;
}
/**
* 请使用TextField.text设置
* @deprecated
* @param value
*/
TextInput.prototype.setText = function (value) {
egret.Logger.warning("TextField.setText()已废弃,请使用TextInput.text设置");
this.text = value;
};
/**
* 请使用TextInput.text获取
* @deprecated
* @returns {string}
*/
TextInput.prototype.getText = function () {
egret.Logger.warning("TextField.getText()已废弃,请使用TextInput.text获取");
return this.text;
};
/**
* 请使用TextInput.displayAsPassword设置
* @deprecated
* @param value
*/
TextInput.prototype.setTextType = function (type) {
egret.Logger.warning("TextField.setTextType()已废弃,请使用TextInput.displayAsPassword设置");
this.displayAsPassword = type == "password";
};
/**
* 请使用TextInput.displayAsPassword获取
* @deprecated
* @returns {string}
*/
TextInput.prototype.getTextType = function () {
egret.Logger.warning("TextField.getTextType()已废弃,请使用TextInput.displayAsPassword获取");
return this.displayAsPassword ? "password" : "text";
};
return TextInput;
})(egret.TextField);
egret.TextInput = TextInput;
TextInput.prototype.__class__ = "egret.TextInput";
})(egret || (egret = {}));
| 41.505618 | 96 | 0.651868 |
a1ffe47857d7a9dd06c1946ce51c89420e189796 | 1,028 | js | JavaScript | components/Species/OnlineOnlyCards/About.js | nateridderman/SeekReactNative | 0db2c29e399ea70b9410cacff671c5cf12f5509d | [
"MIT"
] | null | null | null | components/Species/OnlineOnlyCards/About.js | nateridderman/SeekReactNative | 0db2c29e399ea70b9410cacff671c5cf12f5509d | [
"MIT"
] | null | null | null | components/Species/OnlineOnlyCards/About.js | nateridderman/SeekReactNative | 0db2c29e399ea70b9410cacff671c5cf12f5509d | [
"MIT"
] | null | null | null | // @flow
import React, { useContext } from "react";
import { Text } from "react-native";
import { useNavigation } from "@react-navigation/native";
import { UserContext } from "../../UserContext";
import SpeciesDetailCard from "../../UIComponents/SpeciesDetailCard";
import styles from "../../../styles/species/species";
import { useCommonName } from "../../../utility/customHooks";
type Props = {
+about: ?string,
+wikiUrl: ?string,
+id: ?number
}
const About = ( {
about,
wikiUrl,
id
}: Props ) => {
const navigation = useNavigation();
const { login } = useContext( UserContext );
const commonName = useCommonName( id );
return (
<SpeciesDetailCard text="species_detail.about">
<Text style={styles.text}>{about}</Text>
{( login && id !== 43584 ) && (
<Text
onPress={() => navigation.navigate( "Wikipedia", { wikiUrl } )}
style={styles.linkText}
>
{commonName}
</Text>
)}
</SpeciesDetailCard>
);
};
export default About;
| 24.47619 | 73 | 0.608949 |
b800feb8bb824be82ad95d95c3e6f7c658743e95 | 29 | js | JavaScript | src/test/proxy/$-proxy.js | web-cache/js-design-pattern | 9e21e0052ff61b219b0cba759878a34830e58cca | [
"MIT"
] | null | null | null | src/test/proxy/$-proxy.js | web-cache/js-design-pattern | 9e21e0052ff61b219b0cba759878a34830e58cca | [
"MIT"
] | null | null | null | src/test/proxy/$-proxy.js | web-cache/js-design-pattern | 9e21e0052ff61b219b0cba759878a34830e58cca | [
"MIT"
] | null | null | null |
$.proxy(function(){}, this)
| 9.666667 | 27 | 0.586207 |
b801b99f332773204aac1097cebb802227793521 | 433 | js | JavaScript | server.js | JulianMayorga/Hapi-Socket-io-Heroku | b7f6f45f4c4dc0152680a4883b55159becffc701 | [
"MIT"
] | null | null | null | server.js | JulianMayorga/Hapi-Socket-io-Heroku | b7f6f45f4c4dc0152680a4883b55159becffc701 | [
"MIT"
] | null | null | null | server.js | JulianMayorga/Hapi-Socket-io-Heroku | b7f6f45f4c4dc0152680a4883b55159becffc701 | [
"MIT"
] | null | null | null | var mongoose = require('mongoose');
var Composer = require('./index');
var Config = require('./config');
var Socket = require('./server/api/socket');
var socket;
Composer(function(err, server) {
if (err) {
throw err;
}
socket = Object.create(Socket);
socket.initialize(server.listener);
mongoose.connect(Config.get('/db/url'));
server.start(function() {
console.log('Started the plot device.');
});
});
| 17.32 | 44 | 0.648961 |
b80201d7f3db11ed91e9464c2048c3a45e050f47 | 657 | js | JavaScript | src/hocs/withVariant/index.js | ghalex/zebbra | 9c82560c9d89ff67130f9407e7eae707b2e059de | [
"MIT"
] | 2 | 2018-07-04T17:21:15.000Z | 2018-09-20T14:47:13.000Z | src/hocs/withVariant/index.js | ghalex/zebbra | 9c82560c9d89ff67130f9407e7eae707b2e059de | [
"MIT"
] | null | null | null | src/hocs/withVariant/index.js | ghalex/zebbra | 9c82560c9d89ff67130f9407e7eae707b2e059de | [
"MIT"
] | null | null | null | import React from 'react'
import { compose } from 'recompose'
import setWrappedDisplayName from '../setWrappedDisplayName'
const withVariant = (key) => BaseComponent => {
class WithVariant extends React.Component {
render () {
let { variant, theme } = this.props
let variantProps = {}
if (variant && theme && theme.components[key] && theme.components[key][variant]) {
variantProps = theme.components[key][variant]
}
return (
<BaseComponent {...this.props} {...variantProps} />
)
}
}
return compose(
setWrappedDisplayName('withVariant')
)(WithVariant)
}
export default withVariant
| 24.333333 | 88 | 0.648402 |
b80253fd68f46d212b0194b9eb0ad0740205c31a | 2,887 | js | JavaScript | lib/apiLoader.js | IMAT-OS/Omega | b2558162e35afb3ad4507624058dee2965ca85d9 | [
"MIT"
] | 1 | 2019-11-26T21:52:53.000Z | 2019-11-26T21:52:53.000Z | lib/apiLoader.js | IMAT-OS/Omega | b2558162e35afb3ad4507624058dee2965ca85d9 | [
"MIT"
] | null | null | null | lib/apiLoader.js | IMAT-OS/Omega | b2558162e35afb3ad4507624058dee2965ca85d9 | [
"MIT"
] | 1 | 2019-11-26T21:52:59.000Z | 2019-11-26T21:52:59.000Z | const debug = require('debug')('Omega:apiLoader');
const fs = require('fs');
const path = require('path').posix;
const Module = require('module');
const {isFalse, isTrue} = require('@imat/omegalib');
const HttpError = require('./HttpError.js');
const HttpResponse = require('./HttpResponse.js');
const {mergePatch, mergeData} = require('./mergePatch.js');
const throw404 = require('./throw404.js');
const args = 'apimodule, require, __dirname, __filename, throw404, HttpError, HttpResponse, isFalse, isTrue, mergeData, mergePatch';
const mainPaths = require.main.paths;
const fixPath = srcPath => srcPath.replace(/\\|[A-Z]\:[\/\\]/g, '/');
module.paths = mainPaths;
class MyModule extends Module {
constructor(parent, apiFolder, apiRoot) {
const id = path.join(apiFolder, 'fakeModule.js');
super(id, parent);
this.filename = id;
this.apiPath = apiFolder;
this.libPath = path.join(path.dirname(this.apiPath), 'lib');
debug(`Loading the API module: ${apiFolder} - ${id} - ${parent.id}`);
this.paths = [...parent.paths];
this.exports = {};
this.apiRoot = apiRoot;
}
require(fname, mockModules = {}, instrumenter = null) {
if (!'./\\'.includes(fname[0])) {
// If this is an external repo module then use the existing require.
return super.require(fname);
}
// Force the require() statements used in API files to be relative to the './lib' folder
const moduleRequire = libPath => (modname) => {
debug(`API module: [${this.id}] is requiring ${modname}`);
// Support the ability to return mocks of modules
return mockModules[modname] || ('./\\'.includes(modname[0]) ? require.main.require(path.join(libPath, modname)) : require(modname));
}
const fPath = path.join(this.apiPath, fname+'.js');
const modFilename = fixPath(path.resolve(fPath));
const modDirname = path.dirname(modFilename);
let src = fs.readFileSync(fPath, 'utf8');
const fnSrc = instrumenter ? instrumenter(src, fPath) : src;
// We create a new Function to protect against variable leakage, in or out.
// JavaScript creates the new function from a clean scope meaning that no closure variables
// from outside the function are available inside the funciton. The API code only has access
// to `global` and the variables we pass in. It also prevents any naming collisions of
// variables defined in the API code.
let fn = new Function(args, fnSrc); // eslint-disable-line no-new-func
fn(this, moduleRequire(this.libPath), modDirname, modFilename, throw404, HttpError, HttpResponse, isFalse, isTrue, mergeData, mergePatch);
return this.exports;
}
}
function init(apiFolder, apiRootUrl) {
const myMod = new MyModule(module, fixPath(apiFolder), apiRootUrl);
return (src, mockModules, instrumenter) => myMod.require(src, mockModules, instrumenter);
}
module.exports = init;
| 43.742424 | 142 | 0.688258 |
b802ab305088658d32cba44e788e82e4934b8156 | 13,726 | js | JavaScript | docs.js | DevSnowflake/snowflake-development | b07a6098fb15e6c6bc2f899bd0310f457af4040a | [
"Apache-2.0"
] | 3 | 2020-10-15T07:56:05.000Z | 2020-11-06T09:39:52.000Z | docs.js | Snowflake107/snowflake-development | b07a6098fb15e6c6bc2f899bd0310f457af4040a | [
"Apache-2.0"
] | null | null | null | docs.js | Snowflake107/snowflake-development | b07a6098fb15e6c6bc2f899bd0310f457af4040a | [
"Apache-2.0"
] | 2 | 2020-07-17T12:26:47.000Z | 2020-09-16T12:04:25.000Z | module.exports = b => {
const data = [
{
keywords: [
"add",
"addmoney",
"eco#add",
"eco#addmoney",
"eco.add",
"eco.addmoney"
],
type: "method",
description: "Adds money to a user.",
function: "addMoney",
params: [
{ type: "string", name: "id", description: "User id" },
{ type: "number", name: "amount", description: "Amount to add" }
],
returns: "{ before, after, user, amount }",
example: `let data = eco.addMoney("1234567890", ${
b ? "'7161617171727'," : ""
} 100);
console.log("Added "+data.amount+" to "+data.user.toString());`
},
{
keywords: [
"remove",
"removemoney",
"subtract",
"eco#remove",
"eco#removemoney",
"eco.remove",
"eco.removemoney"
],
type: "method",
description: "Removes money from a user",
function: "removeMoney",
params: [
{ type: "string", name: "id", description: "User id" },
{ type: "number", name: "amount", description: "Amount to remove" }
],
returns: "{ before, after, user, amount }",
example: `let data = eco.removeMoney("1234567890", ${
b ? "'81727271717227'," : ""
} 50);
console.log(\`Removed \${data.amount} from \${data.user}\`)`
},
{
keywords: [
"fetch",
"fetchmoney",
"eco#fetch",
"eco#fetchmoney",
"eco.fetch",
"eco.fetchmoney"
],
type: "method",
description: "Fetches the money of a user.",
function: "fetchMoney",
params: [{ type: "string", name: "id", description: "User id" }],
returns: "{ amount, user, position }",
example: `let data = eco.fetchMoney("1234567890"${
b ? ",'716162737373737'" : ""
});
console.log(\`\${data.user} has \${data.amount} money and their rank is \${data.position}.\`)`
},
{
keywords: [
"set",
"setmoney",
"eco#set",
"eco#setmoney",
"eco.set",
"eco.setmoney"
],
type: "method",
description: "Sets the money by overwriting existing one.",
function: "setMoney",
params: [
{ type: "string", name: "id", description: "User id" },
{ type: "number", name: "amount", description: "Amount to set" }
],
returns: "{ before, after, user, amount }",
example: `let data = eco.setMoney("1234567890", ${
b ? "'7272727282827'," : ""
} 1000);
console.log(\`Your new money is \${data.after}.\`)`
},
{
keywords: ["manager", "eco#manager", "eco.manager"],
type: "method",
description: "Instantiates quick.eco class.",
params: [
{ name: "Table Name", type: "string", description: "Table Name" }
],
function: "new " + !b ? "Manager()" : "GuildManager()",
returns: "quick.eco",
example: `const Eco = require("quick.eco");
const eco = new Eco.${b ? "GuildManager()" : "Manager()"};`
},
{
keywords: ["version", "eco#version", "eco.version"],
type: "property",
description: "Returns quick.eco version",
params: [],
function: null,
returns: "[quick.eco]#version",
example: `console.log(\`I'm using \${Eco.version} of quick.eco :D\`);`
},
{
keywords: [
"manager.entries",
"manager#entries",
"entries",
"total",
"eco.entries",
"eco#entries"
],
type: "property",
description: "Total entries count",
params: [],
function: null,
returns: "Number:<Entries>",
example: "We have ${eco.entries} entries."
},
{
keywords: [
"lb",
"leaderboard",
"eco#lb",
"eco#leaderboard",
"eco.lb",
"eco.leaderboard"
],
type: "method",
description: "Leaderboard!",
function: "leaderboard",
isEco: false,
params: b
? [
{ type: "string", name: "guildid", description: "Guild ID" },
{
type: "number",
name: "options#limit",
description: "Leaderboard Limit"
},
{
type: "boolean",
name: "options#raw",
description: "Should return raw leaderboard?"
}
]
: [
{
type: "number",
name: "options#limit",
description: "Leaderboard Limit"
},
{
type: "boolean",
name: "options#raw",
description: "Should return raw leaderboard?"
}
],
returns: "[{ position, id, money }]",
example: `let lb = eco.leaderboard(${
b ? "'7171762627272'," : ""
}{ limit: 10, raw: false });
const embed = new Discord.MessageEmbed()
.setAuthor("Leaderboard")
.setColor("BLURPLE");
lb.forEach(u => {
embed.addField(\`\${u.position}. \${client.users.get(u.id).tag}\`, \`Money: \${u.money} 💸\`);
});
return message.channel.send(embed);`
},
{
keywords: [
"eco#transfer",
"eco.transfer",
"transfer",
"transfermoney",
"eco#transfermoney",
"eco.transfermoney"
],
type: "method",
description: "Transfers the money from one user to another.",
function: "transfer",
params: [
{ type: "string", name: "user1", description: "Id of giver" },
{ type: "string", name: "user2", description: "Id of receiver" },
b
? ({ type: "string", name: "guildid", description: "Guild ID" },
{
type: "number",
name: "amount",
description: "Amount to transfer"
})
: {
type: "number",
name: "amount",
description: "Amount to transfer"
}
],
isEco: false,
returns: "{ user1, user2, amount }",
example: `let data = eco.transfer("1234567890", "0987654321", ${
b ? "'72717222727'," : ""
} 100);
console.log(\`\${data.user1.id} gave \${data.amount} to \${data.user2.id}.\`)`
},
{
keywords: ["delete", "deleteuser", "eco.deleteuser", "eco#deleteuser"],
type: "method",
description: "Deletes a user from the database.",
function: "deleteUser",
params: [
{
type: "string",
name: "userid",
description: "Id of a user to delete."
}
],
returns: "{ before, after, user }",
example: `let data = eco.deleteUser("1234567890"${
b ? ",'7274848383'" : ""
});
console.log(\`Deleted user \${data.user}!\`)`
},
{
keywords: ["eco#daily", "eco.daily", "daily"],
type: "method",
description: "Daily balance",
function: "daily",
params: [
{ type: "string", name: "userid", description: "User id" },
{ type: "number", name: "amount", description: "amount" }
],
returns:
"{ onCooldown, newCooldown, claimedAt, timeout, before, after, user, amount, time }",
example: `let add = eco.daily(message.author.id, ${
b ? "'72727227754'," : ""
} 500);\nif (add.onCooldown) return message.reply(\`You already claimed your daily coins. Come back after \${add.time.days} days, \${add.time.hours} hours, \${add.time.minutes} minutes & \${add.time.seconds} seconds.\`);\nreturn message.reply(\`you claimed \${add.amount} as your daily coins and now you have total \${add.after} coins.\`);`
},
{
keywords: ["eco#weekly", "eco.weekly", "weekly"],
type: "method",
description: "Weekly balance",
function: "weekly",
params: [
{ type: "string", name: "userid", description: "User id" },
{ type: "number", name: "amount", description: "amount" }
],
returns:
"{ onCooldown, newCooldown, claimedAt, timeout, before, after, user, amount, time }",
example:
"let add = eco.weekly(message.author.id," + b
? "'3772722727272',"
: "" +
" 500);\nif (add.onCooldown) return message.reply(`You already claimed your weekly coins. Come back after ${add.time.days} days, ${add.time.hours} hours, ${add.time.minutes} minutes & ${add.time.seconds} seconds.`);\nreturn message.reply(`You claimed ${add.amount} as your weekly coins and now you have total ${add.after} coins.`);"
},
{
keywords: ["eco#beg", "eco.beg", "beg"],
type: "method",
description: "Beg money.",
function: "beg",
params: [
{ type: "string", name: "userid", description: "User id" },
{ type: "number", name: "amount", description: "amount" },
{
type: "boolean",
name: "options#canLose",
description: "User should randomly lose?"
},
{ type: "number", name: "cooldown", description: "Cooldown" },
{
type: "string",
name: "customName",
description: "Custom Cooldown name"
}
],
returns:
"{ onCooldown, newCooldown, claimedAt, timeout, before, after, user, amount, time, lost }",
example:
"let add = eco.beg(message.author.id," + b
? "'7372727277272',"
: "" +
' 500, { canLose: true });\nif (add.onCooldown) return message.reply(`You already begged for coins. Come back after ${add.time.minutes} minutes & ${add.time.seconds} seconds.`);\nif (add.lost) return message.channel.send("Get Lost!")\nreturn message.reply(`You got ${add.amount} coins.`);'
},
{
keywords: ["work", "eco#work", "eco.work"],
type: "method",
description: "Work and earn.",
function: "work",
params: [
{ type: "string", name: "userid", description: "User id" },
{ type: "number", name: "amount", description: "Amount" },
{
type: "array",
name: "options#jobs",
description: "Job list. (Not required)"
},
{ type: "number", name: "options#cooldown", description: "Cooldown." }
],
returns:
"{ onCooldown, newCooldown, claimedAt, timeout, before, after, user, amount, workedAs, time }",
example: `let amount = Math.floor(Math.random() * 1500) + 1000;
let work = eco.work(message.author.id,${
b ? "'37727272828282|," : ""
} amount);
if (work.onCooldown) return message.reply(\`You are tired rn. Come back after \${work.time.minutes} minutes & \${work.time.seconds} seconds to work again.\`);
else return message.reply(\`You worked as **\${work.workedAs}** and earned **\${work.amount}** 💸. Now you have **\${work.after}** 💸.\`);`
},
{
isEco: false,
keywords: ["db", "quickdb", "database", "eco#db", "eco.db"],
type: "method",
description: "Quick.db Database",
function: "db",
params: [
{ type: "string", name: "name", description: "Database File Name" }
],
returns: "quick.db",
example: `const Eco = require("quick.eco");
const db = Eco.db("./database");
db.add("balance", 100);
db.get("balance");
db.startsWith("balance", { sort: ".data" });
db.deleteAll();
`
},
{
keywords: ["ms", "eco#ms", "eco.ms"],
type: "method",
description: "Milliseconds Parser",
function: "ms",
params: [
{
type: "number",
name: "milliseconds",
description: "Time in milliseconds to parse."
}
],
returns:
"{ days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds }",
example: `const ms = Eco.ms;
const time = ms(19994);
console.log(time.hours);`,
isEco: false
},
{
keywords: ["reset", "eco.reset", "eco#reset"],
type: "method",
description: "Drops the table",
function: "reset()",
params: [],
returns: "boolean",
example: "eco.reset()",
isEco: false
},
{
keywords: ["eco.setbank", "setbank", "eco#setbank"],
type: "method",
description: "Set User Bank",
function: "setBank",
params: [
{ name: "userid", type: "string", description: "User ID" },
{ name: "amount", type: "number", description: "Amount" }
],
returns: "{ before, after, user, amount }",
example: `eco.setBank("188288948383", ${
b ? '"7372718282828828",' : ""
}500);`
},
{
keywords: ["eco.deposit", "eco.depositMoney", "deposit", "eco#deposit"],
type: "method",
description: "Deposit money in Bank account",
function: "depositMoney",
params: [
{ name: "userid", type: "string", description: "User ID" },
{ name: "amount", type: "number", description: "Amount" }
],
returns: "{ before, after, user, amount }",
example: `eco.depositMoney("188288948383", ${
b ? "\"72727727272\"," : ""
}500);`
},
{
keywords: [
"eco.withdraw",
"eco.withdrawMoney",
"withdraw",
"eco#withdraw"
],
type: "method",
description: "Withdraw money from Bank account",
function: "withdrawMoney",
params: [
{ name: "userid", type: "string", description: "User ID" },
{ name: "amount", type: "number", description: "Amount" }
],
returns: "{ before, after, user, amount }",
example: `eco.withdrawMoney("188288948383",${
b ? "\"727271822272727\"," : ""
} 500);`
}
];
data.forEach(i => {
if (i.isEco === undefined) i.isEco = true;
else i.isEco = false;
});
return data;
};
| 32.916067 | 346 | 0.517704 |
b80333d3133c695c1ab6119efa1405d815c5f12f | 11,831 | js | JavaScript | node_modules/couch-db/lib/doc.js | DrRaider/UniShare | b8e203831ef263e4984e401431c069f9e9ef966f | [
"MIT"
] | 1 | 2017-05-16T00:23:07.000Z | 2017-05-16T00:23:07.000Z | node_modules/couch-db/lib/doc.js | DrRaider/UniShare | b8e203831ef263e4984e401431c069f9e9ef966f | [
"MIT"
] | null | null | null | node_modules/couch-db/lib/doc.js | DrRaider/UniShare | b8e203831ef263e4984e401431c069f9e9ef966f | [
"MIT"
] | null | null | null | var _ = require('underscore'),
assert = require('assert'),
util = require('util'),
qs = require('querystring'),
RequestBase = require('./base');
function Document(dburl, doc, options) {
// assign alias
this.delete = this.del = this.destroy;
this.get = this.open;
if (!dburl)
throw new Error('Database url should not be empty');
RequestBase.call(this, options);
this.dburl = dburl;
if (typeof doc === 'string') {
this._id = doc;
doc = undefined;
} else {
this._id = doc._id;
this.set(doc);
}
}
util.inherits(Document, RequestBase);
_.extend(Document.prototype, {
_encodeId: function() {
return encodeURIComponent(this._id);
},
new: function(newDoc) {
if (newDoc)
this.doc = _.clone(newDoc);
this._id = undefined;
this._rev = undefined;
this._attachments = undefined;
return this;
},
id: function(id) {
if (!arguments.length)
return this._id;
this._id = id;
this.doc && (this.doc._id = id);
return this;
},
rev: function(rev) {
if (!arguments.length)
return this._rev;
this._rev = rev;
this.doc && (this.doc._rev = rev);
return this;
},
attach: function(attname, data, type) {
var atts = {};
if (arguments.length == 1) {
if (Array.isArray(attname)) {
attname.forEach(function(att) {
assert(Buffer.isBuffer(att.data) || (typeof att.data == 'string'), 'buffer must be a Buffer of String instance');
var data = (typeof att.data == 'string') ? new Buffer(att.data) : att.data;
atts[att.name] = {
'content_type': att.type || att.content_type,
'data': data.toString('base64')
};
});
} else {
for (var name in attname) {
var att = attname[name];
assert(Buffer.isBuffer(att.data) || (typeof att.data == 'string'), 'buffer must be a Buffer of String instance');
var data = (typeof att.data == 'string') ? new Buffer(att.data) : att.data;
atts[name] = {
'content_type': att.type || att.content_type,
'data': data.toString('base64')
};
}
}
} else {
assert(Buffer.isBuffer(data) || (typeof data == 'string'), 'buffer must be a Buffer of String instance');
if (typeof data == 'string')
data = new Buffer(data);
atts[attname] = {
'content_type': type,
'data': data.toString('base64')
};
}
this.doc && (this.doc._attachments = _.extend(this.doc._attachments || {}, atts));
this._attachments = _.extend(this._attachments || {}, atts);
return this;
},
update: function(newDoc) {
this.doc = _.extend(this.doc, newDoc);
this._id = (newDoc && newDoc._id) || this._id;
this._rev = (newDoc && newDoc._rev) || this._rev;
this._attachments = (newDoc && newDoc._attachments) || this._attachments;
return this;
},
set: function(newDoc) {
this.doc = _.clone(newDoc);
this._id = (newDoc && newDoc._id) || this._id;
this._rev = (newDoc && newDoc._rev) || this._rev;
this._attachments = (newDoc && newDoc._attachments) || this._attachments;
return this;
},
exists: function(callback) {
/* jshint eqnull: true */
if (this._id == null)
return callback(new Error("docid must be provided"));
this._head(this.dburl + '/' + this._encodeId(), function(err, body, res) {
if (err && err.statusCode == 404) {
return callback(undefined, false);
} else if (!err) {
return callback(undefined, true);
}
callback(err);
});
},
/**
* @name DocHeadOptions
* @class
* @property {string} rev
* @property {boolean} revs
* @property {boolean} revs_info
*/
/**
* @param {DocHeadOptions=} options
* @param {function} callback
*/
head: function(options, callback) {
if (arguments.length == 1) {
callback = options;
options = {};
}
/* jshint eqnull: true */
if (this._id == null)
return callback(new Error("docid must be provided"));
if (this._rev)
options = _.extend({
rev: this._rev
}, options);
this._head(this.dburl + '/' + this._encodeId() + '?' + qs.stringify(options), function(err, body, res) {
callback(err, res && res.headers, body);
});
return this;
},
/**
* @name DocGetOptions
* @class
* @property {boolean} conflictss
* @property {string} rev
* @property {boolean} revs
* @property {boolean} revs_info
*/
/**
* @param {DocGetOptions=} options
*/
open: function(options, callback) {
var self = this;
if (!callback && typeof options == 'function')
callback = options, options = {};
else if (typeof options == 'string') {
options = {
rev: options
};
}
options = options || {};
if (this._id === null || this._id === undefined)
return (callback && callback.call(this, new Error("docid must be provided")));
if (this._rev)
options.rev = this._rev;
var qstr = qs.stringify(options);
var url = this.dburl + '/' + this._encodeId() + '?' + qstr;
this._get(url, function(err, body) {
if (!err && body) {
self.set(body);
}
callback && callback.call(self, err, body);
});
},
/**
* get a list of revisions for this document
*/
revisions: function(callback) {
this.open({
revs: true
}, function(err, doc) {
if (err) return (callback && callback(err));
callback && callback(err, doc._revisions, doc);
});
},
create: function(batch, callback) {
var self = this;
if (typeof batch == 'function') {
callback = batch;
batch = undefined;
}
self._post(this.dburl + (batch ? ("?" + qs.stringify({
batch: 'ok'
})) : ''), {
body: JSON.stringify(this.doc)
}, function(err, result) {
if (err) return (callback && callback(err));
self.id(result.id);
self.rev(result.rev);
delete this.deleted;
callback && callback(null, result);
});
},
save: function(batch, callback) {
var self = this;
if (arguments.length == 1 && typeof batch == 'function') {
callback = batch;
batch = undefined;
}
var options = {};
batch && (options.batch = 'ok');
this._rev && (options.rev = this._rev);
self._put(this.dburl + '/' + this._encodeId() + '?' + qs.stringify(options), {
body: JSON.stringify(self.doc)
}, function(err, result) {
if (err) return (callback && callback(err));
self.rev(result.rev);
callback && callback(err, result);
});
},
destroy: function(rev, callback) {
if (arguments.length == 1 && typeof rev == 'function') {
callback = rev;
rev = undefined;
}
rev = rev || this._rev;
/* jshint eqnull: true */
if (this._id == null)
return (callback && callback(new Error("docid must be provided")));
if (rev == null)
return (callback && callback(new Error("revision must be provided")));
var self = this;
self._delete(self.dburl + '/' + this._encodeId() + '?' + qs.stringify({
rev: rev
}), function(err, result) {
if (self.doc)
self.doc._deleted = true;
self.deleted = true;
callback && callback(err, result);
});
},
/**
* @name DocCopyOptions
* @class
* @property {string} from_rev
* @property {string} to_rev
*/
/**
* @param {string} id
* @param {DocCopyOptions=} options
* @param {function} callback
*/
copy: function(id, options, callback) {
var self = this;
if (arguments.length == 2 && typeof options == 'function') {
callback = options;
options = undefined;
}
options = options || {};
this._copy(this.dburl + '/' + this._encodeId() + ((options.from_rev || this._rev) ? ('?' + qs.stringify({
rev: options.from_rev || this._rev
})) : ''), {
headers: {
Destination: id + (options.to_rev ? ('?' + qs.stringify({
rev: options.to_rev
})) : '')
}
}, function(err, rs) {
// TODO: discuss does it right to call the callback in context
callback && callback.call(self, err, rs);
});
},
// =========================
// Attachment
// =========================
addAttachment: function(attname, data, type, callback) {
var self = this;
/* jshint eqnull: true */
if (this._id == null)
return (callback && callback(new Error("docid must be provided")));
if (this._rev == null)
return (callback && callback(new Error("revision must be provided")));
if (arguments.length == 2 && typeof data == 'function') {
callback = data;
// above 1.3.x ?
var atts = {},
mps = [],
headers = {
'Content-Type': 'multipart/related'
};
if (Array.isArray(attname)) {
attname.forEach(function(att) {
atts[att.name] = {
follows: true,
length: att.data.length,
content_type: att.type || att.content_type
};
mps.push({
body: att.data
});
});
} else {
for (var name in attname) {
var att = attname[name];
atts[name] = {
follows: true,
length: att.data.length,
content_type: att.type || att.content_type
};
mps.push({
body: att.data
});
}
}
mps.unshift({
'Content-Type': 'application/json',
body: JSON.stringify(_.extend({}, this.doc, {
_attachments: atts
}))
});
return this._put(this.dburl + '/' + this._encodeId(), {
headers: headers,
multipart: mps
}, function(err, rs, res) {
if (err) return (callback && callback(err));
self.rev(rs.rev);
callback && callback(err, rs);
});
} else {
var headers = {
'Content-Type': type
};
data && (headers['Content-Length'] = data.length);
assert(!data || Buffer.isBuffer(data) || (typeof data == 'string'), 'buffer must be a Buffer of String instance');
return this._put([this.dburl, '/', this._encodeId(), '/', encodeURIComponent(attname),
'?', this._rev ? qs.stringify({
rev: this._rev
}) : ''
].join(''), {
headers: headers,
body: data
},
function(err, body, res) {
body && body.rev && self.rev(body.rev);
callback && callback(err, body, res);
});
}
},
getAttachment: function(attname, callback) {
return this._get(this.dburl + '/' + this._encodeId() + '/' + encodeURIComponent(attname), {
headers: {
'Content-Type': 'multipart/related'
}
}, function(err, buffer) {
callback && callback(err, buffer);
});
},
delAttachment: function(attname, callback) {
var self = this,
query = {};
this._rev && (query.rev = this._rev);
return this._delete(this.dburl + '/' + this._encodeId() + '/' + encodeURIComponent(attname) + '?' +
qs.stringify(query), function(err, body) {
if (err) return (callback && callback(err));
self.rev(body.rev);
callback && callback(err, body);
});
},
attachment: function(name) {
var self = this;
return {
attach: function(data, type, callback) {
self.addAttachment(name, data, type, callback);
},
get: function(callback) {
self.getAttachment(name, callback);
},
update: function(data, type, callback) {
self.addAttachment(name, data, type, callback);
},
del: function(callback) {
self.delAttachment(name, callback);
}
};
}
});
module.exports = Document; | 27.386574 | 123 | 0.547629 |
b8033b5fe8b10c231a7bddfbb19d64c9843c904d | 705 | js | JavaScript | src/App.js | cyrilgavala/workout-challenges-webapp | 44f7fb6063b160a02f0f785e60128a31fc8bfd8c | [
"MIT"
] | null | null | null | src/App.js | cyrilgavala/workout-challenges-webapp | 44f7fb6063b160a02f0f785e60128a31fc8bfd8c | [
"MIT"
] | null | null | null | src/App.js | cyrilgavala/workout-challenges-webapp | 44f7fb6063b160a02f0f785e60128a31fc8bfd8c | [
"MIT"
] | null | null | null | import './App.css';
import {BrowserRouter, Switch, Route} from 'react-router-dom';
import RegistrationForm from "./components/RegistrationForm";
import LoginForm from "./components/LoginForm";
import Dashboard from "./containers/Dashboard";
import Redirect from "./components/Redirect";
export default function App() {
return (
<BrowserRouter>
<Switch>
<Route path={"/register"}>
<RegistrationForm/>
</Route>
<Route path={"/login"}>
<LoginForm/>
</Route>
<Route path={"/dashboard"}>
<Dashboard/>
</Route>
<Route path={"/"}>
<Redirect/>
</Route>
</Switch>
</BrowserRouter>
)
} | 25.178571 | 62 | 0.584397 |
b8037ac1eeb04ace0e99b0e7444bbfd714105586 | 308 | js | JavaScript | vue/server.js | gmeben/JavaScript-Value-Types | c9f2c66bbcfd5183121439366a0548265b464ce2 | [
"Apache-2.0"
] | null | null | null | vue/server.js | gmeben/JavaScript-Value-Types | c9f2c66bbcfd5183121439366a0548265b464ce2 | [
"Apache-2.0"
] | null | null | null | vue/server.js | gmeben/JavaScript-Value-Types | c9f2c66bbcfd5183121439366a0548265b464ce2 | [
"Apache-2.0"
] | null | null | null | const Express = require('express')
const nocache = require('nocache')
const path = require('path')
const expressRouter = Express()
expressRouter.use(nocache())
expressRouter.use(Express.static(path.join(__dirname, 'public')))
expressRouter.listen(3000, () => {
console.log("Listening at :3000...")
});
| 25.666667 | 65 | 0.714286 |
b804073fd5f4f05e0b6b4a7641bac603717bc076 | 2,954 | js | JavaScript | test/multisigwallet.test.js | ehsomma/multisigwallet | db83972ef97c490f2d3185583235e41c3c96ac4f | [
"MIT"
] | null | null | null | test/multisigwallet.test.js | ehsomma/multisigwallet | db83972ef97c490f2d3185583235e41c3c96ac4f | [
"MIT"
] | null | null | null | test/multisigwallet.test.js | ehsomma/multisigwallet | db83972ef97c490f2d3185583235e41c3c96ac4f | [
"MIT"
] | null | null | null | //#region Imports
// Contracts.
const MultiSigWallet = artifacts.require("MultiSigWallet");
const TestContract = artifacts.require("TestContract");
// Chai.
const { chai, expect, BN } = require("./setup-chai.js");
// Truffle assertions.
const truffleAssert = require('truffle-assertions');
// OpenZeppeling test helpers.
const {
//BN, // Big Number support.
constants, // Common constants, like the zero address and largest integers.
expectEvent, // Assertions for emitted events.
expectRevert, // Assertions for transactions that should fail.
time, // Block time manipulation.
} = require('@openzeppelin/test-helpers');
//#endregion
contract("multisigwallet test", async accounts => {
//#region Declarations.
let multiSigWalletInstance;
let testContractInstance;
let testFunctionData;
//#endregion
//#region Hooks.
// Runs once before the first test in this block.
before(async function () {
multiSigWalletInstance = await MultiSigWallet.deployed();
testContractInstance = await TestContract.deployed();
testFunctionData = await testContractInstance.getData();
console.log('MultiSigWallet address: ', multiSigWalletInstance.address);
console.log('testFunctionData: ', testFunctionData);
console.log('accounts[0]', accounts[0]);
console.log('accounts[1]', accounts[1]);
console.log('accounts[1]', accounts[2]);
console.log();
});
//#endregion
//#region Tests
it("with 2 confirmations from any of the 3 owners you should be able to execute a transaction", async function () {
// Arrange.
const expectedResult = new BN(10);
// Act.
// Step 1: Submits the transaction to confirm and execute.
await multiSigWalletInstance.submitTransaction(
testContractInstance.address,
0,
testFunctionData,
{ from: accounts[0], gas: 3000000 });
// Get the last tx index.
let txIndex = await multiSigWalletInstance.getTransactionCount();
txIndex = txIndex.sub(new BN(1));
// Step 2: Confirms the transaction from the owner 1 (index 0).
await multiSigWalletInstance.confirmTransaction(txIndex, {from: accounts[0]});
// Step 3: Confirms the transaction from the owner 2 (index 1).
await multiSigWalletInstance.confirmTransaction(txIndex, {from: accounts[1]});
// Step 4: Executes the transaction.
await multiSigWalletInstance.executeTransaction(txIndex, {from: accounts[0], gas: 3000000 })
time.advanceBlock();
const result = await testContractInstance.value();
const tx = await multiSigWalletInstance.getTransaction(0);
// Assert.
expect(result).to.be.bignumber.equal(expectedResult);
expect(tx.executed).to.be.equal(true);
});
//#endregion
});
| 32.461538 | 119 | 0.651659 |
b80447ee00fcc2646e80ab23d73a4f8706cbc06e | 193 | js | JavaScript | src/routes/index.js | hare85/mongoose-example | eea355dc7278f072bff199b5eeb38054a9695e1c | [
"MIT"
] | null | null | null | src/routes/index.js | hare85/mongoose-example | eea355dc7278f072bff199b5eeb38054a9695e1c | [
"MIT"
] | null | null | null | src/routes/index.js | hare85/mongoose-example | eea355dc7278f072bff199b5eeb38054a9695e1c | [
"MIT"
] | null | null | null | import { Router } from 'express';
import Api from './api';
import Hello from './hello';
const router = Router();
router.use('/hello', Hello);
router.use('/api', Api);
export default router;
| 17.545455 | 33 | 0.668394 |
b804859b76823399b37addfca3ac1a4e70143958 | 266,468 | js | JavaScript | Fujian.geoJSON/fujian.geoJSON.js | hai2007/datapool | c7804ff4e8e9df9af20e6fa113cd61e036e08594 | [
"MIT"
] | 3 | 2021-11-20T12:47:29.000Z | 2022-03-22T02:01:05.000Z | Fujian.geoJSON/fujian.geoJSON.js | hai2007/datapool | c7804ff4e8e9df9af20e6fa113cd61e036e08594 | [
"MIT"
] | 2 | 2022-03-05T03:17:02.000Z | 2022-03-28T03:48:48.000Z | Fujian.geoJSON/fujian.geoJSON.js | hai2007/datapool | c7804ff4e8e9df9af20e6fa113cd61e036e08594 | [
"MIT"
] | null | null | null | var FujianGeoJSON = { "type": "FeatureCollection", "features": [{ "type": "Feature", "properties": { "adcode": 350100, "name": "福州市", "center": [119.306239, 26.075302], "centroid": [119.200438, 26.048383], "childrenNum": 13, "level": "city", "subFeatureIndex": 0, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[119.217802, 25.467014],
[119.210197, 25.473308],
[119.213122, 25.493245],
[119.223604, 25.489306],
[119.23194, 25.504389],
[119.243543, 25.511498],
[119.244323, 25.531044],
[119.232964, 25.546842],
[119.228137, 25.564367],
[119.204981, 25.546842],
[119.191818, 25.556013],
[119.18041, 25.556013],
[119.169149, 25.566479],
[119.165444, 25.5768],
[119.155401, 25.582992],
[119.164518, 25.589904],
[119.164956, 25.59912],
[119.155499, 25.603103],
[119.151404, 25.618748],
[119.141556, 25.62249],
[119.132391, 25.644514],
[119.144969, 25.667204],
[119.142141, 25.67603],
[119.156571, 25.676797],
[119.14375, 25.684471],
[119.14063, 25.696412],
[119.151209, 25.697947],
[119.149307, 25.707633],
[119.124054, 25.713867],
[119.134731, 25.724846],
[119.149015, 25.73199],
[119.153256, 25.743735],
[119.137705, 25.747809],
[119.13283, 25.753753],
[119.107333, 25.754999],
[119.091928, 25.74896],
[119.085541, 25.754903],
[119.081056, 25.749056],
[119.055755, 25.749439],
[119.039472, 25.741434],
[119.026455, 25.743591],
[119.013, 25.734627],
[118.98024, 25.733907],
[118.966638, 25.726381],
[118.952695, 25.712284],
[118.951428, 25.730168],
[118.956108, 25.742201],
[118.950453, 25.755383],
[118.936754, 25.749151],
[118.920422, 25.731319],
[118.916766, 25.721682],
[118.911208, 25.726141],
[118.886102, 25.707394],
[118.878204, 25.698043],
[118.879423, 25.708209],
[118.866309, 25.709216],
[118.855096, 25.703797],
[118.833597, 25.711757],
[118.82687, 25.720196],
[118.812293, 25.721251],
[118.803567, 25.713004],
[118.807028, 25.708113],
[118.790989, 25.695166],
[118.774316, 25.685718],
[118.761007, 25.686869],
[118.752817, 25.697323],
[118.751647, 25.684759],
[118.734438, 25.669171],
[118.72225, 25.669363],
[118.728539, 25.695549],
[118.705236, 25.6826],
[118.692269, 25.69507],
[118.671842, 25.697611],
[118.677253, 25.701112],
[118.670672, 25.708832],
[118.650245, 25.712764],
[118.63718, 25.709935],
[118.630648, 25.696604],
[118.608807, 25.707442],
[118.613634, 25.699002],
[118.604468, 25.698618],
[118.6052, 25.684519],
[118.596473, 25.684087],
[118.587844, 25.690706],
[118.583896, 25.677948],
[118.57629, 25.688595],
[118.572195, 25.673583],
[118.566589, 25.681449],
[118.55601, 25.675118],
[118.550745, 25.67814],
[118.540849, 25.667588],
[118.5408, 25.661688],
[118.522323, 25.659049],
[118.502482, 25.679003],
[118.492342, 25.693295],
[118.480836, 25.70255],
[118.48186, 25.706818],
[118.467284, 25.710942],
[118.455973, 25.722066],
[118.447978, 25.718038],
[118.441982, 25.725949],
[118.430916, 25.730408],
[118.426187, 25.746084],
[118.430379, 25.757396],
[118.417899, 25.770145],
[118.4237, 25.778819],
[118.417314, 25.778867],
[118.41044, 25.796261],
[118.400154, 25.798321],
[118.391671, 25.810395],
[118.381043, 25.812791],
[118.39484, 25.823857],
[118.394157, 25.836455],
[118.398301, 25.847902],
[118.407515, 25.842442],
[118.408685, 25.848908],
[118.421848, 25.856331],
[118.405955, 25.879077],
[118.411171, 25.890568],
[118.419118, 25.891478],
[118.417022, 25.901579],
[118.434328, 25.919482],
[118.45378, 25.905792],
[118.45534, 25.899138],
[118.465334, 25.896361],
[118.459873, 25.862269],
[118.464017, 25.868591],
[118.472451, 25.866675],
[118.476303, 25.882524],
[118.471964, 25.89909],
[118.480885, 25.904021],
[118.487418, 25.898132],
[118.510672, 25.895068],
[118.509209, 25.910196],
[118.5213, 25.92781],
[118.514767, 25.928767],
[118.514377, 25.942694],
[118.520227, 25.955567],
[118.515839, 25.964562],
[118.519398, 25.969969],
[118.513548, 25.976428],
[118.52169, 25.989153],
[118.517838, 26.004268],
[118.516327, 26.025407],
[118.520958, 26.027894],
[118.52169, 26.04377],
[118.515937, 26.059165],
[118.541824, 26.056774],
[118.581848, 26.062225],
[118.592573, 26.051515],
[118.600763, 26.05644],
[118.592427, 26.064232],
[118.602372, 26.072025],
[118.590672, 26.077809],
[118.590574, 26.093295],
[118.585407, 26.094012],
[118.581409, 26.113558],
[118.588673, 26.129852],
[118.572683, 26.128609],
[118.563908, 26.136015],
[118.563664, 26.154885],
[118.567759, 26.163388],
[118.565809, 26.176093],
[118.57746, 26.17189],
[118.574145, 26.185263],
[118.579215, 26.194384],
[118.578192, 26.203647],
[118.584919, 26.208183],
[118.613926, 26.210666],
[118.597205, 26.224894],
[118.610221, 26.236733],
[118.61885, 26.233821],
[118.631915, 26.236255],
[118.637229, 26.228856],
[118.650977, 26.224225],
[118.661994, 26.227854],
[118.671013, 26.240265],
[118.668576, 26.24375],
[118.673012, 26.25425],
[118.666382, 26.275392],
[118.684127, 26.287369],
[118.69105, 26.297293],
[118.69144, 26.311892],
[118.70782, 26.322291],
[118.720154, 26.34032],
[118.752086, 26.339557],
[118.753597, 26.334025],
[118.774657, 26.327967],
[118.792695, 26.342228],
[118.800885, 26.360016],
[118.789819, 26.37022],
[118.784261, 26.369171],
[118.769929, 26.384618],
[118.765882, 26.393915],
[118.752281, 26.396727],
[118.76325, 26.421751],
[118.753695, 26.424277],
[118.730928, 26.438907],
[118.736632, 26.445245],
[118.733463, 26.455679],
[118.736388, 26.472354],
[118.756473, 26.490598],
[118.746479, 26.503172],
[118.748527, 26.511077],
[118.775437, 26.508839],
[118.785285, 26.504362],
[118.787869, 26.494408],
[118.803225, 26.488455],
[118.807613, 26.475165],
[118.804054, 26.466065],
[118.794743, 26.461587],
[118.813268, 26.44615],
[118.805809, 26.446198],
[118.806882, 26.438859],
[118.819801, 26.426755],
[118.821263, 26.425659],
[118.853146, 26.436],
[118.8608, 26.453345],
[118.870404, 26.457156],
[118.872403, 26.466828],
[118.890636, 26.470925],
[118.90297, 26.479309],
[118.926711, 26.476737],
[118.937534, 26.46516],
[118.947382, 26.465684],
[118.954158, 26.483929],
[118.950502, 26.492217],
[118.937729, 26.494599],
[118.941483, 26.505553],
[118.950989, 26.513411],
[118.947577, 26.519459],
[118.963372, 26.532743],
[118.98492, 26.534172],
[118.995937, 26.527173],
[119.002226, 26.532791],
[118.994182, 26.558023],
[119.006858, 26.555643],
[119.00754, 26.56464],
[119.015096, 26.571351],
[119.009344, 26.574778],
[119.01534, 26.58996],
[119.023677, 26.587057],
[119.026797, 26.59786],
[119.050928, 26.595338],
[119.06024, 26.604665],
[119.071842, 26.596718],
[119.078082, 26.586962],
[119.068089, 26.584821],
[119.060873, 26.573922],
[119.071257, 26.566734],
[119.0813, 26.571113],
[119.096851, 26.567258],
[119.099484, 26.575825],
[119.10158, 26.559499],
[119.1125, 26.551359],
[119.115669, 26.538981],
[119.126102, 26.542504],
[119.142775, 26.538266],
[119.149892, 26.543646],
[119.162665, 26.541075],
[119.167101, 26.549216],
[119.184895, 26.553596],
[119.1847, 26.561355],
[119.193183, 26.571304],
[119.205078, 26.564592],
[119.211708, 26.548455],
[119.218387, 26.544837],
[119.213805, 26.539219],
[119.22531, 26.523982],
[119.241593, 26.527839],
[119.254073, 26.549692],
[119.281276, 26.535648],
[119.282397, 26.56245],
[119.28737, 26.577396],
[119.294877, 26.586534],
[119.31467, 26.593292],
[119.322568, 26.579205],
[119.333927, 26.581537],
[119.348503, 26.590389],
[119.344896, 26.599145],
[119.351623, 26.602809],
[119.372001, 26.600144],
[119.379509, 26.610565],
[119.381069, 26.621888],
[119.394914, 26.622126],
[119.407833, 26.616227],
[119.415097, 26.622935],
[119.401495, 26.627883],
[119.408662, 26.635209],
[119.421971, 26.625647],
[119.440301, 26.626694],
[119.445225, 26.631213],
[119.468918, 26.627788],
[119.472866, 26.631451],
[119.500947, 26.621222],
[119.508162, 26.614561],
[119.508991, 26.598954],
[119.515182, 26.598716],
[119.528052, 26.586772],
[119.532001, 26.577586],
[119.524396, 26.573446],
[119.533902, 26.56107],
[119.555353, 26.555881],
[119.556035, 26.545217],
[119.564762, 26.54755],
[119.573732, 26.540361],
[119.581483, 26.542694],
[119.588552, 26.536743],
[119.60737, 26.535124],
[119.611124, 26.52703],
[119.623653, 26.520935],
[119.638327, 26.528172],
[119.650027, 26.524173],
[119.66124, 26.526649],
[119.66163, 26.534648],
[119.671136, 26.53341],
[119.678254, 26.540742],
[119.682934, 26.560451],
[119.703311, 26.569876],
[119.729442, 26.559309],
[119.745822, 26.571018],
[119.74124, 26.573922],
[119.765225, 26.577301],
[119.783945, 26.566258],
[119.790429, 26.566068],
[119.799351, 26.556167],
[119.799984, 26.546836],
[119.818558, 26.504505],
[119.837669, 26.450057],
[119.83567, 26.437716],
[119.861118, 26.398634],
[119.861459, 26.391054],
[119.880862, 26.372842],
[119.876572, 26.359634],
[119.900362, 26.357107],
[119.940777, 26.37289],
[119.962373, 26.373462],
[119.954476, 26.35272],
[119.934342, 26.334788],
[119.913574, 26.320574],
[119.909917, 26.310413],
[119.898558, 26.3086],
[119.876864, 26.310031],
[119.86258, 26.307598],
[119.860972, 26.315851],
[119.845128, 26.322768],
[119.806761, 26.307694],
[119.803738, 26.298963],
[119.818412, 26.293763],
[119.814658, 26.280307],
[119.797693, 26.268234],
[119.781118, 26.282788],
[119.771319, 26.285222],
[119.724031, 26.26957],
[119.676255, 26.26308],
[119.669088, 26.256971],
[119.671477, 26.247282],
[119.679911, 26.238499],
[119.679765, 26.22919],
[119.668113, 26.220311],
[119.664457, 26.202024],
[119.643543, 26.195769],
[119.62648, 26.179532],
[119.605322, 26.169741],
[119.603665, 26.153118],
[119.611075, 26.145713],
[119.618729, 26.11977],
[119.632915, 26.115565],
[119.641934, 26.108923],
[119.644616, 26.090475],
[119.654414, 26.090093],
[119.659046, 26.072264],
[119.667138, 26.028946],
[119.675767, 26.02579],
[119.700191, 26.032485],
[119.715353, 26.025455],
[119.723641, 26.011538],
[119.722032, 25.990349],
[119.715207, 25.96327],
[119.702483, 25.931591],
[119.69517, 25.904404],
[119.688881, 25.898084],
[119.643055, 25.892244],
[119.634817, 25.887121],
[119.628479, 25.872038],
[119.623214, 25.83406],
[119.627114, 25.769905],
[119.63662, 25.760847],
[119.635499, 25.746132],
[119.612196, 25.727052],
[119.602982, 25.71473],
[119.61205, 25.703557],
[119.600837, 25.683656],
[119.583336, 25.679147],
[119.543701, 25.684423],
[119.526639, 25.683032],
[119.49027, 25.673536],
[119.489295, 25.667972],
[119.473013, 25.662311],
[119.478327, 25.631463],
[119.493391, 25.632375],
[119.503823, 25.624458],
[119.510892, 25.627721],
[119.525712, 25.624266],
[119.532489, 25.630648],
[119.54024, 25.628728],
[119.542434, 25.602527],
[119.533707, 25.594032],
[119.53478, 25.585344],
[119.570709, 25.582224],
[119.5867, 25.592112],
[119.596791, 25.593312],
[119.602934, 25.58592],
[119.60035, 25.576944],
[119.616438, 25.556781],
[119.619801, 25.537239],
[119.612586, 25.522304],
[119.613903, 25.504822],
[119.62726, 25.488874],
[119.624481, 25.473837],
[119.634427, 25.475182],
[119.644031, 25.485607],
[119.652659, 25.485655],
[119.654122, 25.470282],
[119.674987, 25.47499],
[119.678936, 25.483734],
[119.67606, 25.49142],
[119.691758, 25.501603],
[119.696535, 25.510777],
[119.706724, 25.513755],
[119.718717, 25.511594],
[119.723933, 25.517549],
[119.714378, 25.521055],
[119.713354, 25.536182],
[119.717108, 25.536615],
[119.716864, 25.553036],
[119.708284, 25.571136],
[119.692294, 25.577424],
[119.683762, 25.595904],
[119.692733, 25.601999],
[119.700289, 25.616396],
[119.712477, 25.623738],
[119.719448, 25.622442],
[119.727882, 25.63842],
[119.749576, 25.646193],
[119.78453, 25.667492],
[119.791404, 25.665381],
[119.791892, 25.653868],
[119.779265, 25.637221],
[119.780387, 25.62369],
[119.787992, 25.615293],
[119.808906, 25.61846],
[119.840691, 25.601279],
[119.841666, 25.592064],
[119.831429, 25.580016],
[119.845615, 25.569743],
[119.871843, 25.56379],
[119.884664, 25.569695],
[119.890368, 25.565663],
[119.887297, 25.552412],
[119.870868, 25.53575],
[119.854146, 25.533493],
[119.844055, 25.544009],
[119.82124, 25.534886],
[119.814561, 25.529411],
[119.811002, 25.507127],
[119.81461, 25.495359],
[119.828065, 25.49142],
[119.833086, 25.481716],
[119.84308, 25.483686],
[119.851465, 25.47744],
[119.863897, 25.479746],
[119.864189, 25.469657],
[119.855073, 25.450773],
[119.845225, 25.452792],
[119.839911, 25.46269],
[119.826505, 25.465285],
[119.81383, 25.458125],
[119.803738, 25.457597],
[119.775121, 25.437414],
[119.76425, 25.433377],
[119.762349, 25.417516],
[119.783555, 25.411507],
[119.772538, 25.395066],
[119.756694, 25.396268],
[119.738607, 25.416362],
[119.71857, 25.419727],
[119.703019, 25.433521],
[119.703116, 25.440489],
[119.691953, 25.438615],
[119.680935, 25.44789],
[119.687565, 25.4612],
[119.680399, 25.46072],
[119.674987, 25.468119],
[119.648906, 25.461681],
[119.641105, 25.44443],
[119.622921, 25.434049],
[119.640082, 25.429291],
[119.646273, 25.434194],
[119.657144, 25.428378],
[119.656803, 25.438519],
[119.670112, 25.435491],
[119.672403, 25.418958],
[119.668357, 25.40795],
[119.658071, 25.407806],
[119.656462, 25.396989],
[119.665237, 25.372084],
[119.660216, 25.366025],
[119.654317, 25.36992],
[119.644957, 25.362899],
[119.630673, 25.358667],
[119.643153, 25.355926],
[119.657047, 25.363284],
[119.658509, 25.354002],
[119.649101, 25.342941],
[119.636035, 25.33866],
[119.612001, 25.340969],
[119.597376, 25.334668],
[119.588796, 25.345778],
[119.59645, 25.352944],
[119.584262, 25.370112],
[119.582751, 25.379921],
[119.590405, 25.398191],
[119.580411, 25.414872],
[119.584116, 25.425975],
[119.573001, 25.450293],
[119.559887, 25.445728],
[119.555353, 25.429147],
[119.572513, 25.414343],
[119.578899, 25.400787],
[119.568223, 25.393864],
[119.564859, 25.385258],
[119.552135, 25.38045],
[119.548528, 25.366073],
[119.531709, 25.360639],
[119.533951, 25.372516],
[119.51996, 25.376892],
[119.500801, 25.36641],
[119.496657, 25.358812],
[119.485737, 25.367275],
[119.491197, 25.377084],
[119.505383, 25.389153],
[119.507236, 25.396316],
[119.485932, 25.422418],
[119.490075, 25.446833],
[119.462483, 25.447938],
[119.456632, 25.435059],
[119.447857, 25.425542],
[119.444201, 25.411747],
[119.438643, 25.412661],
[119.4384, 25.427369],
[119.430258, 25.435732],
[119.447321, 25.450773],
[119.441276, 25.459423],
[119.442787, 25.47254],
[119.452927, 25.493726],
[119.435572, 25.499538],
[119.424652, 25.488009],
[119.401203, 25.49363],
[119.3974, 25.506311],
[119.357035, 25.520719],
[119.350209, 25.50535],
[119.343628, 25.47254],
[119.354548, 25.443709],
[119.355523, 25.429147],
[119.346407, 25.422851],
[119.338265, 25.429003],
[119.326127, 25.425398],
[119.321836, 25.412036],
[119.288003, 25.410978],
[119.268552, 25.424822],
[119.262312, 25.436356],
[119.261483, 25.451302],
[119.272647, 25.477824],
[119.25612, 25.479218],
[119.25612, 25.488922],
[119.232769, 25.474461],
[119.229844, 25.468552],
[119.217802, 25.467014]
]
],
[
[
[120.49561, 26.371936],
[120.50107, 26.376799],
[120.511259, 26.370601],
[120.51394, 26.360349],
[120.506773, 26.364546],
[120.497901, 26.352338],
[120.484982, 26.355438],
[120.486932, 26.365452],
[120.480546, 26.37289],
[120.472892, 26.36755],
[120.478157, 26.381138],
[120.484836, 26.380804],
[120.486737, 26.36898],
[120.49561, 26.371936]
]
],
[
[
[119.906212, 25.592688],
[119.899826, 25.582128],
[119.884031, 25.588032],
[119.876621, 25.587168],
[119.875938, 25.606174],
[119.882519, 25.59864],
[119.896218, 25.601087],
[119.897486, 25.606942],
[119.906505, 25.600991],
[119.906212, 25.592688]
]
],
[
[
[119.585627, 25.629832],
[119.578509, 25.627337],
[119.560715, 25.635014],
[119.567882, 25.646145],
[119.572464, 25.63391],
[119.580849, 25.649935],
[119.598254, 25.66092],
[119.601374, 25.666724],
[119.61322, 25.668499],
[119.610051, 25.653868],
[119.601081, 25.641011],
[119.587723, 25.636597],
[119.585627, 25.629832]
]
],
[
[
[120.006298, 26.215202],
[119.980655, 26.208374],
[119.978364, 26.193476],
[119.969588, 26.191136],
[119.970661, 26.217207],
[119.988065, 26.224369],
[120.000886, 26.23616],
[120.020143, 26.225658],
[120.016292, 26.208518],
[120.006298, 26.215202]
]
],
[
[
[119.736316, 25.363236],
[119.726712, 25.356551],
[119.705067, 25.352848],
[119.697803, 25.367035],
[119.716572, 25.371651],
[119.724469, 25.378671],
[119.727297, 25.368525],
[119.736316, 25.363236]
]
],
[
[
[119.967492, 25.945374],
[119.96837, 25.955662],
[119.976462, 25.964754],
[119.992989, 25.964658],
[119.979339, 25.951786],
[119.967492, 25.945374]
]
],
[
[
[119.699168, 25.328222],
[119.712184, 25.314464],
[119.69634, 25.310904],
[119.689369, 25.305083],
[119.690978, 25.315426],
[119.687175, 25.325336],
[119.693805, 25.337121],
[119.702921, 25.342075],
[119.705359, 25.333658],
[119.699168, 25.328222]
]
],
[
[
[119.655487, 26.147959],
[119.654951, 26.132623],
[119.642909, 26.129326],
[119.642422, 26.133817],
[119.618631, 26.139025],
[119.607614, 26.151016],
[119.607126, 26.169693],
[119.62726, 26.173132],
[119.642909, 26.157178],
[119.66397, 26.15221],
[119.655487, 26.147959]
]
],
[
[
[119.929466, 26.134295],
[119.913037, 26.140219],
[119.918888, 26.15436],
[119.918254, 26.169597],
[119.933025, 26.168833],
[119.928833, 26.160331],
[119.9457, 26.156127],
[119.950771, 26.163722],
[119.970076, 26.162767],
[119.960033, 26.147194],
[119.955938, 26.148866],
[119.944969, 26.139168],
[119.936633, 26.140124],
[119.929466, 26.134295]
]
],
[
[
[119.884031, 26.410979],
[119.885883, 26.419892],
[119.892855, 26.41484],
[119.884031, 26.410979]
]
],
[
[
[119.677766, 25.634054],
[119.662117, 25.641155],
[119.667236, 25.653437],
[119.675572, 25.658714],
[119.682592, 25.650031],
[119.705944, 25.656411],
[119.716864, 25.664758],
[119.721934, 25.639812],
[119.712964, 25.634198],
[119.702726, 25.640148],
[119.697998, 25.636357],
[119.677766, 25.634054]
]
],
[
[
[119.48871, 25.34953],
[119.485493, 25.338516],
[119.488125, 25.329665],
[119.465798, 25.333802],
[119.475548, 25.347846],
[119.48871, 25.34953]
]
],
[
[
[119.670795, 25.764825],
[119.683129, 25.762668],
[119.678449, 25.755383],
[119.670795, 25.764825]
]
],
[
[
[119.676157, 26.124405],
[119.677279, 26.113319],
[119.662215, 26.133865],
[119.675572, 26.142513],
[119.687272, 26.13635],
[119.676157, 26.124405]
]
],
[
[
[119.757327, 25.298491],
[119.768638, 25.296855],
[119.765713, 25.290119],
[119.757327, 25.298491]
]
],
[
[
[119.999229, 26.239692],
[120.002593, 26.246661],
[120.01127, 26.24752],
[119.999229, 26.239692]
]
],
[
[
[119.919131, 26.41117],
[119.907041, 26.406976],
[119.915816, 26.418176],
[119.919131, 26.41117]
]
],
[
[
[119.93712, 25.963797],
[119.928784, 25.97217],
[119.930198, 25.978628],
[119.949064, 25.979681],
[119.953257, 25.976236],
[119.93712, 25.963797]
]
],
[
[
[119.397498, 25.443036],
[119.40286, 25.435011],
[119.39038, 25.435107],
[119.397498, 25.443036]
]
],
[
[
[119.655341, 25.676461],
[119.641349, 25.66754],
[119.643543, 25.677181],
[119.655341, 25.676461]
]
],
[
[
[119.654512, 25.654108],
[119.647638, 25.660249],
[119.650807, 25.667636],
[119.66124, 25.67296],
[119.672257, 25.661448],
[119.663921, 25.654636],
[119.654512, 25.654108]
]
],
[
[
[119.636523, 26.114705],
[119.636572, 26.119913],
[119.647979, 26.118145],
[119.644372, 26.109114],
[119.636523, 26.114705]
]
],
[
[
[119.987139, 26.262555],
[119.981971, 26.267804],
[119.993866, 26.28045],
[119.994988, 26.265943],
[119.987139, 26.262555]
]
],
[
[
[120.221484, 26.331974],
[120.223775, 26.338651],
[120.234354, 26.34156],
[120.221484, 26.331974]
]
],
[
[
[119.579777, 25.668403],
[119.590941, 25.674111],
[119.582312, 25.66164],
[119.579777, 25.668403]
]
]
] } }, { "type": "Feature", "properties": { "adcode": 350200, "name": "厦门市", "center": [118.11022, 24.490474], "centroid": [118.122873, 24.676846], "childrenNum": 6, "level": "city", "subFeatureIndex": 1, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[118.049002, 24.418318],
[118.018435, 24.418851],
[117.998447, 24.411582],
[117.993572, 24.428251],
[117.988356, 24.433048],
[117.954718, 24.448213],
[117.956278, 24.471368],
[117.965492, 24.489483],
[117.960763, 24.499749],
[117.94955, 24.504447],
[117.94838, 24.511129],
[117.938532, 24.512679],
[117.932146, 24.52856],
[117.911427, 24.536258],
[117.910988, 24.551071],
[117.906698, 24.555525],
[117.913231, 24.568545],
[117.887637, 24.589016],
[117.893438, 24.597727],
[117.892755, 24.614904],
[117.920592, 24.613597],
[117.930732, 24.633626],
[117.952183, 24.647074],
[117.954815, 24.654426],
[117.965735, 24.661632],
[117.961738, 24.668354],
[117.964468, 24.680879],
[117.954328, 24.699737],
[117.955839, 24.705829],
[117.947308, 24.712211],
[117.940775, 24.733142],
[117.945309, 24.75146],
[117.944431, 24.762769],
[117.954669, 24.766683],
[117.962615, 24.795577],
[117.958715, 24.810891],
[117.961835, 24.844363],
[117.9398, 24.843107],
[117.933267, 24.856821],
[117.912402, 24.869521],
[117.919568, 24.88275],
[117.932292, 24.873625],
[117.935266, 24.866817],
[117.954084, 24.871693],
[117.96242, 24.865899],
[117.971488, 24.848902],
[117.99796, 24.859477],
[117.991476, 24.872418],
[118.003078, 24.879467],
[118.01668, 24.87768],
[118.010684, 24.885646],
[117.990452, 24.894625],
[117.993816, 24.900949],
[118.008831, 24.892984],
[118.017509, 24.893708],
[118.017314, 24.904473],
[118.042908, 24.893274],
[118.041884, 24.882025],
[118.051001, 24.878115],
[118.050562, 24.871355],
[118.060604, 24.86701],
[118.065528, 24.875942],
[118.073767, 24.874977],
[118.070891, 24.854842],
[118.0764, 24.853779],
[118.09629, 24.87208],
[118.112232, 24.874349],
[118.124614, 24.888108],
[118.137289, 24.894481],
[118.15484, 24.892453],
[118.170391, 24.898053],
[118.17746, 24.891777],
[118.194377, 24.892936],
[118.203444, 24.881494],
[118.192475, 24.870824],
[118.214852, 24.855421],
[118.22548, 24.850834],
[118.22314, 24.839775],
[118.231476, 24.82543],
[118.239569, 24.822725],
[118.250294, 24.832772],
[118.254681, 24.826493],
[118.264822, 24.824657],
[118.273158, 24.83224],
[118.283054, 24.833544],
[118.287296, 24.82828],
[118.303432, 24.825527],
[118.299581, 24.818137],
[118.32615, 24.798331],
[118.328246, 24.790794],
[118.32186, 24.783885],
[118.33434, 24.774946],
[118.342482, 24.780793],
[118.343408, 24.769147],
[118.331415, 24.749624],
[118.327808, 24.753828],
[118.315035, 24.74711],
[118.327418, 24.730145],
[118.331805, 24.731982],
[118.339313, 24.722459],
[118.320105, 24.695241],
[118.340678, 24.68146],
[118.33746, 24.675173],
[118.353012, 24.663953],
[118.351549, 24.649105],
[118.342774, 24.643446],
[118.347649, 24.631449],
[118.344188, 24.617129],
[118.336046, 24.618677],
[118.332098, 24.597678],
[118.343115, 24.603533],
[118.341214, 24.594581],
[118.353694, 24.583983],
[118.355547, 24.575805],
[118.373828, 24.575611],
[118.363493, 24.568158],
[118.362616, 24.549571],
[118.355303, 24.534563],
[118.346869, 24.530545],
[118.289928, 24.522702],
[118.242884, 24.512485],
[118.203542, 24.534031],
[118.169416, 24.559252],
[118.162006, 24.572175],
[118.150501, 24.5835],
[118.134754, 24.575853],
[118.12554, 24.571836],
[118.123785, 24.571158],
[118.112524, 24.562882],
[118.105943, 24.551749],
[118.098386, 24.54807],
[118.084687, 24.529916],
[118.064553, 24.464005],
[118.052219, 24.445064],
[118.049002, 24.418318]
]
],
[
[
[118.079422, 24.444482],
[118.070355, 24.455189],
[118.069038, 24.467735],
[118.07562, 24.494325],
[118.088782, 24.531901],
[118.100288, 24.54807],
[118.111695, 24.555282],
[118.142555, 24.561623],
[118.15562, 24.547779],
[118.170196, 24.545892],
[118.191695, 24.536839],
[118.198667, 24.530497],
[118.203249, 24.518102],
[118.206808, 24.481491],
[118.19891, 24.468268],
[118.156546, 24.434405],
[118.143237, 24.420838],
[118.134608, 24.419675],
[118.106186, 24.424423],
[118.088929, 24.431304],
[118.079422, 24.444482]
]
],
[
[
[118.39094, 24.5593],
[118.394889, 24.554411],
[118.383725, 24.551604],
[118.376851, 24.555089],
[118.39094, 24.5593]
]
],
[
[
[118.07211, 24.4486],
[118.077618, 24.438717],
[118.062506, 24.437263],
[118.056509, 24.445112],
[118.061823, 24.453154],
[118.07211, 24.4486]
]
]
] } }, { "type": "Feature", "properties": { "adcode": 350300, "name": "莆田市", "center": [119.007558, 25.431011], "centroid": [118.893798, 25.445717], "childrenNum": 5, "level": "city", "subFeatureIndex": 2, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[118.883372, 25.241029],
[118.8686, 25.237467],
[118.867089, 25.22418],
[118.855048, 25.223073],
[118.85222, 25.217729],
[118.845346, 25.225913],
[118.834865, 25.219269],
[118.812293, 25.217151],
[118.79484, 25.220473],
[118.775974, 25.206991],
[118.778119, 25.19452],
[118.749648, 25.189078],
[118.7281, 25.173619],
[118.715279, 25.168513],
[118.708941, 25.15835],
[118.691489, 25.158205],
[118.693097, 25.169139],
[118.677692, 25.177568],
[118.679057, 25.193027],
[118.672768, 25.200009],
[118.682323, 25.201021],
[118.689246, 25.215899],
[118.683445, 25.214984],
[118.689002, 25.234964],
[118.684566, 25.243821],
[118.68715, 25.252004],
[118.696705, 25.257539],
[118.680276, 25.271207],
[118.671939, 25.263651],
[118.663018, 25.266347],
[118.659996, 25.258357],
[118.646589, 25.268272],
[118.649807, 25.275154],
[118.661263, 25.278041],
[118.667503, 25.288387],
[118.663018, 25.299887],
[118.641616, 25.299405],
[118.63523, 25.302821],
[118.623774, 25.291707],
[118.604322, 25.295123],
[118.596717, 25.302966],
[118.572634, 25.297192],
[118.572488, 25.289493],
[118.532902, 25.291226],
[118.528905, 25.30845],
[118.536705, 25.321728],
[118.528612, 25.326635],
[118.521153, 25.311],
[118.513256, 25.314753],
[118.524907, 25.337169],
[118.521543, 25.347654],
[118.5291, 25.352944],
[118.527881, 25.360879],
[118.518569, 25.362418],
[118.521202, 25.369535],
[118.510526, 25.376459],
[118.509112, 25.383143],
[118.495852, 25.385066],
[118.49941, 25.400258],
[118.486735, 25.402806],
[118.483615, 25.426215],
[118.468551, 25.424725],
[118.459386, 25.444959],
[118.461921, 25.452599],
[118.476498, 25.467639],
[118.479033, 25.483109],
[118.472939, 25.484454],
[118.474352, 25.493437],
[118.464846, 25.494927],
[118.463676, 25.510057],
[118.470599, 25.512651],
[118.468112, 25.520959],
[118.48654, 25.541897],
[118.496973, 25.556829],
[118.509843, 25.561342],
[118.509551, 25.577376],
[118.527588, 25.594896],
[118.546357, 25.617692],
[118.543384, 25.621963],
[118.552549, 25.633526],
[118.529977, 25.644178],
[118.544992, 25.656507],
[118.5408, 25.661688],
[118.540849, 25.667588],
[118.550745, 25.67814],
[118.55601, 25.675118],
[118.566589, 25.681449],
[118.572195, 25.673583],
[118.57629, 25.688595],
[118.583896, 25.677948],
[118.587844, 25.690706],
[118.596473, 25.684087],
[118.6052, 25.684519],
[118.604468, 25.698618],
[118.613634, 25.699002],
[118.608807, 25.707442],
[118.630648, 25.696604],
[118.63718, 25.709935],
[118.650245, 25.712764],
[118.670672, 25.708832],
[118.677253, 25.701112],
[118.671842, 25.697611],
[118.692269, 25.69507],
[118.705236, 25.6826],
[118.728539, 25.695549],
[118.72225, 25.669363],
[118.734438, 25.669171],
[118.751647, 25.684759],
[118.752817, 25.697323],
[118.761007, 25.686869],
[118.774316, 25.685718],
[118.790989, 25.695166],
[118.807028, 25.708113],
[118.803567, 25.713004],
[118.812293, 25.721251],
[118.82687, 25.720196],
[118.833597, 25.711757],
[118.855096, 25.703797],
[118.866309, 25.709216],
[118.879423, 25.708209],
[118.878204, 25.698043],
[118.886102, 25.707394],
[118.911208, 25.726141],
[118.916766, 25.721682],
[118.920422, 25.731319],
[118.936754, 25.749151],
[118.950453, 25.755383],
[118.956108, 25.742201],
[118.951428, 25.730168],
[118.952695, 25.712284],
[118.966638, 25.726381],
[118.98024, 25.733907],
[119.013, 25.734627],
[119.026455, 25.743591],
[119.039472, 25.741434],
[119.055755, 25.749439],
[119.081056, 25.749056],
[119.085541, 25.754903],
[119.091928, 25.74896],
[119.107333, 25.754999],
[119.13283, 25.753753],
[119.137705, 25.747809],
[119.153256, 25.743735],
[119.149015, 25.73199],
[119.134731, 25.724846],
[119.124054, 25.713867],
[119.149307, 25.707633],
[119.151209, 25.697947],
[119.14063, 25.696412],
[119.14375, 25.684471],
[119.156571, 25.676797],
[119.142141, 25.67603],
[119.144969, 25.667204],
[119.132391, 25.644514],
[119.141556, 25.62249],
[119.151404, 25.618748],
[119.155499, 25.603103],
[119.164956, 25.59912],
[119.164518, 25.589904],
[119.155401, 25.582992],
[119.165444, 25.5768],
[119.169149, 25.566479],
[119.18041, 25.556013],
[119.191818, 25.556013],
[119.204981, 25.546842],
[119.228137, 25.564367],
[119.232964, 25.546842],
[119.244323, 25.531044],
[119.243543, 25.511498],
[119.23194, 25.504389],
[119.223604, 25.489306],
[119.213122, 25.493245],
[119.210197, 25.473308],
[119.217802, 25.467014],
[119.196498, 25.441402],
[119.196157, 25.425542],
[119.184798, 25.427225],
[119.16871, 25.438711],
[119.151647, 25.426504],
[119.145846, 25.405162],
[119.144871, 25.387999],
[119.151745, 25.382999],
[119.162665, 25.387037],
[119.17105, 25.37593],
[119.195279, 25.368333],
[119.218777, 25.367948],
[119.228235, 25.350732],
[119.227065, 25.344865],
[119.23584, 25.331156],
[119.240471, 25.316869],
[119.24832, 25.316196],
[119.247491, 25.33361],
[119.253585, 25.33587],
[119.267333, 25.329521],
[119.292635, 25.331156],
[119.299021, 25.328848],
[119.3135, 25.30643],
[119.335682, 25.285452],
[119.353914, 25.280591],
[119.36971, 25.271544],
[119.385017, 25.275683],
[119.37829, 25.248923],
[119.356255, 25.240211],
[119.340898, 25.240933],
[119.332074, 25.23092],
[119.313159, 25.237371],
[119.293366, 25.235108],
[119.301654, 25.204536],
[119.313451, 25.19452],
[119.313451, 25.189415],
[119.300971, 25.17805],
[119.293561, 25.178387],
[119.269332, 25.159987],
[119.261044, 25.175641],
[119.231745, 25.188982],
[119.220386, 25.187248],
[119.198984, 25.176412],
[119.182458, 25.178242],
[119.146724, 25.204199],
[119.138533, 25.224661],
[119.131757, 25.223217],
[119.119131, 25.212384],
[119.108064, 25.194086],
[119.118789, 25.175738],
[119.141848, 25.169525],
[119.143994, 25.157868],
[119.13829, 25.151895],
[119.146334, 25.146692],
[119.16091, 25.150931],
[119.165785, 25.145439],
[119.164274, 25.119133],
[119.158131, 25.092243],
[119.1418, 25.0827],
[119.140532, 25.056283],
[119.147016, 25.05585],
[119.125761, 25.021085],
[119.127808, 25.012597],
[119.119423, 25.012646],
[119.119228, 25.026582],
[119.106699, 25.032996],
[119.106065, 25.04452],
[119.089929, 25.052185],
[119.096949, 25.056139],
[119.113378, 25.052234],
[119.118009, 25.058115],
[119.107284, 25.075325],
[119.12893, 25.095231],
[119.142385, 25.096725],
[119.134292, 25.106074],
[119.082811, 25.108532],
[119.075645, 25.099809],
[119.055998, 25.109592],
[119.05205, 25.116676],
[119.035718, 25.125783],
[119.029137, 25.13961],
[119.028454, 25.164515],
[119.037766, 25.174871],
[119.054292, 25.168561],
[119.062823, 25.173907],
[119.072232, 25.191293],
[119.071989, 25.205595],
[119.081154, 25.218788],
[119.070429, 25.232653],
[119.055608, 25.229957],
[119.055218, 25.219462],
[119.01963, 25.210603],
[119.012464, 25.204391],
[118.98999, 25.201839],
[118.98999, 25.211662],
[118.978436, 25.222832],
[118.979898, 25.232846],
[118.986382, 25.239633],
[118.988576, 25.25417],
[118.996864, 25.266298],
[119.00637, 25.255132],
[119.017485, 25.255469],
[119.023628, 25.267887],
[119.014365, 25.274432],
[118.99467, 25.27679],
[118.983701, 25.269667],
[118.954548, 25.2714],
[118.949283, 25.265288],
[118.930075, 25.255854],
[118.915547, 25.256913],
[118.918082, 25.245843],
[118.883372, 25.241029]
]
],
[
[
[119.532196, 25.202899],
[119.540484, 25.20208],
[119.545066, 25.210266],
[119.55506, 25.203525],
[119.566614, 25.209977],
[119.578412, 25.204776],
[119.570904, 25.193364],
[119.554573, 25.193075],
[119.555743, 25.183155],
[119.547748, 25.18118],
[119.554475, 25.164419],
[119.523567, 25.158061],
[119.521227, 25.166635],
[119.50943, 25.170921],
[119.508455, 25.181902],
[119.471014, 25.197072],
[119.444103, 25.20208],
[119.440983, 25.211614],
[119.44659, 25.222495],
[119.43918, 25.236841],
[119.453902, 25.236552],
[119.456389, 25.244687],
[119.467699, 25.246324],
[119.471453, 25.25956],
[119.479009, 25.257732],
[119.479009, 25.243532],
[119.488467, 25.247046],
[119.499436, 25.240307],
[119.499241, 25.221773],
[119.506163, 25.214743],
[119.514792, 25.214599],
[119.518156, 25.208003],
[119.532196, 25.202899]
]
],
[
[
[119.371806, 25.114893],
[119.366785, 25.118073],
[119.369563, 25.128866],
[119.3779, 25.120241],
[119.371806, 25.114893]
]
],
[
[
[119.518643, 25.279244],
[119.52542, 25.278522],
[119.53049, 25.265769],
[119.512306, 25.266924],
[119.518643, 25.279244]
]
],
[
[
[119.048344, 25.101496],
[119.058923, 25.102267],
[119.049612, 25.094749],
[119.048344, 25.101496]
]
],
[
[
[119.592111, 25.187344],
[119.595182, 25.194761],
[119.602202, 25.187633],
[119.592111, 25.187344]
]
],
[
[
[119.344018, 25.307392],
[119.338022, 25.316437],
[119.345237, 25.323845],
[119.349332, 25.316485],
[119.344018, 25.307392]
]
],
[
[
[119.578851, 25.248538],
[119.584896, 25.250945],
[119.587528, 25.241318],
[119.578851, 25.248538]
]
],
[
[
[119.02704, 25.171451],
[119.018314, 25.178916],
[119.02938, 25.17935],
[119.02704, 25.171451]
]
],
[
[
[119.265091, 25.354291],
[119.257485, 25.348135],
[119.260167, 25.35809],
[119.265091, 25.354291]
]
],
[
[
[119.374926, 25.324037],
[119.360008, 25.331445],
[119.362836, 25.334283],
[119.377071, 25.327453],
[119.374926, 25.324037]
]
],
[
[
[119.461117, 24.982307],
[119.449856, 24.994752],
[119.459509, 24.992196],
[119.461117, 24.982307]
]
]
] } }, { "type": "Feature", "properties": { "adcode": 350400, "name": "三明市", "center": [117.635001, 26.265444], "centroid": [117.39998, 26.297821], "childrenNum": 12, "level": "city", "subFeatureIndex": 3, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[117.053218, 27.101442],
[117.066381, 27.109116],
[117.067794, 27.101347],
[117.076131, 27.105042],
[117.087002, 27.093435],
[117.09802, 27.107979],
[117.114449, 27.099215],
[117.120933, 27.091492],
[117.137654, 27.097841],
[117.145064, 27.106084],
[117.159056, 27.111485],
[117.162712, 27.105137],
[117.177532, 27.097036],
[117.18309, 27.08339],
[117.19713, 27.059886],
[117.226576, 27.050075],
[117.239397, 27.043203],
[117.24203, 27.033533],
[117.256265, 27.034291],
[117.26036, 27.046236],
[117.283029, 27.060123],
[117.285808, 27.086281],
[117.280055, 27.089739],
[117.288538, 27.095946],
[117.287417, 27.113474],
[117.270549, 27.114043],
[117.278544, 27.128537],
[117.315302, 27.113711],
[117.321884, 27.114374],
[117.329781, 27.105942],
[117.35206, 27.096278],
[117.363663, 27.101631],
[117.385845, 27.096657],
[117.380872, 27.086612],
[117.381798, 27.071402],
[117.397545, 27.069127],
[117.398276, 27.058085],
[117.411097, 27.051355],
[117.419434, 27.059365],
[117.432499, 27.064483],
[117.441128, 27.062066],
[117.425771, 27.042729],
[117.443371, 27.046615],
[117.448002, 27.02993],
[117.443029, 27.024004],
[117.450293, 27.021491],
[117.449659, 27.007979],
[117.455656, 27.002147],
[117.478812, 27.014048],
[117.483931, 27.023767],
[117.489148, 27.021871],
[117.484809, 27.009307],
[117.501676, 27.008311],
[117.512597, 27.014712],
[117.523273, 27.001246],
[117.533218, 27.002479],
[117.532584, 26.995556],
[117.542335, 26.996978],
[117.543115, 26.985834],
[117.535071, 26.983131],
[117.532877, 26.961171],
[117.525906, 26.954957],
[117.507673, 26.951637],
[117.503724, 26.928674],
[117.513133, 26.919089],
[117.530098, 26.926824],
[117.54487, 26.922221],
[117.54955, 26.929386],
[117.558276, 26.928627],
[117.563492, 26.921984],
[117.576509, 26.925543],
[117.594449, 26.885204],
[117.603078, 26.885109],
[117.614778, 26.871912],
[117.622627, 26.869634],
[117.63111, 26.858667],
[117.634327, 26.842571],
[117.642566, 26.836825],
[117.652268, 26.819301],
[117.671378, 26.804055],
[117.667429, 26.789709],
[117.672597, 26.783866],
[117.658459, 26.773081],
[117.656948, 26.761012],
[117.645394, 26.739626],
[117.629111, 26.735824],
[117.62487, 26.726366],
[117.613121, 26.727839],
[117.607222, 26.723181],
[117.602152, 26.709348],
[117.592792, 26.70331],
[117.610586, 26.692707],
[117.604102, 26.686621],
[117.641104, 26.673973],
[117.640421, 26.66313],
[117.64632, 26.65533],
[117.672646, 26.651239],
[117.662554, 26.645389],
[117.667527, 26.633687],
[117.680348, 26.637825],
[117.680884, 26.644057],
[117.696387, 26.640299],
[117.705309, 26.655187],
[117.721201, 26.658754],
[117.73841, 26.667172],
[117.743968, 26.658421],
[117.757277, 26.661798],
[117.769903, 26.654426],
[117.78136, 26.668551],
[117.793743, 26.665127],
[117.806613, 26.671975],
[117.826113, 26.668551],
[117.852975, 26.680677],
[117.858581, 26.674781],
[117.851561, 26.662369],
[117.85278, 26.656091],
[117.86214, 26.65747],
[117.855364, 26.639157],
[117.86214, 26.631879],
[117.873743, 26.629786],
[117.855559, 26.614752],
[117.856436, 26.601762],
[117.867502, 26.591436],
[117.862091, 26.582346],
[117.873938, 26.580966],
[117.878325, 26.557214],
[117.88476, 26.565639],
[117.89724, 26.568305],
[117.908843, 26.560165],
[117.924736, 26.558975],
[117.935071, 26.565163],
[117.937655, 26.574873],
[117.952426, 26.565973],
[117.970123, 26.567734],
[117.976899, 26.563212],
[117.983286, 26.569447],
[117.978947, 26.579585],
[117.988843, 26.579823],
[118.000007, 26.573065],
[118.011659, 26.571589],
[117.99328, 26.552739],
[117.993572, 26.538981],
[118.004882, 26.533696],
[118.008977, 26.508506],
[118.021165, 26.507506],
[118.039544, 26.512744],
[118.04047, 26.505124],
[118.032865, 26.497314],
[118.038472, 26.486978],
[118.030964, 26.485263],
[118.029794, 26.476355],
[118.035888, 26.464732],
[118.048173, 26.473974],
[118.058167, 26.469543],
[118.057241, 26.46092],
[118.065187, 26.454774],
[118.060702, 26.438097],
[118.068551, 26.425278],
[118.07718, 26.428089],
[118.08927, 26.41708],
[118.087222, 26.406165],
[118.090879, 26.395821],
[118.101458, 26.397776],
[118.117984, 26.38767],
[118.11345, 26.37966],
[118.134852, 26.375751],
[118.133584, 26.366215],
[118.154986, 26.380232],
[118.166247, 26.378325],
[118.169855, 26.388957],
[118.181165, 26.389195],
[118.189745, 26.381519],
[118.203834, 26.385763],
[118.216656, 26.395202],
[118.213779, 26.403067],
[118.224553, 26.411265],
[118.226113, 26.405117],
[118.244054, 26.403448],
[118.23991, 26.396632],
[118.254876, 26.393533],
[118.262969, 26.398443],
[118.25902, 26.417986],
[118.270623, 26.416365],
[118.270623, 26.428423],
[118.275157, 26.420655],
[118.287149, 26.414792],
[118.298703, 26.418844],
[118.296363, 26.430806],
[118.307673, 26.438097],
[118.309916, 26.430758],
[118.324639, 26.431187],
[118.334048, 26.438621],
[118.333901, 26.427089],
[118.32147, 26.417843],
[118.327369, 26.407119],
[118.340775, 26.408549],
[118.34682, 26.415793],
[118.349892, 26.404497],
[118.363201, 26.401017],
[118.371001, 26.40974],
[118.383237, 26.404211],
[118.386796, 26.396536],
[118.409953, 26.393533],
[118.41161, 26.397013],
[118.437107, 26.398014],
[118.442177, 26.394534],
[118.45261, 26.40383],
[118.45573, 26.389672],
[118.451098, 26.381949],
[118.436132, 26.394058],
[118.427503, 26.383427],
[118.428185, 26.369075],
[118.437643, 26.354103],
[118.450952, 26.350001],
[118.453, 26.338794],
[118.467869, 26.344612],
[118.476644, 26.353053],
[118.499995, 26.365452],
[118.504432, 26.357441],
[118.523591, 26.351098],
[118.519788, 26.345852],
[118.525395, 26.336075],
[118.539825, 26.337029],
[118.543481, 26.343229],
[118.556936, 26.343516],
[118.564736, 26.336266],
[118.561811, 26.326393],
[118.567905, 26.321671],
[118.581019, 26.325916],
[118.595108, 26.324342],
[118.589404, 26.315947],
[118.602665, 26.302446],
[118.61378, 26.299965],
[118.61495, 26.288466],
[118.631769, 26.289039],
[118.633719, 26.272529],
[118.64108, 26.263748],
[118.656144, 26.26308],
[118.668576, 26.24375],
[118.671013, 26.240265],
[118.661994, 26.227854],
[118.650977, 26.224225],
[118.637229, 26.228856],
[118.631915, 26.236255],
[118.61885, 26.233821],
[118.610221, 26.236733],
[118.597205, 26.224894],
[118.613926, 26.210666],
[118.584919, 26.208183],
[118.578192, 26.203647],
[118.579215, 26.194384],
[118.574145, 26.185263],
[118.57746, 26.17189],
[118.565809, 26.176093],
[118.567759, 26.163388],
[118.563664, 26.154885],
[118.563908, 26.136015],
[118.572683, 26.128609],
[118.588673, 26.129852],
[118.581409, 26.113558],
[118.585407, 26.094012],
[118.590574, 26.093295],
[118.590672, 26.077809],
[118.602372, 26.072025],
[118.592427, 26.064232],
[118.600763, 26.05644],
[118.592573, 26.051515],
[118.581848, 26.062225],
[118.541824, 26.056774],
[118.515937, 26.059165],
[118.52169, 26.04377],
[118.520958, 26.027894],
[118.516327, 26.025407],
[118.517838, 26.004268],
[118.52169, 25.989153],
[118.513548, 25.976428],
[118.519398, 25.969969],
[118.515839, 25.964562],
[118.520227, 25.955567],
[118.514377, 25.942694],
[118.514767, 25.928767],
[118.5213, 25.92781],
[118.509209, 25.910196],
[118.510672, 25.895068],
[118.487418, 25.898132],
[118.480885, 25.904021],
[118.471964, 25.89909],
[118.476303, 25.882524],
[118.472451, 25.866675],
[118.464017, 25.868591],
[118.459873, 25.862269],
[118.465334, 25.896361],
[118.45534, 25.899138],
[118.45378, 25.905792],
[118.434328, 25.919482],
[118.417022, 25.901579],
[118.419118, 25.891478],
[118.411171, 25.890568],
[118.393182, 25.900622],
[118.375291, 25.893297],
[118.369928, 25.894159],
[118.371976, 25.904643],
[118.360227, 25.918381],
[118.360178, 25.930969],
[118.349843, 25.940349],
[118.34214, 25.936425],
[118.33707, 25.914265],
[118.318642, 25.913068],
[118.305821, 25.932836],
[118.294852, 25.921875],
[118.284663, 25.932357],
[118.273353, 25.9314],
[118.266674, 25.921827],
[118.272963, 25.903781],
[118.247174, 25.896169],
[118.237814, 25.885589],
[118.228112, 25.886594],
[118.217972, 25.896217],
[118.207344, 25.899951],
[118.196132, 25.884487],
[118.178533, 25.883003],
[118.179166, 25.899664],
[118.166052, 25.901531],
[118.154791, 25.907515],
[118.146455, 25.899425],
[118.137874, 25.900239],
[118.132707, 25.894398],
[118.127344, 25.899808],
[118.103895, 25.892483],
[118.099995, 25.884871],
[118.089367, 25.888318],
[118.078935, 25.88602],
[118.076887, 25.87563],
[118.085272, 25.871128],
[118.065284, 25.848046],
[118.048904, 25.859348],
[118.036522, 25.856666],
[118.029599, 25.863084],
[118.024919, 25.857912],
[118.014389, 25.857959],
[118.019264, 25.844933],
[118.032816, 25.83588],
[118.030623, 25.825198],
[118.026235, 25.831138],
[118.016241, 25.823953],
[118.011317, 25.813845],
[118.009221, 25.795542],
[118.011561, 25.780784],
[118.009026, 25.771486],
[117.997082, 25.765735],
[117.987917, 25.772541],
[117.984017, 25.758163],
[117.977972, 25.75984],
[117.980214, 25.744885],
[117.989721, 25.73942],
[117.990062, 25.731367],
[117.997862, 25.732421],
[117.99523, 25.723792],
[118.014486, 25.724271],
[118.007125, 25.7049],
[118.003907, 25.685958],
[117.989184, 25.685238],
[117.982749, 25.681162],
[117.97256, 25.684039],
[117.9593, 25.67061],
[117.941067, 25.665429],
[117.936729, 25.652669],
[117.952719, 25.656171],
[117.956229, 25.641155],
[117.967637, 25.644418],
[117.976314, 25.629832],
[118.00264, 25.616012],
[118.019215, 25.620091],
[118.028526, 25.62868],
[118.040909, 25.629112],
[118.043152, 25.620811],
[118.04281, 25.597584],
[118.031841, 25.587024],
[118.029696, 25.568207],
[118.002055, 25.549579],
[117.998155, 25.537959],
[117.988161, 25.536519],
[117.980019, 25.528259],
[117.982701, 25.51534],
[117.95618, 25.529556],
[117.93395, 25.518318],
[117.930147, 25.510009],
[117.911524, 25.502948],
[117.897192, 25.501988],
[117.891683, 25.49656],
[117.863846, 25.49656],
[117.853706, 25.487577],
[117.843273, 25.488586],
[117.828599, 25.510777],
[117.81256, 25.515964],
[117.802615, 25.507896],
[117.787307, 25.508184],
[117.787795, 25.493533],
[117.799154, 25.488153],
[117.796911, 25.478593],
[117.787844, 25.479842],
[117.769172, 25.49925],
[117.762006, 25.496079],
[117.761372, 25.50607],
[117.750598, 25.508712],
[117.742847, 25.504149],
[117.732073, 25.509529],
[117.735875, 25.513323],
[117.71657, 25.51217],
[117.701604, 25.517693],
[117.689708, 25.511258],
[117.682834, 25.518798],
[117.687368, 25.526482],
[117.696582, 25.556973],
[117.707795, 25.560622],
[117.725589, 25.546554],
[117.730708, 25.556205],
[117.744065, 25.566479],
[117.743675, 25.575024],
[117.750354, 25.589808],
[117.717496, 25.594224],
[117.712914, 25.59096],
[117.707649, 25.611261],
[117.699068, 25.622394],
[117.685808, 25.631655],
[117.680397, 25.630648],
[117.666162, 25.641011],
[117.66036, 25.640819],
[117.664407, 25.6614],
[117.649343, 25.675598],
[117.640568, 25.668019],
[117.627795, 25.664278],
[117.614096, 25.650702],
[117.594693, 25.65051],
[117.586893, 25.669411],
[117.595034, 25.674063],
[117.584358, 25.685862],
[117.580897, 25.695166],
[117.567978, 25.693535],
[117.557789, 25.70068],
[117.54682, 25.702407],
[117.547843, 25.710894],
[117.53863, 25.725374],
[117.519178, 25.717703],
[117.503529, 25.699769],
[117.496948, 25.706962],
[117.499239, 25.71425],
[117.493876, 25.724127],
[117.504114, 25.732421],
[117.495729, 25.732182],
[117.479787, 25.73966],
[117.460287, 25.730743],
[117.474474, 25.728826],
[117.47345, 25.720052],
[117.459605, 25.712332],
[117.461213, 25.703126],
[117.449903, 25.697132],
[117.450732, 25.68754],
[117.443127, 25.679243],
[117.446929, 25.674543],
[117.43713, 25.66423],
[117.416753, 25.662071],
[117.403151, 25.654972],
[117.390281, 25.65881],
[117.404029, 25.669219],
[117.397691, 25.676701],
[117.403102, 25.680298],
[117.399251, 25.689842],
[117.401347, 25.704948],
[117.396326, 25.738941],
[117.392865, 25.720819],
[117.379994, 25.728586],
[117.382968, 25.738989],
[117.376046, 25.747713],
[117.383797, 25.752938],
[117.377362, 25.765496],
[117.379117, 25.780065],
[117.374973, 25.784905],
[117.363712, 25.783611],
[117.353718, 25.788355],
[117.345771, 25.784905],
[117.341043, 25.773403],
[117.344065, 25.751692],
[117.334851, 25.754041],
[117.320421, 25.748289],
[117.317593, 25.740523],
[117.288343, 25.742057],
[117.279324, 25.732853],
[117.270013, 25.732517],
[117.270256, 25.719716],
[117.260994, 25.715113],
[117.260214, 25.70327],
[117.242468, 25.690706],
[117.267868, 25.679243],
[117.280494, 25.682217],
[117.294583, 25.669794],
[117.28142, 25.666437],
[117.255095, 25.647632],
[117.246905, 25.65075],
[117.239641, 25.638948],
[117.246174, 25.633622],
[117.236423, 25.623594],
[117.239007, 25.611741],
[117.224187, 25.606414],
[117.225844, 25.593936],
[117.208392, 25.58928],
[117.20766, 25.581936],
[117.198398, 25.570175],
[117.212487, 25.570079],
[117.197081, 25.558894],
[117.182407, 25.57608],
[117.167246, 25.569551],
[117.163785, 25.57488],
[117.166027, 25.593456],
[117.159738, 25.59864],
[117.161835, 25.608478],
[117.15579, 25.618604],
[117.145357, 25.615916],
[117.138044, 25.630072],
[117.120445, 25.648256],
[117.117715, 25.659241],
[117.109964, 25.65526],
[117.110841, 25.663559],
[117.097776, 25.662071],
[117.091975, 25.653677],
[117.08008, 25.651998],
[117.078861, 25.660632],
[117.070768, 25.669267],
[117.079641, 25.667156],
[117.070866, 25.680442],
[117.059409, 25.687924],
[117.069111, 25.69224],
[117.069306, 25.711086],
[117.059897, 25.713052],
[117.046539, 25.723648],
[117.065893, 25.732421],
[117.056972, 25.753609],
[117.064967, 25.757444],
[117.057215, 25.764729],
[117.058532, 25.775752],
[117.066819, 25.778196],
[117.050829, 25.798705],
[117.039763, 25.804023],
[117.038885, 25.815713],
[117.026844, 25.819545],
[117.025722, 25.839664],
[117.018459, 25.856523],
[117.004321, 25.86361],
[116.992426, 25.86203],
[116.998032, 25.85523],
[116.992084, 25.850919],
[116.974632, 25.847998],
[116.971999, 25.841676],
[116.955424, 25.843927],
[116.95167, 25.835545],
[116.946307, 25.846705],
[116.936606, 25.851542],
[116.917593, 25.853649],
[116.910768, 25.845795],
[116.890439, 25.838898],
[116.88649, 25.820551],
[116.873961, 25.811593],
[116.871816, 25.800094],
[116.851194, 25.788115],
[116.827697, 25.778531],
[116.808489, 25.784665],
[116.807075, 25.791182],
[116.784991, 25.806323],
[116.777045, 25.816623],
[116.784308, 25.837509],
[116.790305, 25.845843],
[116.790207, 25.85772],
[116.770512, 25.858199],
[116.762858, 25.841197],
[116.746332, 25.852883],
[116.741944, 25.865095],
[116.74287, 25.87855],
[116.752084, 25.897127],
[116.739848, 25.895643],
[116.727611, 25.903446],
[116.716935, 25.902393],
[116.713717, 25.913307],
[116.705576, 25.916562],
[116.698556, 25.926135],
[116.680225, 25.928193],
[116.67379, 25.941067],
[116.664771, 25.942359],
[116.654485, 25.93743],
[116.650829, 25.953078],
[116.653802, 25.965615],
[116.646831, 25.969873],
[116.644394, 25.981738],
[116.652486, 25.986378],
[116.653071, 25.999294],
[116.642639, 26.001207],
[116.645612, 26.009051],
[116.627721, 26.010295],
[116.630695, 25.994367],
[116.622163, 25.990588],
[116.621578, 25.983317],
[116.595594, 25.980685],
[116.588476, 25.984178],
[116.587355, 25.97461],
[116.581213, 25.978198],
[116.575655, 25.971643],
[116.568099, 25.976954],
[116.572242, 25.982695],
[116.566782, 25.990827],
[116.554887, 25.994176],
[116.541968, 25.992358],
[116.538409, 26.001685],
[116.52939, 25.999055],
[116.510573, 25.983412],
[116.506478, 25.9848],
[116.49663, 25.972313],
[116.484978, 25.968198],
[116.480201, 25.973701],
[116.482687, 25.991592],
[116.477178, 26.000824],
[116.481615, 26.007855],
[116.463967, 26.021247],
[116.455923, 26.014456],
[116.44081, 26.014121],
[116.42911, 26.022155],
[116.412437, 26.021964],
[116.40025, 26.033298],
[116.401322, 26.04616],
[116.418239, 26.054575],
[116.421749, 26.065667],
[116.44354, 26.078908],
[116.458409, 26.091909],
[116.477178, 26.10271],
[116.489269, 26.113701],
[116.489464, 26.128753],
[116.481907, 26.137974],
[116.482102, 26.16014],
[116.471474, 26.175185],
[116.463382, 26.175424],
[116.453632, 26.166111],
[116.435935, 26.160044],
[116.41507, 26.159806],
[116.392498, 26.170314],
[116.399372, 26.189943],
[116.400055, 26.203791],
[116.390451, 26.210093],
[116.393132, 26.217446],
[116.385429, 26.238165],
[116.395618, 26.244561],
[116.391669, 26.256589],
[116.401761, 26.274867],
[116.41819, 26.279257],
[116.422041, 26.29152],
[116.413071, 26.298057],
[116.427258, 26.300251],
[116.437105, 26.308218],
[116.438714, 26.321385],
[116.453827, 26.331592],
[116.459287, 26.345137],
[116.499799, 26.361399],
[116.494534, 26.369028],
[116.498239, 26.387097],
[116.511109, 26.39115],
[116.512181, 26.402257],
[116.519397, 26.41036],
[116.533437, 26.408835],
[116.534558, 26.400779],
[116.545186, 26.397251],
[116.55362, 26.400255],
[116.559226, 26.38562],
[116.553717, 26.365404],
[116.571072, 26.370983],
[116.584235, 26.366119],
[116.601395, 26.372938],
[116.608952, 26.383808],
[116.610561, 26.39401],
[116.604418, 26.405784],
[116.604174, 26.415793],
[116.610658, 26.433284],
[116.627965, 26.445483],
[116.63011, 26.459634],
[116.63713, 26.466113],
[116.638105, 26.479499],
[116.610756, 26.476975],
[116.597447, 26.485358],
[116.6012, 26.490455],
[116.589013, 26.49798],
[116.598763, 26.510458],
[116.586916, 26.519982],
[116.578775, 26.521649],
[116.579604, 26.531601],
[116.56259, 26.544694],
[116.540896, 26.556357],
[116.540944, 26.568115],
[116.55323, 26.575778],
[116.558982, 26.596242],
[116.561907, 26.620651],
[116.568781, 26.642202],
[116.566051, 26.650145],
[116.550548, 26.651192],
[116.545039, 26.659658],
[116.519884, 26.684767],
[116.511986, 26.708254],
[116.515106, 26.720994],
[116.537824, 26.737107],
[116.550207, 26.751317],
[116.558641, 26.766809],
[116.55791, 26.773983],
[116.547721, 26.791134],
[116.543674, 26.803912],
[116.544162, 26.820441],
[116.548647, 26.840007],
[116.557373, 26.85183],
[116.568976, 26.858952],
[116.602127, 26.888716],
[116.632986, 26.933988],
[116.659263, 26.962215],
[116.679299, 26.978484],
[116.704893, 26.990909],
[116.734095, 26.993754],
[116.7573, 26.984364],
[116.765003, 27.000393],
[116.782261, 27.009591],
[116.817703, 27.018505],
[116.851341, 27.009354],
[116.860945, 27.011488],
[116.880152, 27.026564],
[116.894339, 27.032679],
[116.910085, 27.034576],
[116.927685, 27.031352],
[116.936362, 27.019311],
[116.946795, 27.037989],
[116.967563, 27.061782],
[117.000177, 27.080121],
[117.032401, 27.089739],
[117.053218, 27.101442]
]
]
] } }, { "type": "Feature", "properties": { "adcode": 350500, "name": "泉州市", "center": [118.589421, 24.908853], "centroid": [118.26637, 25.202655], "childrenNum": 12, "level": "city", "subFeatureIndex": 4, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[118.373828, 24.575611],
[118.355547, 24.575805],
[118.353694, 24.583983],
[118.341214, 24.594581],
[118.343115, 24.603533],
[118.332098, 24.597678],
[118.336046, 24.618677],
[118.344188, 24.617129],
[118.347649, 24.631449],
[118.342774, 24.643446],
[118.351549, 24.649105],
[118.353012, 24.663953],
[118.33746, 24.675173],
[118.340678, 24.68146],
[118.320105, 24.695241],
[118.339313, 24.722459],
[118.331805, 24.731982],
[118.327418, 24.730145],
[118.315035, 24.74711],
[118.327808, 24.753828],
[118.331415, 24.749624],
[118.343408, 24.769147],
[118.342482, 24.780793],
[118.33434, 24.774946],
[118.32186, 24.783885],
[118.328246, 24.790794],
[118.32615, 24.798331],
[118.299581, 24.818137],
[118.303432, 24.825527],
[118.287296, 24.82828],
[118.283054, 24.833544],
[118.273158, 24.83224],
[118.264822, 24.824657],
[118.254681, 24.826493],
[118.250294, 24.832772],
[118.239569, 24.822725],
[118.231476, 24.82543],
[118.22314, 24.839775],
[118.22548, 24.850834],
[118.214852, 24.855421],
[118.192475, 24.870824],
[118.203444, 24.881494],
[118.194377, 24.892936],
[118.17746, 24.891777],
[118.170391, 24.898053],
[118.15484, 24.892453],
[118.137289, 24.894481],
[118.124614, 24.888108],
[118.112232, 24.874349],
[118.09629, 24.87208],
[118.0764, 24.853779],
[118.070891, 24.854842],
[118.073767, 24.874977],
[118.065528, 24.875942],
[118.060604, 24.86701],
[118.050562, 24.871355],
[118.051001, 24.878115],
[118.041884, 24.882025],
[118.042908, 24.893274],
[118.017314, 24.904473],
[118.017509, 24.893708],
[118.008831, 24.892984],
[117.993816, 24.900949],
[117.990452, 24.894625],
[118.010684, 24.885646],
[118.01668, 24.87768],
[118.003078, 24.879467],
[117.991476, 24.872418],
[117.99796, 24.859477],
[117.971488, 24.848902],
[117.96242, 24.865899],
[117.954084, 24.871693],
[117.935266, 24.866817],
[117.932292, 24.873625],
[117.919568, 24.88275],
[117.912402, 24.869521],
[117.902213, 24.870003],
[117.892414, 24.881736],
[117.894169, 24.887432],
[117.882518, 24.890377],
[117.872426, 24.87459],
[117.865114, 24.880287],
[117.854681, 24.873818],
[117.844102, 24.875073],
[117.831963, 24.88217],
[117.822067, 24.873576],
[117.828112, 24.865561],
[117.812365, 24.849723],
[117.802664, 24.851944],
[117.800129, 24.861698],
[117.79228, 24.858367],
[117.781067, 24.846343],
[117.772828, 24.85151],
[117.768733, 24.8729],
[117.762298, 24.86812],
[117.736314, 24.880529],
[117.73256, 24.873818],
[117.723736, 24.879225],
[117.716034, 24.870921],
[117.719544, 24.866237],
[117.698727, 24.859091],
[117.680787, 24.848371],
[117.672207, 24.856435],
[117.642664, 24.859381],
[117.632231, 24.867976],
[117.62409, 24.866817],
[117.614486, 24.89115],
[117.61629, 24.898535],
[117.62955, 24.910458],
[117.632816, 24.92402],
[117.621311, 24.922186],
[117.615851, 24.928171],
[117.606149, 24.927833],
[117.608148, 24.935796],
[117.602834, 24.948487],
[117.612195, 24.956593],
[117.612926, 24.964747],
[117.628624, 24.966725],
[117.655827, 24.9825],
[117.657484, 24.997742],
[117.670159, 25.000299],
[117.686442, 24.988047],
[117.695315, 24.992437],
[117.699117, 25.003144],
[117.716229, 25.002035],
[117.717204, 25.017516],
[117.727636, 25.01877],
[117.740165, 25.032514],
[117.735388, 25.039698],
[117.724175, 25.043362],
[117.731293, 25.051318],
[117.728075, 25.067323],
[117.722176, 25.079181],
[117.713596, 25.077542],
[117.709599, 25.066793],
[117.693901, 25.08188],
[117.682006, 25.081784],
[117.670257, 25.101159],
[117.672353, 25.123518],
[117.660604, 25.13195],
[117.634474, 25.134214],
[117.633596, 25.141296],
[117.625065, 25.138695],
[117.61824, 25.149968],
[117.621116, 25.161818],
[117.604979, 25.163167],
[117.598057, 25.172703],
[117.583432, 25.173667],
[117.573243, 25.182817],
[117.577338, 25.186911],
[117.555595, 25.192064],
[117.559739, 25.212336],
[117.565296, 25.22158],
[117.580458, 25.231786],
[117.595619, 25.22702],
[117.603224, 25.218884],
[117.604736, 25.224661],
[117.61434, 25.221725],
[117.624041, 25.238526],
[117.614925, 25.254892],
[117.602542, 25.258887],
[117.607953, 25.279436],
[117.600056, 25.292381],
[117.610732, 25.300079],
[117.622822, 25.30287],
[117.653828, 25.318553],
[117.660117, 25.33688],
[117.684492, 25.34977],
[117.680348, 25.358956],
[117.689611, 25.358812],
[117.693365, 25.370882],
[117.688636, 25.382037],
[117.691853, 25.38997],
[117.683224, 25.403095],
[117.691805, 25.410546],
[117.698386, 25.426696],
[117.690245, 25.439384],
[117.69512, 25.455338],
[117.706089, 25.459663],
[117.70604, 25.472588],
[117.716716, 25.484646],
[117.713694, 25.497136],
[117.71657, 25.51217],
[117.735875, 25.513323],
[117.732073, 25.509529],
[117.742847, 25.504149],
[117.750598, 25.508712],
[117.761372, 25.50607],
[117.762006, 25.496079],
[117.769172, 25.49925],
[117.787844, 25.479842],
[117.796911, 25.478593],
[117.799154, 25.488153],
[117.787795, 25.493533],
[117.787307, 25.508184],
[117.802615, 25.507896],
[117.81256, 25.515964],
[117.828599, 25.510777],
[117.843273, 25.488586],
[117.853706, 25.487577],
[117.863846, 25.49656],
[117.891683, 25.49656],
[117.897192, 25.501988],
[117.911524, 25.502948],
[117.930147, 25.510009],
[117.93395, 25.518318],
[117.95618, 25.529556],
[117.982701, 25.51534],
[117.980019, 25.528259],
[117.988161, 25.536519],
[117.998155, 25.537959],
[118.002055, 25.549579],
[118.029696, 25.568207],
[118.031841, 25.587024],
[118.04281, 25.597584],
[118.043152, 25.620811],
[118.040909, 25.629112],
[118.028526, 25.62868],
[118.019215, 25.620091],
[118.00264, 25.616012],
[117.976314, 25.629832],
[117.967637, 25.644418],
[117.956229, 25.641155],
[117.952719, 25.656171],
[117.936729, 25.652669],
[117.941067, 25.665429],
[117.9593, 25.67061],
[117.97256, 25.684039],
[117.982749, 25.681162],
[117.989184, 25.685238],
[118.003907, 25.685958],
[118.007125, 25.7049],
[118.014486, 25.724271],
[117.99523, 25.723792],
[117.997862, 25.732421],
[117.990062, 25.731367],
[117.989721, 25.73942],
[117.980214, 25.744885],
[117.977972, 25.75984],
[117.984017, 25.758163],
[117.987917, 25.772541],
[117.997082, 25.765735],
[118.009026, 25.771486],
[118.011561, 25.780784],
[118.009221, 25.795542],
[118.011317, 25.813845],
[118.016241, 25.823953],
[118.026235, 25.831138],
[118.030623, 25.825198],
[118.032816, 25.83588],
[118.019264, 25.844933],
[118.014389, 25.857959],
[118.024919, 25.857912],
[118.029599, 25.863084],
[118.036522, 25.856666],
[118.048904, 25.859348],
[118.065284, 25.848046],
[118.085272, 25.871128],
[118.076887, 25.87563],
[118.078935, 25.88602],
[118.089367, 25.888318],
[118.099995, 25.884871],
[118.103895, 25.892483],
[118.127344, 25.899808],
[118.132707, 25.894398],
[118.137874, 25.900239],
[118.146455, 25.899425],
[118.154791, 25.907515],
[118.166052, 25.901531],
[118.179166, 25.899664],
[118.178533, 25.883003],
[118.196132, 25.884487],
[118.207344, 25.899951],
[118.217972, 25.896217],
[118.228112, 25.886594],
[118.237814, 25.885589],
[118.247174, 25.896169],
[118.272963, 25.903781],
[118.266674, 25.921827],
[118.273353, 25.9314],
[118.284663, 25.932357],
[118.294852, 25.921875],
[118.305821, 25.932836],
[118.318642, 25.913068],
[118.33707, 25.914265],
[118.34214, 25.936425],
[118.349843, 25.940349],
[118.360178, 25.930969],
[118.360227, 25.918381],
[118.371976, 25.904643],
[118.369928, 25.894159],
[118.375291, 25.893297],
[118.393182, 25.900622],
[118.411171, 25.890568],
[118.405955, 25.879077],
[118.421848, 25.856331],
[118.408685, 25.848908],
[118.407515, 25.842442],
[118.398301, 25.847902],
[118.394157, 25.836455],
[118.39484, 25.823857],
[118.381043, 25.812791],
[118.391671, 25.810395],
[118.400154, 25.798321],
[118.41044, 25.796261],
[118.417314, 25.778867],
[118.4237, 25.778819],
[118.417899, 25.770145],
[118.430379, 25.757396],
[118.426187, 25.746084],
[118.430916, 25.730408],
[118.441982, 25.725949],
[118.447978, 25.718038],
[118.455973, 25.722066],
[118.467284, 25.710942],
[118.48186, 25.706818],
[118.480836, 25.70255],
[118.492342, 25.693295],
[118.502482, 25.679003],
[118.522323, 25.659049],
[118.5408, 25.661688],
[118.544992, 25.656507],
[118.529977, 25.644178],
[118.552549, 25.633526],
[118.543384, 25.621963],
[118.546357, 25.617692],
[118.527588, 25.594896],
[118.509551, 25.577376],
[118.509843, 25.561342],
[118.496973, 25.556829],
[118.48654, 25.541897],
[118.468112, 25.520959],
[118.470599, 25.512651],
[118.463676, 25.510057],
[118.464846, 25.494927],
[118.474352, 25.493437],
[118.472939, 25.484454],
[118.479033, 25.483109],
[118.476498, 25.467639],
[118.461921, 25.452599],
[118.459386, 25.444959],
[118.468551, 25.424725],
[118.483615, 25.426215],
[118.486735, 25.402806],
[118.49941, 25.400258],
[118.495852, 25.385066],
[118.509112, 25.383143],
[118.510526, 25.376459],
[118.521202, 25.369535],
[118.518569, 25.362418],
[118.527881, 25.360879],
[118.5291, 25.352944],
[118.521543, 25.347654],
[118.524907, 25.337169],
[118.513256, 25.314753],
[118.521153, 25.311],
[118.528612, 25.326635],
[118.536705, 25.321728],
[118.528905, 25.30845],
[118.532902, 25.291226],
[118.572488, 25.289493],
[118.572634, 25.297192],
[118.596717, 25.302966],
[118.604322, 25.295123],
[118.623774, 25.291707],
[118.63523, 25.302821],
[118.641616, 25.299405],
[118.663018, 25.299887],
[118.667503, 25.288387],
[118.661263, 25.278041],
[118.649807, 25.275154],
[118.646589, 25.268272],
[118.659996, 25.258357],
[118.663018, 25.266347],
[118.671939, 25.263651],
[118.680276, 25.271207],
[118.696705, 25.257539],
[118.68715, 25.252004],
[118.684566, 25.243821],
[118.689002, 25.234964],
[118.683445, 25.214984],
[118.689246, 25.215899],
[118.682323, 25.201021],
[118.672768, 25.200009],
[118.679057, 25.193027],
[118.677692, 25.177568],
[118.693097, 25.169139],
[118.691489, 25.158205],
[118.708941, 25.15835],
[118.715279, 25.168513],
[118.7281, 25.173619],
[118.749648, 25.189078],
[118.778119, 25.19452],
[118.775974, 25.206991],
[118.79484, 25.220473],
[118.812293, 25.217151],
[118.834865, 25.219269],
[118.845346, 25.225913],
[118.85222, 25.217729],
[118.855048, 25.223073],
[118.867089, 25.22418],
[118.8686, 25.237467],
[118.883372, 25.241029],
[118.909843, 25.241366],
[118.91974, 25.233086],
[118.941629, 25.224613],
[118.939338, 25.215706],
[118.950404, 25.206173],
[118.965858, 25.209303],
[118.973999, 25.198806],
[118.984432, 25.195483],
[118.985505, 25.166105],
[118.966589, 25.153918],
[118.951477, 25.14939],
[118.953914, 25.127132],
[118.974828, 25.121301],
[118.975559, 25.117158],
[118.937778, 25.098026],
[118.927784, 25.100147],
[118.914475, 25.095713],
[118.892098, 25.092725],
[118.868113, 25.082459],
[118.885273, 25.060478],
[118.905066, 25.060526],
[118.91428, 25.050691],
[118.917351, 25.031694],
[118.932854, 25.024798],
[118.948308, 25.028029],
[118.960349, 25.02176],
[118.976291, 25.026775],
[118.983603, 25.044037],
[118.993744, 25.045002],
[119.008125, 25.05503],
[119.02314, 25.048521],
[119.013585, 25.033382],
[119.007833, 25.03044],
[119.002177, 25.005749],
[119.003932, 24.999431],
[118.987601, 25.000492],
[118.98375, 24.990266],
[118.989697, 24.974058],
[119.005785, 24.969282],
[119.00715, 24.958716],
[119.017095, 24.963444],
[119.032452, 24.961369],
[119.032744, 24.957654],
[119.013926, 24.94149],
[118.982775, 24.934396],
[118.983457, 24.938305],
[118.945627, 24.954036],
[118.933341, 24.949355],
[118.918375, 24.932466],
[118.918277, 24.923876],
[118.928125, 24.918711],
[118.932951, 24.906548],
[118.942116, 24.908189],
[118.955523, 24.896991],
[118.972293, 24.902252],
[118.988186, 24.896846],
[118.991842, 24.880336],
[118.958009, 24.871211],
[118.948893, 24.876232],
[118.93144, 24.870438],
[118.906967, 24.876135],
[118.895852, 24.884005],
[118.876157, 24.888205],
[118.864749, 24.887384],
[118.847686, 24.875701],
[118.838326, 24.875701],
[118.835693, 24.86812],
[118.845785, 24.863775],
[118.834475, 24.854262],
[118.819654, 24.86899],
[118.80576, 24.869859],
[118.787235, 24.855663],
[118.751208, 24.845377],
[118.745894, 24.824512],
[118.734926, 24.826106],
[118.731415, 24.840692],
[118.705188, 24.844314],
[118.698557, 24.85262],
[118.702409, 24.865513],
[118.696997, 24.867879],
[118.687735, 24.85658],
[118.672866, 24.849578],
[118.647905, 24.843638],
[118.645712, 24.829053],
[118.650392, 24.808765],
[118.673695, 24.794466],
[118.690904, 24.799925],
[118.710599, 24.796736],
[118.713036, 24.809248],
[118.72108, 24.815866],
[118.732244, 24.815625],
[118.731415, 24.800939],
[118.736096, 24.783981],
[118.744822, 24.779488],
[118.785431, 24.77683],
[118.784651, 24.760062],
[118.77651, 24.740972],
[118.765785, 24.734592],
[118.76598, 24.728695],
[118.75233, 24.718785],
[118.746821, 24.724345],
[118.742384, 24.717142],
[118.750526, 24.716465],
[118.739801, 24.706264],
[118.742238, 24.698964],
[118.731464, 24.691372],
[118.724054, 24.677688],
[118.71679, 24.676576],
[118.703433, 24.665453],
[118.685931, 24.662599],
[118.677497, 24.667194],
[118.670184, 24.679767],
[118.656095, 24.669805],
[118.652439, 24.6537],
[118.654974, 24.633674],
[118.661263, 24.622257],
[118.667016, 24.621387],
[118.672476, 24.631449],
[118.686857, 24.633626],
[118.6891, 24.608952],
[118.680325, 24.582241],
[118.673256, 24.575079],
[118.664286, 24.573772],
[118.655998, 24.565883],
[118.657461, 24.55446],
[118.639666, 24.548748],
[118.625382, 24.535144],
[118.620605, 24.534805],
[118.614267, 24.521733],
[118.590769, 24.513792],
[118.579947, 24.507207],
[118.558106, 24.512582],
[118.566443, 24.52062],
[118.563713, 24.539308],
[118.546211, 24.549764],
[118.547186, 24.559203],
[118.556498, 24.562591],
[118.557326, 24.572901],
[118.518569, 24.605904],
[118.478643, 24.615],
[118.444614, 24.614952],
[118.422092, 24.598549],
[118.409904, 24.595114],
[118.373828, 24.575611]
]
],
[
[
[118.412536, 24.514325],
[118.414584, 24.526672],
[118.430526, 24.521346],
[118.438521, 24.50774],
[118.454901, 24.504447],
[118.462945, 24.478537],
[118.473475, 24.477277],
[118.467917, 24.470448],
[118.467527, 24.459307],
[118.478984, 24.447971],
[118.477034, 24.437506],
[118.465626, 24.434211],
[118.469819, 24.425296],
[118.459532, 24.420062],
[118.457728, 24.41226],
[118.430721, 24.403586],
[118.437009, 24.411],
[118.432378, 24.418899],
[118.416095, 24.42171],
[118.405273, 24.428058],
[118.372268, 24.42641],
[118.350672, 24.412309],
[118.339849, 24.390161],
[118.333073, 24.383714],
[118.318789, 24.383617],
[118.299483, 24.39239],
[118.294316, 24.401453],
[118.281933, 24.410419],
[118.290659, 24.415023],
[118.290123, 24.423067],
[118.311964, 24.424617],
[118.304797, 24.454608],
[118.294023, 24.466766],
[118.29573, 24.47534],
[118.314157, 24.487691],
[118.34526, 24.468559],
[118.374608, 24.458774],
[118.389526, 24.465507],
[118.390404, 24.474904],
[118.383676, 24.480716],
[118.39991, 24.490742],
[118.395035, 24.508902],
[118.412536, 24.514325]
]
],
[
[
[118.230403, 24.401308],
[118.217923, 24.405621],
[118.220702, 24.42578],
[118.229087, 24.427961],
[118.233865, 24.445791],
[118.255608, 24.451943],
[118.27345, 24.441139],
[118.269989, 24.421419],
[118.25278, 24.4173],
[118.246735, 24.407317],
[118.238204, 24.40819],
[118.230403, 24.401308]
]
],
[
[
[119.028308, 25.029669],
[119.02704, 25.04047],
[119.036791, 25.031549],
[119.028308, 25.029669]
]
]
] } }, { "type": "Feature", "properties": { "adcode": 350600, "name": "漳州市", "center": [117.661801, 24.510897], "centroid": [117.458463, 24.330653], "childrenNum": 11, "level": "city", "subFeatureIndex": 5, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[116.903797, 24.370626],
[116.901895, 24.38638],
[116.912084, 24.378867],
[116.930073, 24.384829],
[116.928367, 24.396898],
[116.937045, 24.412406],
[116.947721, 24.42171],
[116.949769, 24.43048],
[116.93997, 24.458968],
[116.928123, 24.477277],
[116.928952, 24.483574],
[116.919153, 24.49263],
[116.918958, 24.508611],
[116.912718, 24.524057],
[116.922078, 24.528027],
[116.928903, 24.513405],
[116.937337, 24.521733],
[116.931633, 24.533305],
[116.943382, 24.54623],
[116.95479, 24.549377],
[116.96376, 24.545504],
[116.989306, 24.547537],
[116.999494, 24.538533],
[117.011048, 24.55141],
[117.018068, 24.553153],
[117.022895, 24.576337],
[117.015972, 24.591],
[117.027331, 24.599178],
[117.02855, 24.608759],
[117.017045, 24.624628],
[117.017825, 24.631304],
[117.027087, 24.634835],
[117.038739, 24.626273],
[117.046978, 24.652975],
[117.033474, 24.672175],
[117.040445, 24.68291],
[117.039665, 24.692436],
[117.026551, 24.693935],
[117.028257, 24.700656],
[117.016801, 24.70931],
[117.018946, 24.740199],
[117.025966, 24.744742],
[117.019141, 24.752813],
[117.01451, 24.766586],
[117.031816, 24.774704],
[117.034156, 24.787025],
[117.048148, 24.792002],
[117.053413, 24.801036],
[117.049025, 24.811567],
[117.05195, 24.822097],
[117.064041, 24.834897],
[117.073693, 24.822725],
[117.071792, 24.812437],
[117.075643, 24.798089],
[117.070671, 24.790939],
[117.077642, 24.780019],
[117.104552, 24.788668],
[117.119909, 24.773593],
[117.133949, 24.774656],
[117.149598, 24.790069],
[117.141652, 24.79205],
[117.151694, 24.80036],
[117.155302, 24.816687],
[117.168757, 24.824609],
[117.174071, 24.835718],
[117.168757, 24.84586],
[117.16632, 24.870148],
[117.174607, 24.8701],
[117.197033, 24.883184],
[117.196691, 24.90259],
[117.189086, 24.903507],
[117.183821, 24.924744],
[117.211902, 24.920352],
[117.218581, 24.908624],
[117.228574, 24.908576],
[117.227941, 24.914175],
[117.237983, 24.924503],
[117.2393, 24.934493],
[117.251829, 24.943034],
[117.253584, 24.955001],
[117.231548, 24.956641],
[117.239105, 24.968269],
[117.24398, 24.962913],
[117.255095, 24.96494],
[117.259239, 24.97372],
[117.290147, 24.991183],
[117.294144, 24.985394],
[117.284638, 24.97454],
[117.303651, 24.974781],
[117.309988, 24.966242],
[117.335826, 24.974395],
[117.342505, 24.981921],
[117.356692, 24.972176],
[117.368051, 24.973961],
[117.383358, 24.985684],
[117.391158, 24.97922],
[117.400616, 24.98332],
[117.430695, 24.975505],
[117.436155, 24.964361],
[117.457703, 24.956496],
[117.469598, 24.959729],
[117.483931, 24.954325],
[117.491634, 24.957847],
[117.490123, 25.004688],
[117.496996, 25.018336],
[117.490269, 25.025763],
[117.502846, 25.032031],
[117.511817, 25.050112],
[117.507234, 25.071661],
[117.511573, 25.073927],
[117.510793, 25.092677],
[117.506162, 25.107327],
[117.486515, 25.119181],
[117.476277, 25.121639],
[117.475351, 25.128963],
[117.487051, 25.138936],
[117.48359, 25.147222],
[117.489391, 25.15729],
[117.482517, 25.165334],
[117.495778, 25.164708],
[117.49373, 25.172655],
[117.50855, 25.176845],
[117.520592, 25.173956],
[117.529221, 25.180554],
[117.532341, 25.199817],
[117.547843, 25.191341],
[117.543651, 25.210699],
[117.559739, 25.212336],
[117.555595, 25.192064],
[117.577338, 25.186911],
[117.573243, 25.182817],
[117.583432, 25.173667],
[117.598057, 25.172703],
[117.604979, 25.163167],
[117.621116, 25.161818],
[117.61824, 25.149968],
[117.625065, 25.138695],
[117.633596, 25.141296],
[117.634474, 25.134214],
[117.660604, 25.13195],
[117.672353, 25.123518],
[117.670257, 25.101159],
[117.682006, 25.081784],
[117.693901, 25.08188],
[117.709599, 25.066793],
[117.713596, 25.077542],
[117.722176, 25.079181],
[117.728075, 25.067323],
[117.731293, 25.051318],
[117.724175, 25.043362],
[117.735388, 25.039698],
[117.740165, 25.032514],
[117.727636, 25.01877],
[117.717204, 25.017516],
[117.716229, 25.002035],
[117.699117, 25.003144],
[117.695315, 24.992437],
[117.686442, 24.988047],
[117.670159, 25.000299],
[117.657484, 24.997742],
[117.655827, 24.9825],
[117.628624, 24.966725],
[117.612926, 24.964747],
[117.612195, 24.956593],
[117.602834, 24.948487],
[117.608148, 24.935796],
[117.606149, 24.927833],
[117.615851, 24.928171],
[117.621311, 24.922186],
[117.632816, 24.92402],
[117.62955, 24.910458],
[117.61629, 24.898535],
[117.614486, 24.89115],
[117.62409, 24.866817],
[117.632231, 24.867976],
[117.642664, 24.859381],
[117.672207, 24.856435],
[117.680787, 24.848371],
[117.698727, 24.859091],
[117.719544, 24.866237],
[117.716034, 24.870921],
[117.723736, 24.879225],
[117.73256, 24.873818],
[117.736314, 24.880529],
[117.762298, 24.86812],
[117.768733, 24.8729],
[117.772828, 24.85151],
[117.781067, 24.846343],
[117.79228, 24.858367],
[117.800129, 24.861698],
[117.802664, 24.851944],
[117.812365, 24.849723],
[117.828112, 24.865561],
[117.822067, 24.873576],
[117.831963, 24.88217],
[117.844102, 24.875073],
[117.854681, 24.873818],
[117.865114, 24.880287],
[117.872426, 24.87459],
[117.882518, 24.890377],
[117.894169, 24.887432],
[117.892414, 24.881736],
[117.902213, 24.870003],
[117.912402, 24.869521],
[117.933267, 24.856821],
[117.9398, 24.843107],
[117.961835, 24.844363],
[117.958715, 24.810891],
[117.962615, 24.795577],
[117.954669, 24.766683],
[117.944431, 24.762769],
[117.945309, 24.75146],
[117.940775, 24.733142],
[117.947308, 24.712211],
[117.955839, 24.705829],
[117.954328, 24.699737],
[117.964468, 24.680879],
[117.961738, 24.668354],
[117.965735, 24.661632],
[117.954815, 24.654426],
[117.952183, 24.647074],
[117.930732, 24.633626],
[117.920592, 24.613597],
[117.892755, 24.614904],
[117.893438, 24.597727],
[117.887637, 24.589016],
[117.913231, 24.568545],
[117.906698, 24.555525],
[117.910988, 24.551071],
[117.911427, 24.536258],
[117.932146, 24.52856],
[117.938532, 24.512679],
[117.94838, 24.511129],
[117.94955, 24.504447],
[117.960763, 24.499749],
[117.965492, 24.489483],
[117.956278, 24.471368],
[117.954718, 24.448213],
[117.988356, 24.433048],
[117.993572, 24.428251],
[117.998447, 24.411582],
[118.018435, 24.418851],
[118.049002, 24.418318],
[118.086296, 24.410322],
[118.088587, 24.406154],
[118.083566, 24.370966],
[118.076205, 24.363645],
[118.081372, 24.356276],
[118.096436, 24.358458],
[118.112134, 24.356907],
[118.121348, 24.347258],
[118.126857, 24.333148],
[118.127101, 24.318455],
[118.139581, 24.314721],
[118.145675, 24.30633],
[118.144407, 24.293816],
[118.157424, 24.277906],
[118.157424, 24.263642],
[118.153231, 24.255831],
[118.143432, 24.251804],
[118.125979, 24.252531],
[118.123834, 24.235936],
[118.115742, 24.229385],
[118.074693, 24.225454],
[118.063578, 24.219241],
[118.056704, 24.209389],
[118.03891, 24.199292],
[118.01941, 24.197254],
[118.001421, 24.176864],
[118.000056, 24.152441],
[117.990842, 24.142729],
[117.974754, 24.134473],
[117.94721, 24.111353],
[117.93161, 24.094448],
[117.925028, 24.075159],
[117.9281, 24.056257],
[117.927563, 24.039879],
[117.910647, 24.011784],
[117.890074, 24.004783],
[117.864919, 24.004783],
[117.847661, 23.984752],
[117.826064, 23.966371],
[117.807588, 23.947404],
[117.801981, 23.93685],
[117.792816, 23.906299],
[117.787892, 23.899974],
[117.762591, 23.886983],
[117.704041, 23.890097],
[117.691025, 23.889027],
[117.671963, 23.878078],
[117.658508, 23.851797],
[117.651634, 23.815336],
[117.661433, 23.796931],
[117.660312, 23.789091],
[117.639446, 23.76776],
[117.627649, 23.749397],
[117.612975, 23.713394],
[117.601518, 23.701943],
[117.589915, 23.701846],
[117.568611, 23.712517],
[117.544723, 23.71583],
[117.518739, 23.704185],
[117.502651, 23.704623],
[117.488855, 23.679477],
[117.496948, 23.669193],
[117.501335, 23.650524],
[117.493096, 23.642431],
[117.466527, 23.639896],
[117.454681, 23.628244],
[117.455753, 23.606399],
[117.463358, 23.598548],
[117.463748, 23.585185],
[117.453998, 23.57504],
[117.441567, 23.570698],
[117.427526, 23.572162],
[117.382383, 23.553527],
[117.361762, 23.556308],
[117.317788, 23.54899],
[117.302627, 23.550405],
[117.294681, 23.558991],
[117.291268, 23.571186],
[117.27518, 23.566601],
[117.192938, 23.561625],
[117.192596, 23.62956],
[117.185918, 23.63624],
[117.173681, 23.634631],
[117.159348, 23.64014],
[117.147453, 23.65379],
[117.132974, 23.65145],
[117.124882, 23.646039],
[117.115424, 23.665294],
[117.08944, 23.668559],
[117.074083, 23.69093],
[117.066624, 23.688786],
[117.053218, 23.698386],
[117.053998, 23.708522],
[117.049318, 23.724162],
[117.051073, 23.736731],
[117.047806, 23.758652],
[117.042541, 23.763766],
[117.034059, 23.789091],
[117.020067, 23.800729],
[117.018459, 23.81222],
[117.026746, 23.819912],
[117.022456, 23.838752],
[117.012072, 23.855301],
[116.995107, 23.862018],
[116.984625, 23.861288],
[116.981554, 23.855593],
[116.962054, 23.861385],
[116.960055, 23.86815],
[116.97546, 23.872287],
[116.979263, 23.884452],
[116.973023, 23.894817],
[116.958836, 23.900656],
[116.959275, 23.914473],
[116.954741, 23.920457],
[116.973315, 23.927072],
[116.980189, 23.941033],
[116.982627, 23.95932],
[116.973169, 23.974249],
[116.975412, 23.990635],
[116.98131, 23.996713],
[116.969951, 24.007457],
[116.960055, 24.002158],
[116.954449, 24.00595],
[116.95518, 24.020242],
[116.940408, 24.035116],
[116.948794, 24.037983],
[116.95245, 24.054702],
[116.936996, 24.054556],
[116.929732, 24.065441],
[116.926563, 24.098577],
[116.9349, 24.126945],
[116.947087, 24.13491],
[116.964784, 24.153364],
[116.972925, 24.153509],
[116.978824, 24.162055],
[116.990378, 24.168367],
[116.998617, 24.179],
[116.991158, 24.189875],
[116.976338, 24.199778],
[116.971316, 24.198079],
[116.956155, 24.21696],
[116.934022, 24.21929],
[116.939141, 24.239576],
[116.935436, 24.24797],
[116.937727, 24.282854],
[116.929488, 24.286201],
[116.918178, 24.283387],
[116.914278, 24.287705],
[116.913401, 24.312441],
[116.919543, 24.320977],
[116.90911, 24.330191],
[116.908282, 24.34178],
[116.896143, 24.350701],
[116.896923, 24.360106],
[116.903797, 24.370626]
]
],
[
[
[117.711549, 23.772728],
[117.708185, 23.779205],
[117.72437, 23.775942],
[117.717594, 23.769611],
[117.711549, 23.772728]
]
],
[
[
[118.154888, 24.325002],
[118.148941, 24.319328],
[118.14626, 24.339113],
[118.156351, 24.331548],
[118.154888, 24.325002]
]
],
[
[
[117.669477, 23.790503],
[117.671281, 23.803358],
[117.676741, 23.788312],
[117.669477, 23.790503]
]
]
] } }, { "type": "Feature", "properties": { "adcode": 350700, "name": "南平市", "center": [118.178459, 26.635627], "centroid": [118.147152, 27.338571], "childrenNum": 10, "level": "city", "subFeatureIndex": 6, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[117.053218, 27.101442],
[117.043663, 27.139809],
[117.048782, 27.152263],
[117.056777, 27.156951],
[117.069306, 27.175227],
[117.084418, 27.182802],
[117.097142, 27.205571],
[117.106697, 27.20363],
[117.11635, 27.207748],
[117.120494, 27.215936],
[117.140579, 27.231505],
[117.149793, 27.241394],
[117.154424, 27.260934],
[117.166173, 27.267084],
[117.171877, 27.290261],
[117.160177, 27.295747],
[117.157155, 27.301753],
[117.137167, 27.302982],
[117.142578, 27.316175],
[117.140482, 27.322795],
[117.129562, 27.322416],
[117.109476, 27.326861],
[117.100262, 27.339153],
[117.104065, 27.36671],
[117.099141, 27.379186],
[117.105625, 27.3824],
[117.10738, 27.393552],
[117.127514, 27.406687],
[117.132779, 27.422324],
[117.126149, 27.434463],
[117.125418, 27.451985],
[117.110159, 27.458833],
[117.111524, 27.474557],
[117.10465, 27.484614],
[117.110354, 27.494952],
[117.103139, 27.510766],
[117.103139, 27.533137],
[117.098849, 27.544131],
[117.091048, 27.547387],
[117.084906, 27.564089],
[117.073839, 27.559796],
[117.054875, 27.542622],
[117.050878, 27.549511],
[117.042005, 27.547293],
[117.020019, 27.557107],
[117.016801, 27.563476],
[117.024504, 27.59244],
[117.013535, 27.60673],
[117.017045, 27.611729],
[117.003395, 27.625969],
[117.009196, 27.633702],
[117.013973, 27.630213],
[117.021627, 27.643036],
[117.02036, 27.653078],
[117.040786, 27.670235],
[117.061018, 27.669057],
[117.078714, 27.650909],
[117.078714, 27.642235],
[117.094071, 27.627808],
[117.109574, 27.632004],
[117.106015, 27.642376],
[117.111865, 27.645394],
[117.102115, 27.662835],
[117.096167, 27.667501],
[117.106649, 27.686117],
[117.121518, 27.694222],
[117.13156, 27.687201],
[117.142968, 27.68885],
[117.172657, 27.678153],
[117.186259, 27.682677],
[117.202639, 27.683572],
[117.203712, 27.711373],
[117.227746, 27.719241],
[117.24398, 27.718111],
[117.254412, 27.729228],
[117.264504, 27.728898],
[117.268111, 27.740439],
[117.279763, 27.749859],
[117.277813, 27.767613],
[117.294681, 27.76394],
[117.305601, 27.775477],
[117.306088, 27.781833],
[117.297752, 27.798453],
[117.303066, 27.830225],
[117.293608, 27.843213],
[117.276643, 27.84806],
[117.280787, 27.871209],
[117.289025, 27.868527],
[117.303358, 27.87215],
[117.318081, 27.89407],
[117.327685, 27.894117],
[117.336167, 27.878265],
[117.333047, 27.862082],
[117.340701, 27.856294],
[117.353425, 27.858506],
[117.353864, 27.864904],
[117.366588, 27.882358],
[117.378434, 27.888661],
[117.389013, 27.887861],
[117.404614, 27.893224],
[117.429964, 27.913118],
[117.454047, 27.93992],
[117.462968, 27.94133],
[117.471938, 27.931551],
[117.504845, 27.954305],
[117.511427, 27.974517],
[117.521762, 27.982413],
[117.530732, 27.981708],
[117.532341, 27.973953],
[117.558081, 27.964882],
[117.563687, 27.956656],
[117.56047, 27.947254],
[117.569635, 27.935312],
[117.57919, 27.945749],
[117.586795, 27.942317],
[117.58465, 27.934936],
[117.588697, 27.918338],
[117.586162, 27.905593],
[117.595522, 27.899526],
[117.603566, 27.885933],
[117.602591, 27.869562],
[117.610049, 27.863446],
[117.649976, 27.851683],
[117.667039, 27.842272],
[117.673231, 27.828483],
[117.682542, 27.82373],
[117.70565, 27.833001],
[117.716424, 27.816246],
[117.730951, 27.803443],
[117.741969, 27.801183],
[117.754352, 27.812057],
[117.759666, 27.82693],
[117.775753, 27.836484],
[117.788136, 27.855824],
[117.78253, 27.866034],
[117.78838, 27.882922],
[117.785504, 27.892706],
[117.7993, 27.90136],
[117.815144, 27.920642],
[117.836399, 27.927789],
[117.849123, 27.936487],
[117.855997, 27.94589],
[117.866576, 27.937757],
[117.891, 27.948476],
[117.912158, 27.950074],
[117.920251, 27.963425],
[117.932487, 27.966762],
[117.942774, 27.974094],
[117.958033, 27.968971],
[117.965199, 27.962626],
[117.985674, 27.971556],
[117.998057, 27.991154],
[118.006589, 27.980392],
[118.019166, 27.981191],
[118.034328, 27.988193],
[118.042713, 27.980157],
[118.060946, 27.982695],
[118.070745, 27.977431],
[118.074206, 27.967514],
[118.089904, 27.964976],
[118.097021, 27.967608],
[118.092, 27.98152],
[118.093804, 28.001868],
[118.105894, 28.016997],
[118.123395, 28.012534],
[118.129099, 28.017185],
[118.120763, 28.0418],
[118.135242, 28.053965],
[118.153816, 28.061855],
[118.184236, 28.051335],
[118.199739, 28.05002],
[118.210416, 28.057299],
[118.225041, 28.059319],
[118.242542, 28.07552],
[118.25356, 28.068758],
[118.274913, 28.082986],
[118.291976, 28.08261],
[118.308161, 28.089418],
[118.339118, 28.088244],
[118.341994, 28.084817],
[118.356229, 28.091672],
[118.359544, 28.111905],
[118.356766, 28.123921],
[118.368417, 28.129177],
[118.361787, 28.140393],
[118.361056, 28.155878],
[118.379288, 28.166576],
[118.374657, 28.173895],
[118.374316, 28.187967],
[118.356083, 28.192752],
[118.339752, 28.193878],
[118.334145, 28.206869],
[118.319422, 28.214466],
[118.314889, 28.22286],
[118.339167, 28.235895],
[118.343457, 28.234583],
[118.350428, 28.250288],
[118.364468, 28.253804],
[118.373487, 28.265851],
[118.388454, 28.266742],
[118.424285, 28.291534],
[118.433061, 28.293127],
[118.430379, 28.279537],
[118.438618, 28.261258],
[118.448856, 28.261539],
[118.445297, 28.250851],
[118.459922, 28.244381],
[118.481031, 28.245975],
[118.490684, 28.238427],
[118.502677, 28.246819],
[118.492927, 28.262711],
[118.495608, 28.273116],
[118.505651, 28.279912],
[118.514133, 28.269648],
[118.530172, 28.270445],
[118.54626, 28.274991],
[118.547479, 28.286567],
[118.558594, 28.282302],
[118.568832, 28.285255],
[118.584481, 28.284317],
[118.597497, 28.271991],
[118.595742, 28.256992],
[118.623042, 28.256617],
[118.632988, 28.261633],
[118.640251, 28.273491],
[118.651367, 28.277147],
[118.666674, 28.269741],
[118.674816, 28.271476],
[118.68988, 28.291019],
[118.699289, 28.309949],
[118.719374, 28.312057],
[118.730148, 28.296829],
[118.72732, 28.28113],
[118.739362, 28.277381],
[118.740873, 28.267492],
[118.754523, 28.253476],
[118.78119, 28.243116],
[118.802055, 28.240443],
[118.812391, 28.22558],
[118.804152, 28.207901],
[118.794792, 28.205931],
[118.782116, 28.193221],
[118.769295, 28.185763],
[118.760958, 28.16742],
[118.775145, 28.167983],
[118.782896, 28.172675],
[118.798107, 28.168922],
[118.805907, 28.153063],
[118.800447, 28.133448],
[118.802299, 28.117303],
[118.785334, 28.106741],
[118.773585, 28.108009],
[118.765151, 28.102939],
[118.763542, 28.094723],
[118.743164, 28.088526],
[118.735754, 28.07552],
[118.718789, 28.063639],
[118.720349, 28.045417],
[118.732683, 28.035976],
[118.733512, 28.02644],
[118.726589, 28.014178],
[118.72654, 28.000411],
[118.732488, 27.990872],
[118.729904, 27.97259],
[118.7535, 27.948006],
[118.754182, 27.94274],
[118.767101, 27.9418],
[118.804542, 27.927084],
[118.803713, 27.918338],
[118.818436, 27.916692],
[118.820434, 27.895387],
[118.831501, 27.886309],
[118.826528, 27.874831],
[118.835742, 27.866504],
[118.826333, 27.846648],
[118.835401, 27.838225],
[118.838813, 27.820671],
[118.847101, 27.812528],
[118.851489, 27.796005],
[118.839399, 27.788566],
[118.840032, 27.779291],
[118.853975, 27.774253],
[118.870745, 27.736671],
[118.880642, 27.73116],
[118.890441, 27.718723],
[118.897948, 27.718911],
[118.900044, 27.705013],
[118.878497, 27.705296],
[118.875035, 27.700961],
[118.880544, 27.689322],
[118.874645, 27.682818],
[118.87991, 27.667973],
[118.894097, 27.656896],
[118.903701, 27.638888],
[118.902628, 27.623659],
[118.91389, 27.619132],
[118.908283, 27.610597],
[118.906772, 27.595458],
[118.902482, 27.591591],
[118.904042, 27.575978],
[118.910185, 27.570317],
[118.896047, 27.563146],
[118.889027, 27.547482],
[118.869185, 27.539932],
[118.85963, 27.527568],
[118.857875, 27.516713],
[118.873573, 27.517751],
[118.87991, 27.499579],
[118.890343, 27.494103],
[118.887808, 27.483575],
[118.897704, 27.478948],
[118.901458, 27.464688],
[118.91077, 27.460863],
[118.933341, 27.463602],
[118.949185, 27.456377],
[118.955425, 27.449813],
[118.966004, 27.473377],
[118.988283, 27.477248],
[118.990428, 27.488579],
[118.982775, 27.496038],
[118.990721, 27.503355],
[118.998911, 27.496321],
[119.0208, 27.497926],
[119.037181, 27.4806],
[119.055316, 27.477626],
[119.065163, 27.466766],
[119.072525, 27.472243],
[119.090075, 27.464877],
[119.115084, 27.482819],
[119.130782, 27.47281],
[119.131318, 27.463083],
[119.118887, 27.46143],
[119.125907, 27.452221],
[119.121422, 27.438336],
[119.128491, 27.431771],
[119.138777, 27.434416],
[119.147552, 27.424827],
[119.153987, 27.428559],
[119.168515, 27.424874],
[119.180264, 27.428228],
[119.194743, 27.418733],
[119.209466, 27.422135],
[119.222629, 27.41708],
[119.243445, 27.419867],
[119.247248, 27.429504],
[119.248954, 27.418639],
[119.262263, 27.42067],
[119.25963, 27.412356],
[119.266212, 27.393693],
[119.272598, 27.390528],
[119.275621, 27.380368],
[119.267821, 27.3686],
[119.252903, 27.361086],
[119.256169, 27.351632],
[119.247735, 27.346291],
[119.245834, 27.320762],
[119.232037, 27.320052],
[119.229405, 27.312818],
[119.218192, 27.312392],
[119.213707, 27.300239],
[119.210587, 27.276213],
[119.205858, 27.260887],
[119.236035, 27.235574],
[119.246029, 27.238839],
[119.255292, 27.234628],
[119.265383, 27.216882],
[119.272501, 27.213569],
[119.265627, 27.19866],
[119.255925, 27.205571],
[119.248369, 27.200127],
[119.246029, 27.2086],
[119.235158, 27.210919],
[119.23506, 27.224359],
[119.222872, 27.227577],
[119.216388, 27.224359],
[119.212732, 27.23212],
[119.205176, 27.228098],
[119.203567, 27.207511],
[119.184798, 27.204103],
[119.176803, 27.198376],
[119.180703, 27.177453],
[119.174073, 27.168836],
[119.191769, 27.168126],
[119.191769, 27.152642],
[119.186845, 27.143739],
[119.18782, 27.133794],
[119.206053, 27.126358],
[119.20542, 27.115985],
[119.196888, 27.110206],
[119.189283, 27.115985],
[119.163689, 27.110395],
[119.159496, 27.093008],
[119.127418, 27.085665],
[119.1379, 27.05799],
[119.133025, 27.052872],
[119.120593, 27.05363],
[119.120544, 27.059033],
[119.108454, 27.074861],
[119.093244, 27.084338],
[119.094999, 27.098031],
[119.063506, 27.097888],
[119.06024, 27.104568],
[119.052586, 27.099404],
[119.042982, 27.103337],
[119.008028, 27.101868],
[118.998521, 27.09713],
[118.989941, 27.108026],
[118.999789, 27.123042],
[118.989551, 27.132042],
[118.993012, 27.137393],
[118.98882, 27.157425],
[118.982336, 27.164717],
[118.975803, 27.162349],
[118.966102, 27.168268],
[118.945236, 27.170493],
[118.93963, 27.175796],
[118.930026, 27.168504],
[118.931684, 27.160881],
[118.939581, 27.162728],
[118.930806, 27.142792],
[118.932951, 27.137535],
[118.946845, 27.141229],
[118.94548, 27.1274],
[118.956352, 27.128347],
[118.958545, 27.116837],
[118.946358, 27.104568],
[118.927637, 27.114185],
[118.916132, 27.097746],
[118.902141, 27.090118],
[118.899362, 27.076235],
[118.886053, 27.056663],
[118.881324, 27.055478],
[118.873622, 27.032348],
[118.858801, 27.023625],
[118.849734, 27.025426],
[118.842226, 27.017462],
[118.847735, 27.011014],
[118.841934, 26.991999],
[118.817656, 26.976207],
[118.803518, 26.97559],
[118.79289, 26.963258],
[118.7964, 26.956712],
[118.77573, 26.944189],
[118.761446, 26.951874],
[118.751111, 26.949644],
[118.733707, 26.957851],
[118.722445, 26.946703],
[118.711818, 26.9449],
[118.698801, 26.950546],
[118.693, 26.964539],
[118.680227, 26.964065],
[118.669989, 26.946276],
[118.694755, 26.926207],
[118.699679, 26.909077],
[118.70041, 26.889523],
[118.693097, 26.883637],
[118.696169, 26.871817],
[118.691586, 26.864791],
[118.674377, 26.860186],
[118.664042, 26.863462],
[118.647077, 26.858667],
[118.649124, 26.855249],
[118.629624, 26.85202],
[118.625967, 26.83787],
[118.639471, 26.825475],
[118.642884, 26.812652],
[118.635669, 26.791799],
[118.628941, 26.783676],
[118.612756, 26.749417],
[118.614267, 26.737963],
[118.607101, 26.730548],
[118.602713, 26.70678],
[118.588624, 26.709728],
[118.57902, 26.697129],
[118.582336, 26.692803],
[118.572585, 26.682437],
[118.578533, 26.675066],
[118.598277, 26.670073],
[118.600373, 26.658183],
[118.593158, 26.632069],
[118.586577, 26.630309],
[118.584237, 26.611945],
[118.590087, 26.595338],
[118.586967, 26.577967],
[118.580824, 26.56226],
[118.587357, 26.553549],
[118.598813, 26.553787],
[118.601202, 26.549074],
[118.617729, 26.553501],
[118.62119, 26.547169],
[118.614219, 26.54079],
[118.619776, 26.533315],
[118.611537, 26.527696],
[118.614852, 26.523173],
[118.604322, 26.504743],
[118.610026, 26.487931],
[118.596034, 26.47345],
[118.582092, 26.473878],
[118.56693, 26.464779],
[118.563518, 26.451153],
[118.555864, 26.443863],
[118.56732, 26.438812],
[118.565126, 26.424181],
[118.557326, 26.41565],
[118.551037, 26.417938],
[118.547966, 26.396965],
[118.564298, 26.385953],
[118.563518, 26.366119],
[118.571659, 26.372365],
[118.582189, 26.369838],
[118.585602, 26.378516],
[118.588332, 26.362972],
[118.594767, 26.362161],
[118.596766, 26.351098],
[118.608271, 26.362686],
[118.624115, 26.365452],
[118.663164, 26.342466],
[118.659021, 26.337506],
[118.664481, 26.330304],
[118.651318, 26.31962],
[118.658679, 26.309745],
[118.657217, 26.303686],
[118.665992, 26.294621],
[118.666382, 26.275392],
[118.673012, 26.25425],
[118.668576, 26.24375],
[118.656144, 26.26308],
[118.64108, 26.263748],
[118.633719, 26.272529],
[118.631769, 26.289039],
[118.61495, 26.288466],
[118.61378, 26.299965],
[118.602665, 26.302446],
[118.589404, 26.315947],
[118.595108, 26.324342],
[118.581019, 26.325916],
[118.567905, 26.321671],
[118.561811, 26.326393],
[118.564736, 26.336266],
[118.556936, 26.343516],
[118.543481, 26.343229],
[118.539825, 26.337029],
[118.525395, 26.336075],
[118.519788, 26.345852],
[118.523591, 26.351098],
[118.504432, 26.357441],
[118.499995, 26.365452],
[118.476644, 26.353053],
[118.467869, 26.344612],
[118.453, 26.338794],
[118.450952, 26.350001],
[118.437643, 26.354103],
[118.428185, 26.369075],
[118.427503, 26.383427],
[118.436132, 26.394058],
[118.451098, 26.381949],
[118.45573, 26.389672],
[118.45261, 26.40383],
[118.442177, 26.394534],
[118.437107, 26.398014],
[118.41161, 26.397013],
[118.409953, 26.393533],
[118.386796, 26.396536],
[118.383237, 26.404211],
[118.371001, 26.40974],
[118.363201, 26.401017],
[118.349892, 26.404497],
[118.34682, 26.415793],
[118.340775, 26.408549],
[118.327369, 26.407119],
[118.32147, 26.417843],
[118.333901, 26.427089],
[118.334048, 26.438621],
[118.324639, 26.431187],
[118.309916, 26.430758],
[118.307673, 26.438097],
[118.296363, 26.430806],
[118.298703, 26.418844],
[118.287149, 26.414792],
[118.275157, 26.420655],
[118.270623, 26.428423],
[118.270623, 26.416365],
[118.25902, 26.417986],
[118.262969, 26.398443],
[118.254876, 26.393533],
[118.23991, 26.396632],
[118.244054, 26.403448],
[118.226113, 26.405117],
[118.224553, 26.411265],
[118.213779, 26.403067],
[118.216656, 26.395202],
[118.203834, 26.385763],
[118.189745, 26.381519],
[118.181165, 26.389195],
[118.169855, 26.388957],
[118.166247, 26.378325],
[118.154986, 26.380232],
[118.133584, 26.366215],
[118.134852, 26.375751],
[118.11345, 26.37966],
[118.117984, 26.38767],
[118.101458, 26.397776],
[118.090879, 26.395821],
[118.087222, 26.406165],
[118.08927, 26.41708],
[118.07718, 26.428089],
[118.068551, 26.425278],
[118.060702, 26.438097],
[118.065187, 26.454774],
[118.057241, 26.46092],
[118.058167, 26.469543],
[118.048173, 26.473974],
[118.035888, 26.464732],
[118.029794, 26.476355],
[118.030964, 26.485263],
[118.038472, 26.486978],
[118.032865, 26.497314],
[118.04047, 26.505124],
[118.039544, 26.512744],
[118.021165, 26.507506],
[118.008977, 26.508506],
[118.004882, 26.533696],
[117.993572, 26.538981],
[117.99328, 26.552739],
[118.011659, 26.571589],
[118.000007, 26.573065],
[117.988843, 26.579823],
[117.978947, 26.579585],
[117.983286, 26.569447],
[117.976899, 26.563212],
[117.970123, 26.567734],
[117.952426, 26.565973],
[117.937655, 26.574873],
[117.935071, 26.565163],
[117.924736, 26.558975],
[117.908843, 26.560165],
[117.89724, 26.568305],
[117.88476, 26.565639],
[117.878325, 26.557214],
[117.873938, 26.580966],
[117.862091, 26.582346],
[117.867502, 26.591436],
[117.856436, 26.601762],
[117.855559, 26.614752],
[117.873743, 26.629786],
[117.86214, 26.631879],
[117.855364, 26.639157],
[117.86214, 26.65747],
[117.85278, 26.656091],
[117.851561, 26.662369],
[117.858581, 26.674781],
[117.852975, 26.680677],
[117.826113, 26.668551],
[117.806613, 26.671975],
[117.793743, 26.665127],
[117.78136, 26.668551],
[117.769903, 26.654426],
[117.757277, 26.661798],
[117.743968, 26.658421],
[117.73841, 26.667172],
[117.721201, 26.658754],
[117.705309, 26.655187],
[117.696387, 26.640299],
[117.680884, 26.644057],
[117.680348, 26.637825],
[117.667527, 26.633687],
[117.662554, 26.645389],
[117.672646, 26.651239],
[117.64632, 26.65533],
[117.640421, 26.66313],
[117.641104, 26.673973],
[117.604102, 26.686621],
[117.610586, 26.692707],
[117.592792, 26.70331],
[117.602152, 26.709348],
[117.607222, 26.723181],
[117.613121, 26.727839],
[117.62487, 26.726366],
[117.629111, 26.735824],
[117.645394, 26.739626],
[117.656948, 26.761012],
[117.658459, 26.773081],
[117.672597, 26.783866],
[117.667429, 26.789709],
[117.671378, 26.804055],
[117.652268, 26.819301],
[117.642566, 26.836825],
[117.634327, 26.842571],
[117.63111, 26.858667],
[117.622627, 26.869634],
[117.614778, 26.871912],
[117.603078, 26.885109],
[117.594449, 26.885204],
[117.576509, 26.925543],
[117.563492, 26.921984],
[117.558276, 26.928627],
[117.54955, 26.929386],
[117.54487, 26.922221],
[117.530098, 26.926824],
[117.513133, 26.919089],
[117.503724, 26.928674],
[117.507673, 26.951637],
[117.525906, 26.954957],
[117.532877, 26.961171],
[117.535071, 26.983131],
[117.543115, 26.985834],
[117.542335, 26.996978],
[117.532584, 26.995556],
[117.533218, 27.002479],
[117.523273, 27.001246],
[117.512597, 27.014712],
[117.501676, 27.008311],
[117.484809, 27.009307],
[117.489148, 27.021871],
[117.483931, 27.023767],
[117.478812, 27.014048],
[117.455656, 27.002147],
[117.449659, 27.007979],
[117.450293, 27.021491],
[117.443029, 27.024004],
[117.448002, 27.02993],
[117.443371, 27.046615],
[117.425771, 27.042729],
[117.441128, 27.062066],
[117.432499, 27.064483],
[117.419434, 27.059365],
[117.411097, 27.051355],
[117.398276, 27.058085],
[117.397545, 27.069127],
[117.381798, 27.071402],
[117.380872, 27.086612],
[117.385845, 27.096657],
[117.363663, 27.101631],
[117.35206, 27.096278],
[117.329781, 27.105942],
[117.321884, 27.114374],
[117.315302, 27.113711],
[117.278544, 27.128537],
[117.270549, 27.114043],
[117.287417, 27.113474],
[117.288538, 27.095946],
[117.280055, 27.089739],
[117.285808, 27.086281],
[117.283029, 27.060123],
[117.26036, 27.046236],
[117.256265, 27.034291],
[117.24203, 27.033533],
[117.239397, 27.043203],
[117.226576, 27.050075],
[117.19713, 27.059886],
[117.18309, 27.08339],
[117.177532, 27.097036],
[117.162712, 27.105137],
[117.159056, 27.111485],
[117.145064, 27.106084],
[117.137654, 27.097841],
[117.120933, 27.091492],
[117.114449, 27.099215],
[117.09802, 27.107979],
[117.087002, 27.093435],
[117.076131, 27.105042],
[117.067794, 27.101347],
[117.066381, 27.109116],
[117.053218, 27.101442]
]
]
] } }, { "type": "Feature", "properties": { "adcode": 350800, "name": "龙岩市", "center": [117.02978, 25.091603], "centroid": [116.743578, 25.291456], "childrenNum": 7, "level": "city", "subFeatureIndex": 7, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[116.903797, 24.370626],
[116.885271, 24.396219],
[116.873279, 24.391178],
[116.869427, 24.40722],
[116.863528, 24.409789],
[116.855485, 24.423842],
[116.848221, 24.426895],
[116.838909, 24.442544],
[116.841493, 24.453397],
[116.851731, 24.452767],
[116.86075, 24.462262],
[116.849342, 24.479069],
[116.833595, 24.496117],
[116.81351, 24.483671],
[116.816825, 24.490403],
[116.796837, 24.502074],
[116.788111, 24.511613],
[116.779385, 24.527688],
[116.781091, 24.533789],
[116.772316, 24.534757],
[116.758373, 24.546618],
[116.756082, 24.55504],
[116.767782, 24.564189],
[116.761201, 24.582967],
[116.781627, 24.603049],
[116.787526, 24.61471],
[116.798885, 24.623999],
[116.798544, 24.637157],
[116.81195, 24.644897],
[116.815314, 24.654571],
[116.801225, 24.678268],
[116.777581, 24.679574],
[116.753839, 24.654522],
[116.741895, 24.666565],
[116.707282, 24.665114],
[116.700457, 24.655683],
[116.690122, 24.659504],
[116.667063, 24.658633],
[116.635131, 24.647702],
[116.632791, 24.641269],
[116.624113, 24.641414],
[116.596472, 24.654039],
[116.58638, 24.636722],
[116.572974, 24.630143],
[116.570439, 24.621725],
[116.553278, 24.613065],
[116.525929, 24.604791],
[116.50677, 24.62129],
[116.51769, 24.650411],
[116.504966, 24.667049],
[116.501505, 24.698335],
[116.486977, 24.718592],
[116.469719, 24.719317],
[116.455923, 24.713709],
[116.446075, 24.714483],
[116.437398, 24.733577],
[116.417166, 24.743051],
[116.415362, 24.756438],
[116.419116, 24.767311],
[116.407172, 24.777797],
[116.399665, 24.793983],
[116.384406, 24.790939],
[116.375972, 24.803355],
[116.377239, 24.821083],
[116.4178, 24.841079],
[116.407318, 24.853296],
[116.393912, 24.856918],
[116.394789, 24.877873],
[116.379238, 24.877535],
[116.374558, 24.868458],
[116.361785, 24.869859],
[116.349792, 24.856773],
[116.349159, 24.836732],
[116.344089, 24.827555],
[116.33273, 24.821856],
[116.332291, 24.826638],
[116.318153, 24.818185],
[116.299969, 24.80292],
[116.29134, 24.800263],
[116.264917, 24.799877],
[116.251267, 24.793403],
[116.233083, 24.80065],
[116.233717, 24.806205],
[116.250048, 24.827893],
[116.238933, 24.830405],
[116.229329, 24.82601],
[116.221139, 24.830791],
[116.220505, 24.842624],
[116.210901, 24.854455],
[116.200908, 24.85798],
[116.191742, 24.877101],
[116.181066, 24.875121],
[116.153229, 24.846632],
[116.13953, 24.844701],
[116.116032, 24.851413],
[116.094875, 24.84924],
[116.091316, 24.838374],
[116.083223, 24.85349],
[116.06889, 24.849964],
[116.062797, 24.859912],
[116.052266, 24.861505],
[116.04315, 24.871162],
[116.038324, 24.886901],
[116.023357, 24.902156],
[116.015264, 24.905728],
[116.003077, 24.896508],
[115.985575, 24.899694],
[115.976703, 24.91596],
[115.96276, 24.913209],
[115.955301, 24.918518],
[115.908451, 24.923296],
[115.897288, 24.937147],
[115.892559, 24.937099],
[115.884271, 24.950899],
[115.870231, 24.959488],
[115.872278, 24.97208],
[115.882955, 24.976663],
[115.892266, 24.970054],
[115.894996, 24.962045],
[115.904405, 24.964361],
[115.917227, 24.958089],
[115.925075, 24.96079],
[115.917129, 24.974251],
[115.899238, 24.991761],
[115.88198, 24.995041],
[115.876958, 25.003193],
[115.873643, 25.019928],
[115.88822, 25.022918],
[115.897873, 25.037046],
[115.912303, 25.042929],
[115.918348, 25.038685],
[115.928293, 25.050498],
[115.92098, 25.061201],
[115.913863, 25.06067],
[115.919372, 25.072433],
[115.908305, 25.084531],
[115.880078, 25.092243],
[115.883832, 25.103183],
[115.874033, 25.1147],
[115.873936, 25.121831],
[115.888366, 25.129011],
[115.884954, 25.141489],
[115.875837, 25.152328],
[115.867403, 25.149053],
[115.855118, 25.153195],
[115.853363, 25.163889],
[115.860432, 25.16596],
[115.853412, 25.17646],
[115.857507, 25.178146],
[115.855606, 25.209447],
[115.870523, 25.221243],
[115.878762, 25.21431],
[115.890804, 25.217825],
[115.901724, 25.231353],
[115.91825, 25.230438],
[115.930926, 25.236023],
[115.939506, 25.253977],
[115.949402, 25.266202],
[115.94716, 25.288146],
[115.951547, 25.29315],
[115.965636, 25.286895],
[115.974704, 25.289878],
[115.977629, 25.298443],
[115.986355, 25.290793],
[116.000054, 25.301522],
[116.008001, 25.32144],
[116.000834, 25.324855],
[116.005758, 25.330868],
[116.000152, 25.343277],
[115.991669, 25.345105],
[116.000005, 25.357705],
[115.992742, 25.371074],
[115.996008, 25.379585],
[116.008001, 25.392855],
[116.002297, 25.40819],
[116.005368, 25.414247],
[116.015167, 25.414439],
[116.021797, 25.420688],
[116.02209, 25.437942],
[116.012193, 25.455242],
[116.019213, 25.474221],
[116.007269, 25.473741],
[116.005466, 25.490459],
[116.013119, 25.498193],
[116.015752, 25.508184],
[116.036569, 25.514764],
[116.035301, 25.540552],
[116.040274, 25.547995],
[116.054168, 25.546938],
[116.062845, 25.56331],
[116.054411, 25.578192],
[116.052023, 25.598592],
[116.040956, 25.606942],
[116.046904, 25.616972],
[116.041639, 25.626329],
[116.05095, 25.627577],
[116.059628, 25.63914],
[116.067135, 25.634342],
[116.068939, 25.646337],
[116.05758, 25.660153],
[116.065234, 25.676126],
[116.056215, 25.682409],
[116.060164, 25.694926],
[116.067672, 25.691329],
[116.067623, 25.704085],
[116.082589, 25.696221],
[116.106965, 25.701112],
[116.110085, 25.707585],
[116.108476, 25.723312],
[116.118226, 25.732805],
[116.116764, 25.738941],
[116.129634, 25.759169],
[116.145965, 25.759601],
[116.166538, 25.766023],
[116.165953, 25.74848],
[116.17546, 25.749487],
[116.17702, 25.768467],
[116.181602, 25.776423],
[116.176288, 25.78524],
[116.160103, 25.798753],
[116.159274, 25.809581],
[116.131779, 25.824288],
[116.129244, 25.838706],
[116.130706, 25.858726],
[116.153473, 25.876779],
[116.169805, 25.877018],
[116.177653, 25.89435],
[116.191937, 25.901005],
[116.207196, 25.901388],
[116.225137, 25.90852],
[116.232206, 25.90043],
[116.258287, 25.902967],
[116.268232, 25.914217],
[116.280664, 25.914408],
[116.302407, 25.922593],
[116.304162, 25.929485],
[116.32025, 25.940828],
[116.326295, 25.956572],
[116.34833, 25.961691],
[116.369975, 25.963318],
[116.368025, 25.974897],
[116.359933, 25.991497],
[116.361054, 26.000729],
[116.371048, 26.005464],
[116.383284, 26.029424],
[116.40025, 26.033298],
[116.412437, 26.021964],
[116.42911, 26.022155],
[116.44081, 26.014121],
[116.455923, 26.014456],
[116.463967, 26.021247],
[116.481615, 26.007855],
[116.477178, 26.000824],
[116.482687, 25.991592],
[116.480201, 25.973701],
[116.484978, 25.968198],
[116.49663, 25.972313],
[116.506478, 25.9848],
[116.510573, 25.983412],
[116.52939, 25.999055],
[116.538409, 26.001685],
[116.541968, 25.992358],
[116.554887, 25.994176],
[116.566782, 25.990827],
[116.572242, 25.982695],
[116.568099, 25.976954],
[116.575655, 25.971643],
[116.581213, 25.978198],
[116.587355, 25.97461],
[116.588476, 25.984178],
[116.595594, 25.980685],
[116.621578, 25.983317],
[116.622163, 25.990588],
[116.630695, 25.994367],
[116.627721, 26.010295],
[116.645612, 26.009051],
[116.642639, 26.001207],
[116.653071, 25.999294],
[116.652486, 25.986378],
[116.644394, 25.981738],
[116.646831, 25.969873],
[116.653802, 25.965615],
[116.650829, 25.953078],
[116.654485, 25.93743],
[116.664771, 25.942359],
[116.67379, 25.941067],
[116.680225, 25.928193],
[116.698556, 25.926135],
[116.705576, 25.916562],
[116.713717, 25.913307],
[116.716935, 25.902393],
[116.727611, 25.903446],
[116.739848, 25.895643],
[116.752084, 25.897127],
[116.74287, 25.87855],
[116.741944, 25.865095],
[116.746332, 25.852883],
[116.762858, 25.841197],
[116.770512, 25.858199],
[116.790207, 25.85772],
[116.790305, 25.845843],
[116.784308, 25.837509],
[116.777045, 25.816623],
[116.784991, 25.806323],
[116.807075, 25.791182],
[116.808489, 25.784665],
[116.827697, 25.778531],
[116.851194, 25.788115],
[116.871816, 25.800094],
[116.873961, 25.811593],
[116.88649, 25.820551],
[116.890439, 25.838898],
[116.910768, 25.845795],
[116.917593, 25.853649],
[116.936606, 25.851542],
[116.946307, 25.846705],
[116.95167, 25.835545],
[116.955424, 25.843927],
[116.971999, 25.841676],
[116.974632, 25.847998],
[116.992084, 25.850919],
[116.998032, 25.85523],
[116.992426, 25.86203],
[117.004321, 25.86361],
[117.018459, 25.856523],
[117.025722, 25.839664],
[117.026844, 25.819545],
[117.038885, 25.815713],
[117.039763, 25.804023],
[117.050829, 25.798705],
[117.066819, 25.778196],
[117.058532, 25.775752],
[117.057215, 25.764729],
[117.064967, 25.757444],
[117.056972, 25.753609],
[117.065893, 25.732421],
[117.046539, 25.723648],
[117.059897, 25.713052],
[117.069306, 25.711086],
[117.069111, 25.69224],
[117.059409, 25.687924],
[117.070866, 25.680442],
[117.079641, 25.667156],
[117.070768, 25.669267],
[117.078861, 25.660632],
[117.08008, 25.651998],
[117.091975, 25.653677],
[117.097776, 25.662071],
[117.110841, 25.663559],
[117.109964, 25.65526],
[117.117715, 25.659241],
[117.120445, 25.648256],
[117.138044, 25.630072],
[117.145357, 25.615916],
[117.15579, 25.618604],
[117.161835, 25.608478],
[117.159738, 25.59864],
[117.166027, 25.593456],
[117.163785, 25.57488],
[117.167246, 25.569551],
[117.182407, 25.57608],
[117.197081, 25.558894],
[117.212487, 25.570079],
[117.198398, 25.570175],
[117.20766, 25.581936],
[117.208392, 25.58928],
[117.225844, 25.593936],
[117.224187, 25.606414],
[117.239007, 25.611741],
[117.236423, 25.623594],
[117.246174, 25.633622],
[117.239641, 25.638948],
[117.246905, 25.65075],
[117.255095, 25.647632],
[117.28142, 25.666437],
[117.294583, 25.669794],
[117.280494, 25.682217],
[117.267868, 25.679243],
[117.242468, 25.690706],
[117.260214, 25.70327],
[117.260994, 25.715113],
[117.270256, 25.719716],
[117.270013, 25.732517],
[117.279324, 25.732853],
[117.288343, 25.742057],
[117.317593, 25.740523],
[117.320421, 25.748289],
[117.334851, 25.754041],
[117.344065, 25.751692],
[117.341043, 25.773403],
[117.345771, 25.784905],
[117.353718, 25.788355],
[117.363712, 25.783611],
[117.374973, 25.784905],
[117.379117, 25.780065],
[117.377362, 25.765496],
[117.383797, 25.752938],
[117.376046, 25.747713],
[117.382968, 25.738989],
[117.379994, 25.728586],
[117.392865, 25.720819],
[117.396326, 25.738941],
[117.401347, 25.704948],
[117.399251, 25.689842],
[117.403102, 25.680298],
[117.397691, 25.676701],
[117.404029, 25.669219],
[117.390281, 25.65881],
[117.403151, 25.654972],
[117.416753, 25.662071],
[117.43713, 25.66423],
[117.446929, 25.674543],
[117.443127, 25.679243],
[117.450732, 25.68754],
[117.449903, 25.697132],
[117.461213, 25.703126],
[117.459605, 25.712332],
[117.47345, 25.720052],
[117.474474, 25.728826],
[117.460287, 25.730743],
[117.479787, 25.73966],
[117.495729, 25.732182],
[117.504114, 25.732421],
[117.493876, 25.724127],
[117.499239, 25.71425],
[117.496948, 25.706962],
[117.503529, 25.699769],
[117.519178, 25.717703],
[117.53863, 25.725374],
[117.547843, 25.710894],
[117.54682, 25.702407],
[117.557789, 25.70068],
[117.567978, 25.693535],
[117.580897, 25.695166],
[117.584358, 25.685862],
[117.595034, 25.674063],
[117.586893, 25.669411],
[117.594693, 25.65051],
[117.614096, 25.650702],
[117.627795, 25.664278],
[117.640568, 25.668019],
[117.649343, 25.675598],
[117.664407, 25.6614],
[117.66036, 25.640819],
[117.666162, 25.641011],
[117.680397, 25.630648],
[117.685808, 25.631655],
[117.699068, 25.622394],
[117.707649, 25.611261],
[117.712914, 25.59096],
[117.717496, 25.594224],
[117.750354, 25.589808],
[117.743675, 25.575024],
[117.744065, 25.566479],
[117.730708, 25.556205],
[117.725589, 25.546554],
[117.707795, 25.560622],
[117.696582, 25.556973],
[117.687368, 25.526482],
[117.682834, 25.518798],
[117.689708, 25.511258],
[117.701604, 25.517693],
[117.71657, 25.51217],
[117.713694, 25.497136],
[117.716716, 25.484646],
[117.70604, 25.472588],
[117.706089, 25.459663],
[117.69512, 25.455338],
[117.690245, 25.439384],
[117.698386, 25.426696],
[117.691805, 25.410546],
[117.683224, 25.403095],
[117.691853, 25.38997],
[117.688636, 25.382037],
[117.693365, 25.370882],
[117.689611, 25.358812],
[117.680348, 25.358956],
[117.684492, 25.34977],
[117.660117, 25.33688],
[117.653828, 25.318553],
[117.622822, 25.30287],
[117.610732, 25.300079],
[117.600056, 25.292381],
[117.607953, 25.279436],
[117.602542, 25.258887],
[117.614925, 25.254892],
[117.624041, 25.238526],
[117.61434, 25.221725],
[117.604736, 25.224661],
[117.603224, 25.218884],
[117.595619, 25.22702],
[117.580458, 25.231786],
[117.565296, 25.22158],
[117.559739, 25.212336],
[117.543651, 25.210699],
[117.547843, 25.191341],
[117.532341, 25.199817],
[117.529221, 25.180554],
[117.520592, 25.173956],
[117.50855, 25.176845],
[117.49373, 25.172655],
[117.495778, 25.164708],
[117.482517, 25.165334],
[117.489391, 25.15729],
[117.48359, 25.147222],
[117.487051, 25.138936],
[117.475351, 25.128963],
[117.476277, 25.121639],
[117.486515, 25.119181],
[117.506162, 25.107327],
[117.510793, 25.092677],
[117.511573, 25.073927],
[117.507234, 25.071661],
[117.511817, 25.050112],
[117.502846, 25.032031],
[117.490269, 25.025763],
[117.496996, 25.018336],
[117.490123, 25.004688],
[117.491634, 24.957847],
[117.483931, 24.954325],
[117.469598, 24.959729],
[117.457703, 24.956496],
[117.436155, 24.964361],
[117.430695, 24.975505],
[117.400616, 24.98332],
[117.391158, 24.97922],
[117.383358, 24.985684],
[117.368051, 24.973961],
[117.356692, 24.972176],
[117.342505, 24.981921],
[117.335826, 24.974395],
[117.309988, 24.966242],
[117.303651, 24.974781],
[117.284638, 24.97454],
[117.294144, 24.985394],
[117.290147, 24.991183],
[117.259239, 24.97372],
[117.255095, 24.96494],
[117.24398, 24.962913],
[117.239105, 24.968269],
[117.231548, 24.956641],
[117.253584, 24.955001],
[117.251829, 24.943034],
[117.2393, 24.934493],
[117.237983, 24.924503],
[117.227941, 24.914175],
[117.228574, 24.908576],
[117.218581, 24.908624],
[117.211902, 24.920352],
[117.183821, 24.924744],
[117.189086, 24.903507],
[117.196691, 24.90259],
[117.197033, 24.883184],
[117.174607, 24.8701],
[117.16632, 24.870148],
[117.168757, 24.84586],
[117.174071, 24.835718],
[117.168757, 24.824609],
[117.155302, 24.816687],
[117.151694, 24.80036],
[117.141652, 24.79205],
[117.149598, 24.790069],
[117.133949, 24.774656],
[117.119909, 24.773593],
[117.104552, 24.788668],
[117.077642, 24.780019],
[117.070671, 24.790939],
[117.075643, 24.798089],
[117.071792, 24.812437],
[117.073693, 24.822725],
[117.064041, 24.834897],
[117.05195, 24.822097],
[117.049025, 24.811567],
[117.053413, 24.801036],
[117.048148, 24.792002],
[117.034156, 24.787025],
[117.031816, 24.774704],
[117.01451, 24.766586],
[117.019141, 24.752813],
[117.025966, 24.744742],
[117.018946, 24.740199],
[117.016801, 24.70931],
[117.028257, 24.700656],
[117.026551, 24.693935],
[117.039665, 24.692436],
[117.040445, 24.68291],
[117.033474, 24.672175],
[117.046978, 24.652975],
[117.038739, 24.626273],
[117.027087, 24.634835],
[117.017825, 24.631304],
[117.017045, 24.624628],
[117.02855, 24.608759],
[117.027331, 24.599178],
[117.015972, 24.591],
[117.022895, 24.576337],
[117.018068, 24.553153],
[117.011048, 24.55141],
[116.999494, 24.538533],
[116.989306, 24.547537],
[116.96376, 24.545504],
[116.95479, 24.549377],
[116.943382, 24.54623],
[116.931633, 24.533305],
[116.937337, 24.521733],
[116.928903, 24.513405],
[116.922078, 24.528027],
[116.912718, 24.524057],
[116.918958, 24.508611],
[116.919153, 24.49263],
[116.928952, 24.483574],
[116.928123, 24.477277],
[116.93997, 24.458968],
[116.949769, 24.43048],
[116.947721, 24.42171],
[116.937045, 24.412406],
[116.928367, 24.396898],
[116.930073, 24.384829],
[116.912084, 24.378867],
[116.901895, 24.38638],
[116.903797, 24.370626]
]
]
] } }, { "type": "Feature", "properties": { "adcode": 350900, "name": "宁德市", "center": [119.527082, 26.65924], "centroid": [119.489266, 26.97159], "childrenNum": 9, "level": "city", "subFeatureIndex": 8, "acroutes": [100000, 350000], "parent": { "adcode": 350000 } }, "geometry": { "type": "MultiPolygon", "coordinates": [
[
[
[118.666382, 26.275392],
[118.665992, 26.294621],
[118.657217, 26.303686],
[118.658679, 26.309745],
[118.651318, 26.31962],
[118.664481, 26.330304],
[118.659021, 26.337506],
[118.663164, 26.342466],
[118.624115, 26.365452],
[118.608271, 26.362686],
[118.596766, 26.351098],
[118.594767, 26.362161],
[118.588332, 26.362972],
[118.585602, 26.378516],
[118.582189, 26.369838],
[118.571659, 26.372365],
[118.563518, 26.366119],
[118.564298, 26.385953],
[118.547966, 26.396965],
[118.551037, 26.417938],
[118.557326, 26.41565],
[118.565126, 26.424181],
[118.56732, 26.438812],
[118.555864, 26.443863],
[118.563518, 26.451153],
[118.56693, 26.464779],
[118.582092, 26.473878],
[118.596034, 26.47345],
[118.610026, 26.487931],
[118.604322, 26.504743],
[118.614852, 26.523173],
[118.611537, 26.527696],
[118.619776, 26.533315],
[118.614219, 26.54079],
[118.62119, 26.547169],
[118.617729, 26.553501],
[118.601202, 26.549074],
[118.598813, 26.553787],
[118.587357, 26.553549],
[118.580824, 26.56226],
[118.586967, 26.577967],
[118.590087, 26.595338],
[118.584237, 26.611945],
[118.586577, 26.630309],
[118.593158, 26.632069],
[118.600373, 26.658183],
[118.598277, 26.670073],
[118.578533, 26.675066],
[118.572585, 26.682437],
[118.582336, 26.692803],
[118.57902, 26.697129],
[118.588624, 26.709728],
[118.602713, 26.70678],
[118.607101, 26.730548],
[118.614267, 26.737963],
[118.612756, 26.749417],
[118.628941, 26.783676],
[118.635669, 26.791799],
[118.642884, 26.812652],
[118.639471, 26.825475],
[118.625967, 26.83787],
[118.629624, 26.85202],
[118.649124, 26.855249],
[118.647077, 26.858667],
[118.664042, 26.863462],
[118.674377, 26.860186],
[118.691586, 26.864791],
[118.696169, 26.871817],
[118.693097, 26.883637],
[118.70041, 26.889523],
[118.699679, 26.909077],
[118.694755, 26.926207],
[118.669989, 26.946276],
[118.680227, 26.964065],
[118.693, 26.964539],
[118.698801, 26.950546],
[118.711818, 26.9449],
[118.722445, 26.946703],
[118.733707, 26.957851],
[118.751111, 26.949644],
[118.761446, 26.951874],
[118.77573, 26.944189],
[118.7964, 26.956712],
[118.79289, 26.963258],
[118.803518, 26.97559],
[118.817656, 26.976207],
[118.841934, 26.991999],
[118.847735, 27.011014],
[118.842226, 27.017462],
[118.849734, 27.025426],
[118.858801, 27.023625],
[118.873622, 27.032348],
[118.881324, 27.055478],
[118.886053, 27.056663],
[118.899362, 27.076235],
[118.902141, 27.090118],
[118.916132, 27.097746],
[118.927637, 27.114185],
[118.946358, 27.104568],
[118.958545, 27.116837],
[118.956352, 27.128347],
[118.94548, 27.1274],
[118.946845, 27.141229],
[118.932951, 27.137535],
[118.930806, 27.142792],
[118.939581, 27.162728],
[118.931684, 27.160881],
[118.930026, 27.168504],
[118.93963, 27.175796],
[118.945236, 27.170493],
[118.966102, 27.168268],
[118.975803, 27.162349],
[118.982336, 27.164717],
[118.98882, 27.157425],
[118.993012, 27.137393],
[118.989551, 27.132042],
[118.999789, 27.123042],
[118.989941, 27.108026],
[118.998521, 27.09713],
[119.008028, 27.101868],
[119.042982, 27.103337],
[119.052586, 27.099404],
[119.06024, 27.104568],
[119.063506, 27.097888],
[119.094999, 27.098031],
[119.093244, 27.084338],
[119.108454, 27.074861],
[119.120544, 27.059033],
[119.120593, 27.05363],
[119.133025, 27.052872],
[119.1379, 27.05799],
[119.127418, 27.085665],
[119.159496, 27.093008],
[119.163689, 27.110395],
[119.189283, 27.115985],
[119.196888, 27.110206],
[119.20542, 27.115985],
[119.206053, 27.126358],
[119.18782, 27.133794],
[119.186845, 27.143739],
[119.191769, 27.152642],
[119.191769, 27.168126],
[119.174073, 27.168836],
[119.180703, 27.177453],
[119.176803, 27.198376],
[119.184798, 27.204103],
[119.203567, 27.207511],
[119.205176, 27.228098],
[119.212732, 27.23212],
[119.216388, 27.224359],
[119.222872, 27.227577],
[119.23506, 27.224359],
[119.235158, 27.210919],
[119.246029, 27.2086],
[119.248369, 27.200127],
[119.255925, 27.205571],
[119.265627, 27.19866],
[119.272501, 27.213569],
[119.265383, 27.216882],
[119.255292, 27.234628],
[119.246029, 27.238839],
[119.236035, 27.235574],
[119.205858, 27.260887],
[119.210587, 27.276213],
[119.213707, 27.300239],
[119.218192, 27.312392],
[119.229405, 27.312818],
[119.232037, 27.320052],
[119.245834, 27.320762],
[119.247735, 27.346291],
[119.256169, 27.351632],
[119.252903, 27.361086],
[119.267821, 27.3686],
[119.275621, 27.380368],
[119.272598, 27.390528],
[119.266212, 27.393693],
[119.25963, 27.412356],
[119.262263, 27.42067],
[119.267869, 27.421473],
[119.276449, 27.435502],
[119.28503, 27.457652],
[119.334707, 27.480034],
[119.347674, 27.492781],
[119.341873, 27.506801],
[119.360057, 27.524406],
[119.376827, 27.534977],
[119.394963, 27.539271],
[119.416657, 27.539649],
[119.426894, 27.53106],
[119.432842, 27.513031],
[119.438497, 27.508783],
[119.451709, 27.513551],
[119.466529, 27.526435],
[119.47467, 27.539318],
[119.477498, 27.553851],
[119.48481, 27.570411],
[119.481837, 27.585648],
[119.48871, 27.598807],
[119.500947, 27.608239],
[119.497973, 27.625875],
[119.501191, 27.649872],
[119.511477, 27.653455],
[119.520447, 27.650108],
[119.525907, 27.66029],
[119.537071, 27.658923],
[119.541898, 27.663919],
[119.539168, 27.675372],
[119.549308, 27.670141],
[119.550136, 27.663825],
[119.566517, 27.663731],
[119.578948, 27.669858],
[119.58397, 27.665145],
[119.594987, 27.666889],
[119.606249, 27.67476],
[119.635158, 27.66868],
[119.644031, 27.663495],
[119.639643, 27.652653],
[119.647541, 27.640538],
[119.641105, 27.625403],
[119.62648, 27.620499],
[119.630868, 27.582676],
[119.645444, 27.578195],
[119.675085, 27.574374],
[119.672013, 27.556399],
[119.668845, 27.556494],
[119.659338, 27.539696],
[119.667187, 27.533561],
[119.682592, 27.536959],
[119.68464, 27.541159],
[119.708577, 27.514259],
[119.703019, 27.499295],
[119.70999, 27.495849],
[119.706724, 27.483339],
[119.709942, 27.462469],
[119.703994, 27.45855],
[119.703409, 27.44731],
[119.693903, 27.438667],
[119.685469, 27.438431],
[119.689515, 27.430826],
[119.704677, 27.424686],
[119.709552, 27.404702],
[119.724908, 27.401253],
[119.732513, 27.389819],
[119.739582, 27.386795],
[119.741435, 27.375453],
[119.750454, 27.373232],
[119.740508, 27.36222],
[119.747431, 27.359951],
[119.750649, 27.350403],
[119.76854, 27.346527],
[119.768394, 27.335749],
[119.781459, 27.330501],
[119.784969, 27.323598],
[119.769759, 27.323267],
[119.770588, 27.305678],
[119.790478, 27.302604],
[119.795743, 27.310454],
[119.808954, 27.305016],
[119.819533, 27.29603],
[119.822312, 27.301422],
[119.840155, 27.298915],
[119.844835, 27.306623],
[119.834841, 27.312534],
[119.8462, 27.324071],
[119.856779, 27.314804],
[119.871307, 27.315419],
[119.865603, 27.306198],
[119.887638, 27.313338],
[119.899046, 27.311494],
[119.903287, 27.317594],
[119.933513, 27.316553],
[119.944043, 27.314142],
[119.938875, 27.323788],
[119.951307, 27.346764],
[119.960179, 27.351869],
[119.964031, 27.360471],
[119.960277, 27.366096],
[119.988357, 27.371389],
[119.994208, 27.379186],
[120.005225, 27.376682],
[120.009613, 27.363921],
[120.01595, 27.364772],
[120.026627, 27.350781],
[120.027553, 27.342273],
[120.05227, 27.33868],
[120.061142, 27.347425],
[120.077035, 27.369215],
[120.096877, 27.379612],
[120.096243, 27.390339],
[120.107163, 27.395583],
[120.121593, 27.397426],
[120.128857, 27.391614],
[120.137194, 27.40234],
[120.130515, 27.413395],
[120.134512, 27.41982],
[120.165615, 27.424827],
[120.176877, 27.419962],
[120.202373, 27.42837],
[120.213196, 27.420292],
[120.22163, 27.420292],
[120.246932, 27.434558],
[120.248979, 27.439895],
[120.262434, 27.432905],
[120.263799, 27.418025],
[120.258193, 27.412687],
[120.273355, 27.389393],
[120.28954, 27.395914],
[120.302703, 27.392229],
[120.31528, 27.393268],
[120.315573, 27.4056],
[120.319814, 27.399694],
[120.331758, 27.396056],
[120.340728, 27.399647],
[120.3516, 27.383581],
[120.343263, 27.366237],
[120.355256, 27.353901],
[120.351453, 27.346764],
[120.358327, 27.337545],
[120.374805, 27.329272],
[120.383434, 27.312676],
[120.401374, 27.298584],
[120.408784, 27.276639],
[120.43004, 27.258852],
[120.422386, 27.25081],
[120.415366, 27.256392],
[120.401764, 27.250857],
[120.398547, 27.242483],
[120.413952, 27.230937],
[120.400935, 27.211534],
[120.404397, 27.204009],
[120.425701, 27.183323],
[120.42614, 27.173476],
[120.438376, 27.161023],
[120.445299, 27.160881],
[120.461679, 27.142555],
[120.426042, 27.111816],
[120.403276, 27.100636],
[120.401862, 27.089266],
[120.392063, 27.081258],
[120.359254, 27.085665],
[120.326834, 27.08737],
[120.319863, 27.094382],
[120.306603, 27.087986],
[120.287541, 27.093909],
[120.282764, 27.089787],
[120.290807, 27.074387],
[120.28681, 27.062493],
[120.299778, 27.039553],
[120.295682, 27.035713],
[120.263897, 27.035239],
[120.256536, 27.031874],
[120.274427, 27.027939],
[120.2794, 27.009828],
[120.278571, 26.985787],
[120.261313, 26.982657],
[120.250929, 26.973172],
[120.243617, 26.939492],
[120.248735, 26.938211],
[120.247224, 26.924831],
[120.237523, 26.917856],
[120.231916, 26.907226],
[120.226115, 26.91311],
[120.20837, 26.915958],
[120.19004, 26.914629],
[120.180582, 26.920418],
[120.156158, 26.917856],
[120.146895, 26.922648],
[120.138412, 26.915293],
[120.126761, 26.920418],
[120.118717, 26.9189],
[120.117888, 26.90585],
[120.121691, 26.895551],
[120.118181, 26.882878],
[120.103702, 26.872957],
[120.08347, 26.871533],
[120.063141, 26.862085],
[120.048467, 26.863984],
[120.037888, 26.860234],
[120.036864, 26.845705],
[120.042958, 26.828277],
[120.050612, 26.824336],
[120.082593, 26.822294],
[120.102434, 26.826805],
[120.104774, 26.823671],
[120.094244, 26.814647],
[120.102337, 26.795695],
[120.121788, 26.798165],
[120.128516, 26.794317],
[120.136511, 26.797785],
[120.137047, 26.788189],
[120.124128, 26.781015],
[120.106822, 26.752838],
[120.114281, 26.743429],
[120.126468, 26.741242],
[120.148455, 26.749987],
[120.158546, 26.746708],
[120.150454, 26.734493],
[120.165762, 26.731499],
[120.159912, 26.715908],
[120.150308, 26.709538],
[120.127931, 26.705354],
[120.110624, 26.692803],
[120.115451, 26.663843],
[120.120765, 26.658849],
[120.130954, 26.661893],
[120.127833, 26.648576],
[120.144555, 26.649432],
[120.138071, 26.638016],
[120.103799, 26.620509],
[120.093903, 26.613705],
[120.079229, 26.616274],
[120.068065, 26.627455],
[120.059972, 26.625932],
[120.031209, 26.608186],
[120.007711, 26.595623],
[119.983872, 26.593482],
[119.967736, 26.59767],
[119.946919, 26.589722],
[119.937998, 26.576539],
[119.947651, 26.560641],
[119.939022, 26.555881],
[119.93361, 26.545122],
[119.911819, 26.53998],
[119.902166, 26.530506],
[119.893683, 26.51403],
[119.884664, 26.510077],
[119.867017, 26.508887],
[119.839131, 26.51422],
[119.828552, 26.52422],
[119.83021, 26.541075],
[119.836547, 26.549502],
[119.834987, 26.561165],
[119.844445, 26.568924],
[119.845761, 26.589009],
[119.851953, 26.595385],
[119.892367, 26.61675],
[119.901922, 26.624553],
[119.918498, 26.621317],
[119.940338, 26.623078],
[119.946432, 26.61204],
[119.949211, 26.624457],
[119.961154, 26.637492],
[119.957986, 26.648671],
[119.970173, 26.652904],
[119.971246, 26.66779],
[119.977047, 26.677301],
[119.970563, 26.691566],
[119.989186, 26.710298],
[119.993964, 26.720566],
[120.019558, 26.728409],
[120.020582, 26.739104],
[120.032428, 26.747706],
[120.041155, 26.748656],
[120.059485, 26.766191],
[120.063092, 26.774363],
[120.056365, 26.785956],
[120.028967, 26.78206],
[119.995621, 26.781395],
[119.979582, 26.774934],
[119.967443, 26.777879],
[119.968906, 26.786098],
[119.958961, 26.78282],
[119.943068, 26.784768],
[119.932294, 26.780112],
[119.924689, 26.770182],
[119.938339, 26.749274],
[119.938242, 26.74205],
[119.929759, 26.725462],
[119.913135, 26.713056],
[119.905042, 26.69751],
[119.899192, 26.693183],
[119.904701, 26.676588],
[119.901142, 26.671547],
[119.908211, 26.661417],
[119.873939, 26.642915],
[119.86141, 26.645436],
[119.858339, 26.659895],
[119.862434, 26.673877],
[119.852489, 26.682104],
[119.830454, 26.690948],
[119.810417, 26.684196],
[119.787553, 26.690996],
[119.741532, 26.684386],
[119.711063, 26.686621],
[119.695073, 26.696701],
[119.664847, 26.725938],
[119.657534, 26.744284],
[119.653391, 26.744664],
[119.656852, 26.728124],
[119.664311, 26.72185],
[119.657681, 26.7006],
[119.637742, 26.703025],
[119.633208, 26.698793],
[119.640959, 26.685195],
[119.634573, 26.676017],
[119.628235, 26.67635],
[119.619509, 26.649099],
[119.591867, 26.63264],
[119.584116, 26.633829],
[119.577924, 26.622269],
[119.607955, 26.594053],
[119.620679, 26.592149],
[119.636328, 26.601809],
[119.660996, 26.609994],
[119.670161, 26.617987],
[119.679034, 26.617654],
[119.689613, 26.610993],
[119.699265, 26.610184],
[119.727931, 26.614133],
[119.74007, 26.610707],
[119.752599, 26.596194],
[119.769515, 26.591769],
[119.788382, 26.58325],
[119.793257, 26.573969],
[119.790429, 26.566068],
[119.783945, 26.566258],
[119.765225, 26.577301],
[119.74124, 26.573922],
[119.745822, 26.571018],
[119.729442, 26.559309],
[119.703311, 26.569876],
[119.682934, 26.560451],
[119.678254, 26.540742],
[119.671136, 26.53341],
[119.66163, 26.534648],
[119.66124, 26.526649],
[119.650027, 26.524173],
[119.638327, 26.528172],
[119.623653, 26.520935],
[119.611124, 26.52703],
[119.60737, 26.535124],
[119.588552, 26.536743],
[119.581483, 26.542694],
[119.573732, 26.540361],
[119.564762, 26.54755],
[119.556035, 26.545217],
[119.555353, 26.555881],
[119.533902, 26.56107],
[119.524396, 26.573446],
[119.532001, 26.577586],
[119.528052, 26.586772],
[119.515182, 26.598716],
[119.508991, 26.598954],
[119.508162, 26.614561],
[119.500947, 26.621222],
[119.472866, 26.631451],
[119.468918, 26.627788],
[119.445225, 26.631213],
[119.440301, 26.626694],
[119.421971, 26.625647],
[119.408662, 26.635209],
[119.401495, 26.627883],
[119.415097, 26.622935],
[119.407833, 26.616227],
[119.394914, 26.622126],
[119.381069, 26.621888],
[119.379509, 26.610565],
[119.372001, 26.600144],
[119.351623, 26.602809],
[119.344896, 26.599145],
[119.348503, 26.590389],
[119.333927, 26.581537],
[119.322568, 26.579205],
[119.31467, 26.593292],
[119.294877, 26.586534],
[119.28737, 26.577396],
[119.282397, 26.56245],
[119.281276, 26.535648],
[119.254073, 26.549692],
[119.241593, 26.527839],
[119.22531, 26.523982],
[119.213805, 26.539219],
[119.218387, 26.544837],
[119.211708, 26.548455],
[119.205078, 26.564592],
[119.193183, 26.571304],
[119.1847, 26.561355],
[119.184895, 26.553596],
[119.167101, 26.549216],
[119.162665, 26.541075],
[119.149892, 26.543646],
[119.142775, 26.538266],
[119.126102, 26.542504],
[119.115669, 26.538981],
[119.1125, 26.551359],
[119.10158, 26.559499],
[119.099484, 26.575825],
[119.096851, 26.567258],
[119.0813, 26.571113],
[119.071257, 26.566734],
[119.060873, 26.573922],
[119.068089, 26.584821],
[119.078082, 26.586962],
[119.071842, 26.596718],
[119.06024, 26.604665],
[119.050928, 26.595338],
[119.026797, 26.59786],
[119.023677, 26.587057],
[119.01534, 26.58996],
[119.009344, 26.574778],
[119.015096, 26.571351],
[119.00754, 26.56464],
[119.006858, 26.555643],
[118.994182, 26.558023],
[119.002226, 26.532791],
[118.995937, 26.527173],
[118.98492, 26.534172],
[118.963372, 26.532743],
[118.947577, 26.519459],
[118.950989, 26.513411],
[118.941483, 26.505553],
[118.937729, 26.494599],
[118.950502, 26.492217],
[118.954158, 26.483929],
[118.947382, 26.465684],
[118.937534, 26.46516],
[118.926711, 26.476737],
[118.90297, 26.479309],
[118.890636, 26.470925],
[118.872403, 26.466828],
[118.870404, 26.457156],
[118.8608, 26.453345],
[118.853146, 26.436],
[118.821263, 26.425659],
[118.819996, 26.43357],
[118.819459, 26.433999],
[118.819801, 26.426755],
[118.806882, 26.438859],
[118.805809, 26.446198],
[118.813268, 26.44615],
[118.794743, 26.461587],
[118.804054, 26.466065],
[118.807613, 26.475165],
[118.803225, 26.488455],
[118.787869, 26.494408],
[118.785285, 26.504362],
[118.775437, 26.508839],
[118.748527, 26.511077],
[118.746479, 26.503172],
[118.756473, 26.490598],
[118.736388, 26.472354],
[118.733463, 26.455679],
[118.736632, 26.445245],
[118.730928, 26.438907],
[118.753695, 26.424277],
[118.76325, 26.421751],
[118.752281, 26.396727],
[118.765882, 26.393915],
[118.769929, 26.384618],
[118.784261, 26.369171],
[118.789819, 26.37022],
[118.800885, 26.360016],
[118.792695, 26.342228],
[118.774657, 26.327967],
[118.753597, 26.334025],
[118.752086, 26.339557],
[118.720154, 26.34032],
[118.70782, 26.322291],
[118.69144, 26.311892],
[118.69105, 26.297293],
[118.684127, 26.287369],
[118.666382, 26.275392]
]
],
[
[
[120.714891, 26.973836],
[120.710991, 26.984696],
[120.714598, 26.991004],
[120.725567, 26.990529],
[120.714891, 26.973836]
]
],
[
[
[120.708212, 27.004708],
[120.706359, 26.998022],
[120.695049, 26.993327],
[120.693099, 27.005514],
[120.708212, 27.004708]
]
],
[
[
[120.258291, 26.924783],
[120.267846, 26.925543],
[120.265164, 26.916764],
[120.247663, 26.914059],
[120.25049, 26.934368],
[120.257901, 26.930287],
[120.269845, 26.935459],
[120.258291, 26.924783]
]
],
[
[
[120.326103, 26.930525],
[120.318157, 26.930667],
[120.314598, 26.922696],
[120.293635, 26.923977],
[120.283934, 26.930098],
[120.308894, 26.939112],
[120.321667, 26.936076],
[120.326103, 26.930525]
]
],
[
[
[119.807589, 26.673497],
[119.797596, 26.683721],
[119.809491, 26.682342],
[119.827285, 26.674448],
[119.813391, 26.665317],
[119.807589, 26.673497]
]
],
[
[
[120.350868, 26.640679],
[120.355451, 26.647291],
[120.369052, 26.634828],
[120.350868, 26.640679]
]
],
[
[
[119.943653, 26.684101],
[119.939168, 26.670644],
[119.946724, 26.659753],
[119.934049, 26.666554],
[119.926785, 26.664604],
[119.925566, 26.675019],
[119.91684, 26.674686],
[119.904067, 26.684054],
[119.908114, 26.690996],
[119.950819, 26.69247],
[119.943653, 26.684101]
]
],
[
[
[119.816608, 26.571113],
[119.814025, 26.560403],
[119.801203, 26.566829],
[119.816608, 26.571113]
]
],
[
[
[120.350137, 26.694276],
[120.344238, 26.700172],
[120.359254, 26.708872],
[120.372026, 26.699316],
[120.350137, 26.694276]
]
],
[
[
[120.071331, 26.514839],
[120.066066, 26.497504],
[120.048126, 26.494599],
[120.043982, 26.489264],
[120.031551, 26.489169],
[120.026432, 26.497504],
[120.032818, 26.500886],
[120.036133, 26.515935],
[120.049198, 26.52022],
[120.057486, 26.516268],
[120.067577, 26.524744],
[120.071331, 26.514839]
]
],
[
[
[120.150064, 26.555643],
[120.157035, 26.562355],
[120.164738, 26.554786],
[120.148358, 26.551597],
[120.150064, 26.555643]
]
],
[
[
[120.13266, 26.53041],
[120.140119, 26.536124],
[120.137974, 26.54198],
[120.14709, 26.544408],
[120.153623, 26.533077],
[120.146993, 26.527982],
[120.13266, 26.53041]
]
],
[
[
[120.137389, 26.684244],
[120.124713, 26.688856],
[120.125055, 26.696511],
[120.140021, 26.691852],
[120.137389, 26.684244]
]
],
[
[
[120.392648, 26.956428],
[120.37656, 26.953392],
[120.373733, 26.958278],
[120.383678, 26.960223],
[120.392648, 26.956428]
]
],
[
[
[119.814171, 26.612658],
[119.81149, 26.608804],
[119.797791, 26.611421],
[119.792135, 26.605473],
[119.77361, 26.603332],
[119.763031, 26.6079],
[119.760301, 26.620889],
[119.798863, 26.631213],
[119.818753, 26.621032],
[119.814171, 26.612658]
]
],
[
[
[120.002983, 26.544313],
[120.011027, 26.546408],
[120.006736, 26.536219],
[119.997669, 26.533743],
[120.002983, 26.544313]
]
],
[
[
[120.141532, 26.798877],
[120.160009, 26.804102],
[120.156206, 26.794507],
[120.142751, 26.793747],
[120.141532, 26.798877]
]
],
[
[
[119.805639, 26.598098],
[119.797547, 26.596623],
[119.801301, 26.60614],
[119.805639, 26.598098]
]
],
[
[
[120.415561, 27.095993],
[120.403324, 27.094856],
[120.413172, 27.103242],
[120.425165, 27.104474],
[120.415561, 27.095993]
]
],
[
[
[120.153281, 26.570019],
[120.150405, 26.560213],
[120.135926, 26.550978],
[120.12642, 26.554691],
[120.117937, 26.569114],
[120.13461, 26.581394],
[120.136804, 26.588057],
[120.150844, 26.602571],
[120.162934, 26.605569],
[120.171075, 26.598907],
[120.16698, 26.571494],
[120.153281, 26.570019]
]
],
[
[
[120.219582, 26.872245],
[120.214756, 26.878273],
[120.224653, 26.887102],
[120.228943, 26.87647],
[120.219582, 26.872245]
]
],
[
[
[120.133684, 26.48955],
[120.143921, 26.497933],
[120.146115, 26.489883],
[120.134902, 26.483263],
[120.133684, 26.48955]
]
],
[
[
[119.73734, 26.64615],
[119.720667, 26.636065],
[119.694488, 26.630071],
[119.668211, 26.628454],
[119.658607, 26.634353],
[119.651928, 26.648909],
[119.656852, 26.669883],
[119.666163, 26.679536],
[119.673963, 26.68082],
[119.691709, 26.671024],
[119.712867, 26.668504],
[119.748991, 26.681105],
[119.762836, 26.674971],
[119.75879, 26.659515],
[119.73734, 26.64615]
]
],
[
[
[120.373148, 26.923075],
[120.354866, 26.917429],
[120.343117, 26.922221],
[120.322349, 26.940203],
[120.320935, 26.956143],
[120.339022, 26.970373],
[120.354232, 26.970942],
[120.370515, 26.961883],
[120.380509, 26.940251],
[120.394403, 26.933893],
[120.395622, 26.926444],
[120.380168, 26.927393],
[120.373148, 26.923075]
]
],
[
[
[118.821263, 26.425659],
[118.819801, 26.426755],
[118.819459, 26.433999],
[118.819996, 26.43357],
[118.821263, 26.425659]
]
],
[
[
[119.791453, 26.688476],
[119.788674, 26.680392],
[119.778046, 26.676065],
[119.777803, 26.685147],
[119.791453, 26.688476]
]
]
] } }] };
if (typeof module === "object" && typeof module.exports === "object") {
module.exports = FujianGeoJSON;
} else {
window.FujianGeoJSON = FujianGeoJSON;
} | 47.558094 | 382 | 0.338525 |
b8060e0df5cdcdd36bc8376ef010c97f7be0b271 | 208 | js | JavaScript | src/index.js | hsanoyan/graphql-passport | 754445ade335931308ca9c96021ef0d12484127b | [
"MIT"
] | null | null | null | src/index.js | hsanoyan/graphql-passport | 754445ade335931308ca9c96021ef0d12484127b | [
"MIT"
] | null | null | null | src/index.js | hsanoyan/graphql-passport | 754445ade335931308ca9c96021ef0d12484127b | [
"MIT"
] | null | null | null | export { default as buildContext } from './buildContext';
export { default as createOnConnect } from './createSubscriptionOnConnect';
export { default as GraphQLLocalStrategy } from './GraphQLLocalStrategy';
| 52 | 75 | 0.783654 |
b806eec71414dccca01e3bf0b4623a0b4005aef9 | 2,621 | js | JavaScript | packages/nodejs/libs/districts/provinces/60.js | ltv/vn-address | 4c8060b890fdbce3be6f23f4c7f44011ff864f4e | [
"MIT"
] | 1 | 2021-09-15T15:08:05.000Z | 2021-09-15T15:08:05.000Z | packages/nodejs/libs/districts/provinces/60.js | ltv/vn-address | 4c8060b890fdbce3be6f23f4c7f44011ff864f4e | [
"MIT"
] | 1 | 2021-07-10T09:37:37.000Z | 2021-07-10T09:37:37.000Z | packages/nodejs/libs/districts/provinces/60.js | ltv/vn-address | 4c8060b890fdbce3be6f23f4c7f44011ff864f4e | [
"MIT"
] | null | null | null |
module.exports = [
{
"name": "Phan Thiết",
"type": "thanh-pho",
"slug": "phan-thiet",
"name_with_type": "Thành phố Phan Thiết",
"path": "Phan Thiết, Bình Thuận",
"path_with_type": "Thành phố Phan Thiết, Tỉnh Bình Thuận",
"code": "593",
"parent_code": "60"
},
{
"name": "La Gi",
"type": "thi-xa",
"slug": "la-gi",
"name_with_type": "Thị xã La Gi",
"path": "La Gi, Bình Thuận",
"path_with_type": "Thị xã La Gi, Tỉnh Bình Thuận",
"code": "594",
"parent_code": "60"
},
{
"name": "Tuy Phong",
"type": "huyen",
"slug": "tuy-phong",
"name_with_type": "Huyện Tuy Phong",
"path": "Tuy Phong, Bình Thuận",
"path_with_type": "Huyện Tuy Phong, Tỉnh Bình Thuận",
"code": "595",
"parent_code": "60"
},
{
"name": "Bắc Bình",
"type": "huyen",
"slug": "bac-binh",
"name_with_type": "Huyện Bắc Bình",
"path": "Bắc Bình, Bình Thuận",
"path_with_type": "Huyện Bắc Bình, Tỉnh Bình Thuận",
"code": "596",
"parent_code": "60"
},
{
"name": "Hàm Thuận Bắc",
"type": "huyen",
"slug": "ham-thuan-bac",
"name_with_type": "Huyện Hàm Thuận Bắc",
"path": "Hàm Thuận Bắc, Bình Thuận",
"path_with_type": "Huyện Hàm Thuận Bắc, Tỉnh Bình Thuận",
"code": "597",
"parent_code": "60"
},
{
"name": "Hàm Thuận Nam",
"type": "huyen",
"slug": "ham-thuan-nam",
"name_with_type": "Huyện Hàm Thuận Nam",
"path": "Hàm Thuận Nam, Bình Thuận",
"path_with_type": "Huyện Hàm Thuận Nam, Tỉnh Bình Thuận",
"code": "598",
"parent_code": "60"
},
{
"name": "Tánh Linh",
"type": "huyen",
"slug": "tanh-linh",
"name_with_type": "Huyện Tánh Linh",
"path": "Tánh Linh, Bình Thuận",
"path_with_type": "Huyện Tánh Linh, Tỉnh Bình Thuận",
"code": "599",
"parent_code": "60"
},
{
"name": "Đức Linh",
"type": "huyen",
"slug": "duc-linh",
"name_with_type": "Huyện Đức Linh",
"path": "Đức Linh, Bình Thuận",
"path_with_type": "Huyện Đức Linh, Tỉnh Bình Thuận",
"code": "600",
"parent_code": "60"
},
{
"name": "Hàm Tân",
"type": "huyen",
"slug": "ham-tan",
"name_with_type": "Huyện Hàm Tân",
"path": "Hàm Tân, Bình Thuận",
"path_with_type": "Huyện Hàm Tân, Tỉnh Bình Thuận",
"code": "601",
"parent_code": "60"
},
{
"name": "Phú Quí",
"type": "huyen",
"slug": "phu-qui",
"name_with_type": "Huyện Phú Quí",
"path": "Phú Quí, Bình Thuận",
"path_with_type": "Huyện Phú Quí, Tỉnh Bình Thuận",
"code": "602",
"parent_code": "60"
}
]
| 25.201923 | 62 | 0.540633 |
b8078f9b0b24c608c1a5b6e73b3105b1ef873de1 | 226 | js | JavaScript | tests/average.js | scf4/1-liners | 31ca0637b97501573e4d3a98784514a35c69c9a7 | [
"MIT"
] | 833 | 2015-05-20T18:35:25.000Z | 2022-03-07T02:42:53.000Z | tests/average.js | CloakOut/1-liners | d8f6443eb55adfe138a54e54052fd32ab0e5e59e | [
"MIT"
] | 124 | 2015-05-19T15:06:32.000Z | 2021-12-30T19:07:57.000Z | tests/average.js | CloakOut/1-liners | d8f6443eb55adfe138a54e54052fd32ab0e5e59e | [
"MIT"
] | 91 | 2015-06-17T10:27:18.000Z | 2021-10-06T19:04:09.000Z | import { equal, ok } from 'assert';
import average from '../average';
const {isNaN} = Number;
test('#average', () => {
equal(average([2, 3, 4]), 3);
equal(average([{valueOf: () => 10}]), 10);
ok(isNaN(average([])));
});
| 18.833333 | 43 | 0.561947 |
b808fe888a80091a8845bb4f096134f69c24498f | 100 | js | JavaScript | request/config.js | Xiosn/YougoMall | d72773413a9d21d4d0a8cbf7f6d259f60353377c | [
"MIT"
] | null | null | null | request/config.js | Xiosn/YougoMall | d72773413a9d21d4d0a8cbf7f6d259f60353377c | [
"MIT"
] | null | null | null | request/config.js | Xiosn/YougoMall | d72773413a9d21d4d0a8cbf7f6d259f60353377c | [
"MIT"
] | null | null | null | export const baseURL = 'https://api-hmugo-web.itheima.net/api/public/v1'
export const timeout = 5000 | 50 | 72 | 0.77 |
b80a45b8b400a23d797d7e740604f8b27fdddde6 | 262 | js | JavaScript | __tests__/title-case.test.js | fabianlee1211/js-algorithms | 231decd203d5fab86d0cd01f81ec9542c79f3648 | [
"Unlicense"
] | null | null | null | __tests__/title-case.test.js | fabianlee1211/js-algorithms | 231decd203d5fab86d0cd01f81ec9542c79f3648 | [
"Unlicense"
] | null | null | null | __tests__/title-case.test.js | fabianlee1211/js-algorithms | 231decd203d5fab86d0cd01f81ec9542c79f3648 | [
"Unlicense"
] | null | null | null | const titleCase = require('../src/title-case');
describe('Title Case', () => {
it('should return title-cased words correctly', () => {
const result = titleCase('this is a testing string');
expect(result).toEqual('This Is A Testing String');
});
});
| 29.111111 | 57 | 0.637405 |
b80aba98d5d75f1be354dfdc969bb474083403b8 | 964 | js | JavaScript | jobs/frontend/config/tasks/gulp_fonts.js | frontend-labs/demos.frontendlabs | ad63360aa206c54f400290e947c3d079de3e39aa | [
"MIT"
] | 2 | 2016-01-27T21:56:16.000Z | 2019-05-27T19:22:14.000Z | jobs/frontend/config/tasks/gulp_fonts.js | frontend-labs/demos.frontendlabs | ad63360aa206c54f400290e947c3d079de3e39aa | [
"MIT"
] | 1 | 2020-04-29T23:08:24.000Z | 2020-04-29T23:08:24.000Z | jobs/frontend/config/tasks/gulp_fonts.js | frontend-labs/demos.frontendlabs | ad63360aa206c54f400290e947c3d079de3e39aa | [
"MIT"
] | null | null | null | /**
* Tarea Tarea para generar css de las fuentes
*
* @module Task (gulp fonts)
* @extends Gulp
* @extends Path
* @extends Plugins
* @extends Fs
* @author Victor Sandoval
*/
var fs = require('fs');
function Task(gulp, path, config, plugins, functions){
/**
* Tarea para generar archivo .styl de las fuentes
* (gulp fonts:compile)
*/
gulp.task('fonts:compile', function(cb){
var dirList = []
plugins.fs.readdirSync(path.frontend.fonts + "/").forEach(function(file){
if(/^[^_]*$/g.test(file)){
dirList.push(file)
}
});
return gulp.src(path.frontend.fonts + '/_template/fonts.styl')
.pipe(plugins.consolidate('lodash', { dirList: dirList }))
.pipe(gulp.dest(path.frontend.pre_css + '/layout'));
});
/**
* Tarea principal
* (gulp fonts)
*/
gulp.task('fonts', function(cb){
plugins.runSequence('fonts:compile', 'css', 'copy:fonts', cb)
});
}
module.exports = Task; | 22.952381 | 77 | 0.609959 |
b80ac6ca657f7e9f27e45b319d27ecfb36743368 | 3,655 | js | JavaScript | daassets_repo/interactivetool/questions/M11_008.js | nguni52/pearson | 9438f0755785ddf955869294cc3c299ffa07393d | [
"Apache-2.0"
] | null | null | null | daassets_repo/interactivetool/questions/M11_008.js | nguni52/pearson | 9438f0755785ddf955869294cc3c299ffa07393d | [
"Apache-2.0"
] | null | null | null | daassets_repo/interactivetool/questions/M11_008.js | nguni52/pearson | 9438f0755785ddf955869294cc3c299ffa07393d | [
"Apache-2.0"
] | null | null | null | // JavaScript Document
var quiz = {
multiList:
[
{
ques: "<strong>Question 1</strong><br/>Study Figure 1 and choose the option that best describes the landscape in the image.",
ans: "A represents a ridge and B represents a spur.",
ansSel: ["A represents a cliff and B represents a spur.", "A represents the watershed and B represents a valley.", "A represents a dip slope and B represents a scarp slope.", "A represents a spur and B represents a valley."]
},
{
ques: "<strong>Question 2</strong><br/>Study Figure 1 and choose the option that best describes the elevation of this landscape. The contour interval is 20 m.",
ans: "The altitude of the highest point along the ridge at A is approximately 188 m.",
ansSel: ["Point B on the contour sketch is 60 m higher than point C.", "The range of altitude on the contour sketch is approximately 80 m.", "The altitude of the highest point along the valley at A is approximately 188 m.", "Point D on the contour map is a poort or gap."]
},
{
ques: "<strong>Question 3</strong><br/>Study Figure 2 and then choose the best option from those offered below.",
ans: "River B has a greater velocity than River A.",
ansSel: ["River A is a tributary of River B.", "River A is flowing NW.", "River A has a greater velocity than River B.", "River B is flowing down a terraced slope."]
},
{
ques: "<strong>Question 4</strong><br/>Study Figure 3 and then state which of the options below is true.",
ans: "River C is flowing in a gorge.",
ansSel: ["The green dashed line represents a conical hill.", "The rivers in this landscape are flowing northwards.", "Gradient in River B is greatest close to the source.", "The green dashed line represents a terraced slope."]
},
{
ques: "<strong>Question 5</strong><br/>The contour interval in Figure 4 is 50 m. Study Figure 4 and select the statement that is NOT true.",
ans: "From bottom to top, the cliff face is 200 m high.",
ansSel: ["B represents a cliff.", "A represents the crest.", "The talus slope is seen in the landscape sketch but not in the contour sketch.", "The crest is 200 m above the base of the cliff."]
},
{
ques: "<strong>Question 6</strong><br/>Feature B in Figure 5 represents …",
ans: "a depression.",
ansSel: ["a flat-topped hill.", "a koppie.", "a homoclinal hill.", "a cuesta."]
},
{
ques: "<strong>Question 7</strong><br/>Assume the contour interval in Figure 5 is 20 m. Which of the following statements is true?",
ans: "Point E is at sea level.",
ansSel: ["The altitude at Point A is more than 140 m.","The altitude at Point A is more than 140 m.", "Point D is lower than Point F.", "Point G is lower than Point F.", "Point B and Point A have similar altitudes."]
},
{
ques: "<strong>Question 8</strong><br/>The slope indicated by the green dashed line on Figure 5 is a …",
ans: "uniform slope.",
ansSel: ["steep slope.", "convex slope.", "valley slope.", "scarp slope."]
},
{
ques: "<strong>Question 9</strong><br/>Point C on Figure 5 represents the …",
ans: "scree.",
ansSel: ["crest.", "cliff.", "pediment.", "scarp."]
},
{
ques: "<strong>Question 10</strong><br/>The slope indicated by the purple dashed line on Figure 5 is a …",
ans: "concave slope.",
ansSel: ["convex slope.", "terraced slope.", "dip slope.", "gentle slope."]
}
]
}; | 59.918033 | 307 | 0.657729 |
b80bca91a61f8d32567182292b4c0515389c2bee | 5,807 | js | JavaScript | js/script.js | jorritvanderheide/dbm180 | f9710f963edcc2679fc61d09e8a741703508f86b | [
"BSD-3-Clause"
] | null | null | null | js/script.js | jorritvanderheide/dbm180 | f9710f963edcc2679fc61d09e8a741703508f86b | [
"BSD-3-Clause"
] | null | null | null | js/script.js | jorritvanderheide/dbm180 | f9710f963edcc2679fc61d09e8a741703508f86b | [
"BSD-3-Clause"
] | null | null | null | //============================================================================//
// Script //
//============================================================================//
// Load random house image
(function () {
var urls = ["img/house1", "img/house2", "img/house3", "img/house4", "img/house5", "img/house6", "img/house7", "img/house8"];
function swap() {
var randomUrl = Math.round(Math.random() * (urls.length - 1));
document.getElementById("header").setAttribute("src", urls[randomUrl] + ".webp");
if (randomUrl == 0) {
$("header").css("background-color", "#fdf4de");
$(".headertext").css("color", "#333");
$(".wrapper").css("background-color", "#fdf4de");
$(".wrapper").css("color", "#333");
$("button").css("color", "#333");
$("button").css("border", "#333 solid 3px");
$(".razvan").css("color", "#333");
$(".razvan").children("a").css("color", "#333");
} else if (randomUrl == 1) {
$("header").css("background-color", "#e8dab2");
$(".headertext").css("color", "#333");
$(".wrapper").css("background-color", "#e8dab2");
$(".wrapper").css("color", "#333");
$("button").css("color", "#333");
$("button").css("border", "#333 solid 3px");
$(".razvan").css("color", "#333");
$(".razvan").children("a").css("color", "#333");
} else if (randomUrl == 2) {
$("header").css("background-color", "#01b5ff");
$(".headertext").css("color", "#eee");
$(".wrapper").css("background-color", "#01b5ff");
$(".wrapper").css("color", "#eee");
$("button").css("color", "#eee");
$("button").css("border", "#eee solid 3px");
$(".razvan").css("color", "#eee");
$(".razvan").children("a").css("color", "#eee");
} else if (randomUrl == 3) {
$("header").css("background-color", "#ffe1a8");
$(".headertext").css("color", "#333");
$(".wrapper").css("background-color", "#ffe1a8");
$(".wrapper").css("color", "#333");
$("button").css("color", "#333");
$("button").css("border", "#333 solid 3px");
$(".razvan").css("color", "#333");
$(".razvan").children("a").css("color", "#333");
} else if (randomUrl == 4) {
$("header").css("background-color", "#ff7c58");
$(".headertext").css("color", "#eee");
$(".wrapper").css("background-color", "#ff7c58");
$(".wrapper").css("color", "#eee");
$("button").css("color", "#eee");
$("button").css("border", "#eee solid 3px");
$(".razvan").css("color", "#eee");
$(".razvan").children("a").css("color", "#eee");
} else if (randomUrl == 5) {
$("header").css("background-color", "#fff3f5");
$(".headertext").css("color", "#333");
$(".wrapper").css("background-color", "#fff3f5");
$(".wrapper").css("color", "#333");
$("button").css("color", "#333");
$("button").css("border", "#333 solid 3px");
$(".razvan").css("color", "#333");
$(".razvan").children("a").css("color", "#333");
} else if (randomUrl == 6) {
$("header").css("background-color", "#e07a5f");
$(".headertext").css("color", "#eee");
$(".wrapper").css("background-color", "#e07a5f");
$(".wrapper").css("color", "#eee");
$("button").css("color", "#eee");
$("button").css("border", "#eee solid 3px");
$(".razvan").css("color", "#eee");
$(".razvan").children("a").css("color", "#eee");
} else if (randomUrl == 7) {
$("header").css("background-color", "#fef7ef");
$(".headertext").css("color", "#333");
$(".wrapper").css("background-color", "#fef7ef");
$(".wrapper").css("color", "#333");
$("button").css("color", "#333");
$("button").css("border", "#333 solid 3px");
$(".razvan").css("color", "#333");
$(".razvan").children("a").css("color", "#333");
}
$("body").show();
}
// Mozilla, Opera and webkit nightlies currently support this event
if (document.addEventListener) {
window.addEventListener("load", swap, false);
// If IE event model is used
} else if (document.attachEvent) {
window.attachEvent("onload", swap);
}
})();
// Set font size
$(window)
.on("resize", function () {
// Set font size variables
minWidth = 0;
maxWidth = 424;
minFontSize = 1.1;
maxFontSize = 1.1;
if (window.matchMedia("(min-width: 425px)").matches) {
minWidth = 425;
maxWidth = 767;
minFontSize = 1.1;
maxFontSize = 1.2;
}
if (window.matchMedia("(min-width: 768px)").matches) {
minWidth = 768;
maxWidth = 1023;
minFontSize = 1.2;
maxFontSize = 1.3;
}
if (window.matchMedia("(min-width: 1023px)").matches) {
minWidth = 1024;
maxWidth = 1919;
minFontSize = 1.3;
maxFontSize = 1.4;
}
if (window.matchMedia("(min-width: 1920px)").matches) {
minWidth = 1920;
maxWidth = 2560;
minFontSize = 1.4;
maxFontSize = 1.75;
}
// Calc and set font size clamp
fontSize = clampBuilder(minWidth, maxWidth, minFontSize, maxFontSize);
$("body").css("font-size", fontSize);
})
.resize();
// Takes the viewport widths in pixels and the font sizes in rem
function clampBuilder(minWidthPx, maxWidthPx, minFontSize, maxFontSize) {
const root = document.querySelector("html");
const pixelsPerRem = Number(getComputedStyle(root).fontSize.slice(0, -2));
const minWidth = minWidthPx / pixelsPerRem;
const maxWidth = maxWidthPx / pixelsPerRem;
const slope = (maxFontSize - minFontSize) / (maxWidth - minWidth);
const yAxisIntersection = -minWidth * slope + minFontSize;
return `clamp( ${minFontSize}rem, ${yAxisIntersection}rem + ${slope * 100}vw, ${maxFontSize}rem )`;
}
| 38.713333 | 126 | 0.522301 |
b80e3f44a9afff1bdf54ac25ecfd93026849e35f | 5,909 | js | JavaScript | app/sequelize_routes/competence.js | guinardpaul/MERN-MP-Comp-tences | 3767b646aa7e0c2ecb6c9f278d5984652ca184d1 | [
"MIT"
] | null | null | null | app/sequelize_routes/competence.js | guinardpaul/MERN-MP-Comp-tences | 3767b646aa7e0c2ecb6c9f278d5984652ca184d1 | [
"MIT"
] | 7 | 2017-11-28T09:52:32.000Z | 2018-03-02T08:37:18.000Z | app/sequelize_routes/competence.js | guinardpaul/MERN-MP-Competences | 3767b646aa7e0c2ecb6c9f278d5984652ca184d1 | [
"MIT"
] | null | null | null | const Competences = require('../sequelize_models/models').Competences;
module.exports = router => {
/**
* Get All competences
*/
router.get('/competences', (req, res, next) => {
Competences.findAll({
attributes: ['id', 'ref', 'description', 'cycle_id', 'domaine_id']
})
.then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
});
/**
* Get All competences par Cycle
*/
router.get('/competences/cycle/:cycle_id', (req, res, next) => {
if (!req.params.cycle_id) {
res.status(400).json({
success: false,
message: 'cycle_id not provided'
});
} else {
Competences.findAll({
attributes: ['id', 'ref', 'description', 'cycle_id', 'domaine_id'],
where: {
cycle_id: req.params.cycle_id
}
})
.then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
}
});
/**
* Get One competence par ref CT
*/
router.get('/competences/ref/:ref', (req, res, next) => {
if (!req.params.ref) {
res.status(400).json({
success: false,
message: 'ref not provided'
});
} else {
Competences.findOne({
where: {
ref: req.params.ref
}
})
.then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
}
});
/**
* Get All competences par Domaine
*/
router.get('/competences/domaine/:domaine_id', (req, res, next) => {
if (!req.params.domaine_id) {
res.status(400).json({
success: false,
message: 'domaine_id not provided'
});
} else {
Competences.findAll({
attributes: ['id', 'ref', 'description', 'cycle_id', 'domaine_id'],
where: {
domaine_id: req.params.domaine_id
}
})
.then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
}
});
/**
* Get All competences par Domaine et cycle
*/
router.get('/competences/cycle/:cycle_id/domaine/:domaine_id', (req, res, next) => {
if (!req.params.domaine_id) {
res.status(400).json({
success: false,
message: 'domaine_id not provided'
});
} else if (!req.params.cycle_id) {
res.status(400).json({
success: false,
message: 'cycle_id not provided'
});
} else {
Competences.findAll({
attributes: ['id', 'ref', 'description', 'cycle_id', 'domaine_id'],
where: {
domaine_id: req.params.domaine_id,
cycle_id: req.params.cycle_id
}
}).then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
}
});
/**
* Check unicité ref CT
*/
router.get('/competences/cycle/:cycle_id/ref/:ref', (req, res, next) => {
if (!req.params.cycle_id) {
res.status(400).json({
success: false,
message: 'cycle_id not provided'
});
} else if (!req.params.ref) {
res.status(400).json({
success: false,
message: 'ref not provided'
});
} else {
Competences.findOne({
where: {
cycle_id: req.params.cycle_id,
ref: req.params.ref
}
})
.then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
}
});
/**
* Create Competence
*/
router.post('/competences/', (req, res, next) => {
if (!req.body) {
res.status(400).json({
success: false,
message: 'body not provided'
});
} else {
Competences.create(req.body).then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
}
});
/**
* Update Competence
*/
router.put('/competences/:id', (req, res, next) => {
if (!req.params.id) {
return res.status(400).json({
success: false,
message: 'id not provided'
});
} else if (!req.body) {
return res.status(400).json({
success: false,
message: 'body not provided'
});
} else {
Competences.update(req.body, {
where: {
id: req.params.id
}
})
.then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
}
});
/**
* Delete Competence
*/
router.delete('/competences/:id', (req, res, next) => {
if (!req.params.id) {
return res.status(400).json({
success: false,
message: 'id not provided'
});
} else {
Competences.destroy({
where: {
id: req.params.id
}
})
.then(result => {
console.log('result: ', result);
res.status(200).json(result);
}).catch(err => {
console.log('err: ', err);
res.status(400).json(err);
});
}
});
return router;
}; | 25.144681 | 86 | 0.489084 |
b810865673c6ecf8cb69fdb31afd41cc0620cffb | 240 | js | JavaScript | kibana-6.2.4-windows-x86_64/ui_framework/src/components/form/label/index.js | ranjithkumarravikumar52/Master-thesis | 71ee58f210c6cdff34fa521b61acaab717f2b827 | [
"Apache-2.0"
] | 2 | 2018-10-19T22:55:25.000Z | 2018-10-19T22:55:27.000Z | ui_framework/src/components/form/label/index.js | dashjuvi/kibana | b0c50e791058f727dc15adde0588998e67c36ccb | [
"Apache-2.0"
] | 2 | 2020-07-17T10:03:57.000Z | 2021-05-09T15:42:13.000Z | ui_framework/src/components/form/label/index.js | dashjuvi/kibana | b0c50e791058f727dc15adde0588998e67c36ccb | [
"Apache-2.0"
] | 1 | 2018-08-26T15:45:59.000Z | 2018-08-26T15:45:59.000Z | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _label = require('./label');
Object.defineProperty(exports, 'KuiLabel', {
enumerable: true,
get: function get() {
return _label.KuiLabel;
}
});
| 16 | 46 | 0.6625 |
b810bb0d4cac248b8e0dd8597f002de0d45849ac | 755 | js | JavaScript | src/es6/core/generic.js | CptKicks/pandas-js | a3e020dff50072af036490ea1359756cf0d245ca | [
"MIT"
] | 438 | 2017-03-13T21:50:51.000Z | 2022-03-14T15:54:40.000Z | src/es6/core/generic.js | FalseProtagonist/pandas-js | b4b3e02578c014f509c5e8e659d272c78d38671d | [
"MIT"
] | 26 | 2016-12-16T05:00:55.000Z | 2017-02-09T19:49:31.000Z | src/es6/core/generic.js | FalseProtagonist/pandas-js | b4b3e02578c014f509c5e8e659d272c78d38671d | [
"MIT"
] | 48 | 2017-08-20T11:59:45.000Z | 2022-03-18T20:29:34.000Z |
import Immutable from 'immutable';
export default class NDFrame {
constructor(data, kwargs = {}) {
this._data = data;
this._axes = {};
this._AXIS_ORDERS = null;
this._values = null;
}
/**
* Return a Seq of axis dimensions
*
* @returns Immutable.Seq
*/
get shape() {
return Immutable.Seq(this._AXIS_ORDERS.map(axis => this._get_axis(axis).size));
}
get values() {
return this._values;
}
/**
* Assign labels to an axis
*
* @param {number|string} axis
* @param {List} labels
*/
set_axis(axis, labels) {
this._axes[axis] = labels;
}
_setup_axes(axes) {
this._AXIS_ORDERS = axes;
this._AXIS_LEN = axes.size;
}
_get_axis(axis) {
return this._axes[axis];
}
}
| 16.777778 | 83 | 0.6 |
b8116a339dfb8fc9c407a93da1b09484b64090d1 | 928 | js | JavaScript | src/js/base/services/templateLoader.js | 52North/sensorweb-client-core | 2c2d1aff71c37e3404d62e8a7fe948656379c72e | [
"Apache-2.0"
] | 9 | 2015-11-26T13:26:20.000Z | 2017-10-10T11:35:20.000Z | src/js/base/services/templateLoader.js | 52North/sensorweb-client-core | 2c2d1aff71c37e3404d62e8a7fe948656379c72e | [
"Apache-2.0"
] | 10 | 2017-01-17T14:06:46.000Z | 2017-06-07T08:29:02.000Z | src/js/base/services/templateLoader.js | 52North/sensorweb-client-core | 2c2d1aff71c37e3404d62e8a7fe948656379c72e | [
"Apache-2.0"
] | 13 | 2015-11-26T13:24:58.000Z | 2020-02-13T16:47:31.000Z | angular.module('n52.core.base')
.service('templatesLoader', ['templatesMapping',
function(templatesMapping) {
this.getTemplateForId = function(id) {
if (templatesMapping && templatesMapping.hasOwnProperty(id)) {
return templatesMapping[id];
}
return id;
};
}
])
.config(['$provide',
function($provide) {
$provide.decorator('$templateRequest', ['$delegate', 'templatesLoader',
function($delegate, templatesLoader) {
templatesLoader.oldRequest = $delegate;
$delegate = function(id, ignoreRequestError) {
return templatesLoader.oldRequest(templatesLoader.getTemplateForId(id), ignoreRequestError);
};
return $delegate;
}
]);
}
]);
| 37.12 | 116 | 0.512931 |
b811a0a5f7d2bbe1925962ae4201d74a834f146d | 16,286 | js | JavaScript | spatial/mvc-map-api/demos/u/js/styleBinding2.js | granadomoreno/oracle-db-examples | feac5d72f4a8534c9b3e848bdfc501c5b4c69268 | [
"Apache-2.0"
] | 1,071 | 2017-04-06T16:59:55.000Z | 2022-03-25T21:10:58.000Z | spatial/mvc-map-api/demos/u/js/styleBinding2.js | abhishektripathi27/oracle-db-examples | 0812a65c7c974718ec5a04454b8a42f7c25bf2a8 | [
"Apache-2.0"
] | 71 | 2017-04-12T14:55:52.000Z | 2022-02-22T17:08:18.000Z | spatial/mvc-map-api/demos/u/js/styleBinding2.js | abhishektripathi27/oracle-db-examples | 0812a65c7c974718ec5a04454b8a42f7c25bf2a8 | [
"Apache-2.0"
] | 749 | 2017-04-09T06:48:58.000Z | 2022-03-23T00:28:26.000Z |
// This tutorial is similar to styleBinding.html, but instead of binding
// the sales data to the bubbles' FILL colors, it binds them to the SIZE
// aspect of the bubbles. It also adds a second binding that sets the
// FILL color based on each customer's account_mgr.
//
// This second binding also shows how to create a custom ColorFormatter
// which maps the manager names to colors.
//
// finally, it also shows how to customize the info window that is
// displayed when you click on a feature bubble.
function showMap() {
OM.gv.setResourcePath("../..");
//this defines a universe with the custom Albers-USA map projection that
//scales and moves the states of Alaska and Hawii closer to the lower 48
//states.
var config = {
//special srid 505050 represents the client-side only Albers-USA projection.
srid : 505050,
//these bounds seem to give the best overall appearance
bounds : new OM.geometry.Rectangle(-3200000, -500000, 2800000, 3800000, 505050),
numberOfZoomLevels: 10
};
var albersUsa = new OM.universe.Universe(config);
var map = new OM.Map(document.getElementById('map'),
{
universe: albersUsa
});
//displays the background layer: counties of California from a geoJson data pack file
var stateColor = new OM.style.Color(
{ strokeThickness: 1,
stroke: "#ac9898",
fill: "#b2bec6",
fillOpacity: 0.85});
var stateLayer = new OM.layer.VectorLayer("states",
{
def: {
type: OM.layer.VectorLayer.TYPE_DATAPACK,
url: "../u/data/usa_states.json",
labelColumn: "state_abrv"
},
renderingStyle: stateColor,
boundingTheme: false
}
);
//ensure the feature's label text is displayed on the map
stateLayer.setLabelsVisible(true);
stateLayer.enableToolTip(false);
map.addLayer(stateLayer);
//add the customers bubble layer
addCustomersLayer(map);
map.init();
addMapControls(map);
}
//creates and adds the customer bubble layer. also defines a custom info window
//to be displayed when clicking on a bubble.
function addCustomersLayer(map) {
//Creates three types of Marker styles to represent the customers in different
//state.
var defaultFill = '#ff9999';
var defaultSize = 20;
//This style is for normal rendering of the customers
var circleMarker = new OM.style.Marker(
{
width: defaultSize,
height: defaultSize,
lengthUnit: 'pixel',
vectorDef: [{
shape: {type: "circle", cx: 0, cy: 0},
style: {fill: defaultFill, fillOpacity: 0.80, stroke: '#9baca6', strokeThickness: 1.5}
}
]
});
//This style is for rendering customers under mosue hover
var hover = new OM.style.Marker(
{
width: defaultSize,
height: defaultSize,
lengthUnit: 'pixel',
vectorDef: [{
shape: {type: "circle", cx: 0, cy: 0},
style: {fill: defaultFill, fillOpacity: 0.80, stroke: "#feeec2", strokeThickness: 1.5}
}
]
});
//This style is for customers that have been selected
var select = new OM.style.Marker(
{
width: defaultSize,
height: defaultSize,
lengthUnit: 'pixel',
vectorDef: [{
shape: {type: "circle", cx: 0, cy: 0},
style: {fill: defaultFill, fillOpacity: 0.80, stroke: "#462c22", strokeThickness: 1.5}
}
]
});
//The measure column that holds the sales data.
var measureColumn = new OM.Column({
data: salesData, //an array of <key, value> pairs loaded from sales.js
keyGetter: function() {
return this.name; // the customer's name
}, //'this' here always refers to an element of the data array.
valueGetter: function() {
return this.sales; // the sales to this customer
},
});
//Now let's create a Size formatter that computes and
//returns a marker size value (in pixels) for each possible data value in the Column.
//You can also create a custom formatter, in which case you can use a
//different algorithm to map the data values to marker sizes.
var sizeFormatter = new OM.style.SizeFormatter({
startingSize: 9,
numClasses: 7,
delta: 4,
scale: 'linear'
});
//Finally, lets create the markers layer to display all the customers.
var customersLayer = new OM.layer.VectorLayer("customers",
{
def: {
type: OM.layer.VectorLayer.TYPE_DATAPACK,
url: "../u/data/customers.json"
},
//You can call customersLayer.setRenderingStyle(circle) later,
//or just set it here as part of the layer definition.
renderingStyle: circleMarker,
boundingTheme: true
}
);
customersLayer.setSelectStyle(select);
customersLayer.setHoverStyle(hover);
//This is where everything is tied together.
//It basically binds the measureColumn to the 'Size' aspect
//of the circle markers. In other words the data values in the
//measureColumn will drive the sizes of the markers.
circleMarker.bindData('Size', measureColumn, sizeFormatter);
//now bind the same data to the hover and select styles as well:
hover.bindData('Size', measureColumn, sizeFormatter);
select.bindData('Size', measureColumn, sizeFormatter);
//next, we want to display the bubbles in different colors based
//on who the customer's account manager is.
var managerColors = ['#e7298a', '#7570b3', '#d95f02', '#1b9e77'];
//Creates a new custom color formatter class by extending the OM.style.ColorFormatter
//class and overriding its resolve() function.
//Such a custom formatter gives us full control on
//how the values (account manager names) are mapped to colors.
//The resolve method is called on every feature being displayed on the map.
//The first parameter is the value of the current feature as obtained
//from the data column. The second parameter references
//the Column instance itself, which is not used in this particular case.
//The third parameter is the feature itself, again not used here.
var _ColorFormatter = OM.style.ColorFormatter.extend({
resolve: function(value, column)
{
if (!value) {
return '#000000'; //black if no manager is found for a customer
}
if (value === 'alex') {
return this.baseColors[0]; //#ff0000
} else if (value === 'george') {
return this.baseColors[1];
} else if (value === 'max') {
return this.baseColors[2];
} else if (value === 'stacy') {
return this.baseColors[3];
}
return '#000000';
}
});
//Creates a concrete instance of the extended class. The options
//passed into the constructor are the same as the
//base OM.style.ColorFormatter class.
var colorFormatter = new _ColorFormatter({
style: circleMarker, //optional, tells the formatter which style it will be affecting
colors: managerColors, //a 4-color series for the 4 account managers in the customers data set.
scale: 'log' //will be ignored since we implemented our own resolve() function
});
//bind the custom color formatter to the marker style and the
//attribute column 'account_mgr'. Note in this case we are not
//creating a separate data wrapper OM.Column instance, instead we
//can simply specify the property name since its already part of
//the vector layer's features.
circleMarker.bindData('Fill', 'account_mgr', colorFormatter);
hover.bindData('Fill', 'account_mgr', colorFormatter);
select.bindData('Fill', 'account_mgr', colorFormatter);
//setup a custom info window to be displayed when clicking on a feature of this layer
setInfoWindow(map, customersLayer, [measureColumn]);
//that's it.
map.addLayer(customersLayer);
}
//This function creates and displays a custom info window when clicking on a marker.
//Because the default info-window only shows properties that are already part of a
//vector layer's features, it means the measure (sales) values will not be displayed
//in the default info-window, since they are obtained separately and not an intrinsic
//part of the features in the datapack. Here we show how to simulate the
//default info window while adding the external data value to it in the process. Note
//that you can easily customize it further to give the info-window more 'personality'
//or better fit your application's overall theme.
function setInfoWindow(map, layer, columns)
{
if(!layer)
return;
//Disables the default info-window which shows only native properties already
//defined in the datapack layer.
layer.enableInfoWindow(false);
//Creates a new click listener to be registered on the layer.
var clickListener = function(evt)
{
//the evt object contains the current feature being clicked on
var feature = evt.feature;
//feature.attributes contains all the native properties of the feature
//as defined in the original geoJson file.
var attrs = feature.attributes;
//current mouse pointer location
var point = map.getCursorLocation();
//Options for customizing the info-window's look and feel.
//not used here as we will stick to the default info-window 'style'.
var options={};
var j=0;
var html = "";
//first, lets add all the existing properties of the feature to
//the info-window. These property names and values are formatted
//into a simple html table.
for(var attrName in attrs)
{
var value = attrs[attrName];
if (value)
{
var isNumeric = OM.util.ValidationUtil.isNumber(value);
if(isNumeric)
{
//remove trailing 0
value = parseFloat(value);
}
else if(typeof value === 'string')
{
//clean up string values
value = value.replace(/\s/g," ");
}
}
else
continue;
//alternating table row colors
var color = (j % 2 === 0)? "#dddddd" : "#bbbbbb";
j++;
//Add only non-label properties to the html table. _LABEL_ is a special property name
//in geoJson files generated by MapViewer to represent a default label text property.
if (attrName!=="_LABEL_")
html += "<tr bgcolor='"+color+"'><td align='right'>"+attrName+"</td><td align='left'>"+value+"</td></tr>";
}
//The feature id will be used to obtain the external data values stored in the associated
//Column instances.
var geokey = feature.id;
//Obtain and add data values from the associated columns for the current feature
//to the info-window table.
for(var i=0; i<columns.length; i++)
{
//Use the Column instance's built-in method _getValueOfRow()_ to
//obtain the data value for the given key.
var measure = columns[i].getValueOfRow(geokey);
var measureName = columns[i].getMeasureName();
if(!measure)
measure = "";
color = (j % 2 === 0)? "#dddddd" : "#bbbbbb";
html += "<tr bgcolor='"+color+"'><td align='right'>"+measureName+"</td><td align='left'>"+measure+"</td></tr>";
j++;
}
//wrap all the properties into a table
html = "<table style='margin:auto'>" + html + "</table>";
//Now display the info-window on the map at the mouse pointer location.
//Note that the second parameter can be an arbitrary HTML string.
map.displayInfoWindow(point, html, options);
};
//finally, registers the click listener on the layer. Clicking on any feature
//of this layer will trigger it.
layer.addListener(OM.event.MouseEvent.MOUSE_CLICK, clickListener);
};
function addMapControls(map) {
addMapNavControl(map)
addMapCopyright(map);
addMapTitle(map);
addMapScale(map);
}
function addMapTitle(map) {
var maptitle = new OM.control.MapDecoration(null,
{
anchorPosition: 2,
title:" Sales Distribution Map",
draggable:true, collapsible: false,
titleStyle:{ "font-size":"22px",
"font-weight":"bold",
"font-family":'Arial',
"color":"#0000d0",
"backgroundColor":"#FfFfFf",
"opacity":"0.75"
}
});
map.addMapDecoration(maptitle);
}
function addMapScale(map) {
//defines the basic properties for the map scale bars
var sbConfig = {
format: "BOTH", // imperial and metric units
anchorPosition: 4
};
//creates the actual sacle bar instance and sets the display style
var scaleBar = new OM.control.ScaleBar(sbConfig);
//defines the display style of the scale bars
var sbStyle = {
barThickness:4, // default is 3
scaleBarColor: '#0000d0', // default is black
fontColor: '#0000d0' // default is black
};
scaleBar.setStyle(sbStyle);
//adds the scale bar to the map decoration
map.addMapDecoration(scaleBar);
}
function addMapNavControl(map) {
var options = {
anchorPosition: 1,
style: OM.control.NavigationPanelBar.STYLE_PAN_AND_ZOOM_BUTTONS
//STYLE_FULL
//STYLE_ZOOM_ONLY
//STYLE_ZOOM_BUTTONS_ONLY //--default value
//STYLE_PAN_ONLY
//STYLE_PAN_AND_ZOOM_BUTTONS
};
var navigationPanelBar = new OM.control.NavigationPanelBar(options);
navigationPanelBar.setZoomLevelInfoTips({
2: "Country",
5: "State",
7: "City",
15: "Street"
});
map.addMapDecoration(navigationPanelBar);
}
function addMapLayerControl(map) {
var layerControl=new OM.control.LayerControl({
anchorPosition:1,
minWidth:200,
maxHeight:400,
left:20,
top:20,
font_size:14,
font_family:"arial"
});
map.addMapDecoration(layerControl);
}
function addMapCopyright(map) {
var mapCopyRight = new OM.control.CopyRight({anchorPosition:5,textValue:'Map data: <a href="https://www.naturalearthdata.com/" target="_blank"> Natural Earth </a>',fontSize:12,fontFamily:'Arial',fontColor:'black'});
map.addMapDecoration(mapCopyRight);
} | 39.433414 | 223 | 0.570551 |
b81246044d0d56001c921d2e3daa504ea5cd0a84 | 598 | js | JavaScript | doc/api/implementors/core/iter/traits/iterator/trait.Iterator.js | EVaillant/entity_system_rust | f2b5bf8ed509236bb955ef779836303a3cee174e | [
"BSL-1.0"
] | null | null | null | doc/api/implementors/core/iter/traits/iterator/trait.Iterator.js | EVaillant/entity_system_rust | f2b5bf8ed509236bb955ef779836303a3cee174e | [
"BSL-1.0"
] | null | null | null | doc/api/implementors/core/iter/traits/iterator/trait.Iterator.js | EVaillant/entity_system_rust | f2b5bf8ed509236bb955ef779836303a3cee174e | [
"BSL-1.0"
] | null | null | null | (function() {var implementors = {};
implementors["entity_system"] = [{"text":"impl<'a> Iterator for EntityAllocatorIterator<'a>","synthetic":false,"types":[]},{"text":"impl<'a, EntityManagerComponentType> Iterator for EntityIterator<'a, EntityManagerComponentType> <span class=\"where fmt-newline\">where<br> EntityManagerComponentType: EntityManagerComponent + Default, </span>","synthetic":false,"types":[]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() | 199.333333 | 427 | 0.757525 |
b8126c736558a9f7115a503d1e4fe501b6c329c7 | 1,248 | js | JavaScript | testnet/src/helper/index.js | ykrueng/TestNet | 141a2c9825a8c83415934309681d3d685b35dd76 | [
"MIT"
] | 2 | 2018-12-18T00:30:32.000Z | 2019-03-14T05:20:07.000Z | testnet/src/helper/index.js | ykrueng/TestNet | 141a2c9825a8c83415934309681d3d685b35dd76 | [
"MIT"
] | null | null | null | testnet/src/helper/index.js | ykrueng/TestNet | 141a2c9825a8c83415934309681d3d685b35dd76 | [
"MIT"
] | 2 | 2019-01-03T23:22:37.000Z | 2019-01-04T00:13:17.000Z | export const filterQuizzes = (quizzes, activeOnly, topics, searchText, searchField) => {
return quizzes.filter(quiz => {
if (activeOnly && quiz.question_count <= 0) {
return false;
}
if (topics.length > 0 && !topics.includes(quiz.topic)) {
return false;
}
if (!searchText) {
return true;
}
if (searchField === "all") {
return (
quiz.title.toLowerCase().includes(searchText.toLowerCase()) ||
quiz.topic.toLowerCase().includes(searchText.toLowerCase()) ||
quiz.author.toLowerCase().includes(searchText.toLowerCase())
);
}
return (
(topics.length === 0 || topics.includes(quiz.topic)) &&
quiz[searchField].toLowerCase().includes(searchText.toLowerCase())
);
});
};
export const sortQuizzes = (quizzes, sortingMethod) => {
return [...quizzes].sort((quizA, quizB) => {
const field = sortingMethod.includes("votes") ? "votes" : "question_count";
if (sortingMethod.includes("descending")) {
if (quizA[field] < quizB[field]) return 1;
if (quizA[field] === quizB[field]) return 0;
return -1;
}
if (quizA[field] < quizB[field]) return -1;
if (quizA[field] === quizB[field]) return 0;
return 1;
});
};
| 32 | 88 | 0.607372 |
b81389a9976c045fa4727b402af3cbf2ae996c53 | 2,874 | js | JavaScript | src/spMongoDB.js | dongwenxiao/sp-mongo | 3058cb47d5f2cdb17ecb4a0de4e1fa1937a7a685 | [
"Apache-2.0"
] | null | null | null | src/spMongoDB.js | dongwenxiao/sp-mongo | 3058cb47d5f2cdb17ecb4a0de4e1fa1937a7a685 | [
"Apache-2.0"
] | null | null | null | src/spMongoDB.js | dongwenxiao/sp-mongo | 3058cb47d5f2cdb17ecb4a0de4e1fa1937a7a685 | [
"Apache-2.0"
] | null | null | null | const mongo = require('mongodb')
const ObjectID = mongo.ObjectID
const MongoClient = mongo.MongoClient
/**
* 操作Mongodb的类
* 构造方法需要参数{ip: '', port: '', db: ''}
*
* @export
* @class spMongoDB
*/
export default class spMongoDB {
constructor(opt) {
this.ip = opt.ip
this.port = opt.port
this.db = opt.db
}
/**
* 获取mongodb链接对象
*
* @returns mongodb 链接对象(Promise)
*
* @memberOf spMongoDB
*/
getDB() {
return MongoClient.connect(`mongodb://${this.ip}:${this.port}/${this.db}`)
}
/**
* 查询数据
*
* @param {any} collection 集合名字
* @param {any} [selecter={}] 查询条件
* @returns
*
* @memberOf MongoDB
*/
async find(collection, selecter = {}) {
if (selecter._query === undefined)
selecter._query = {}
if (selecter._query._id)
selecter._query._id = new ObjectID(selecter._query._id)
const db = await this.getDB()
const col = await db.collection(collection)
let cursor = col.find(selecter._query)
selecter._limit !== undefined && cursor.limit(selecter._limit)
selecter._skip !== undefined && cursor.skip(selecter._skip)
// selecter._filter !== undefined && cursor.skip(selecter._filter) // 子项过滤
selecter._sort !== undefined && cursor.sort(selecter._sort)
// selecter._sort !== undefined && cursor.sort({name: 1, age: -1})
const result = cursor.toArray().then((docs) => {
db.close()
return docs
})
return result
}
async count(collection, selecter = {}) {
}
async insert(collection, doc) {
const db = await this.getDB()
const col = await db.collection(collection)
const result = await col.insert(doc).then(res => {
db.close()
return res
})
return result
}
async update(collection, selecter, doc, option = { multi: true, upsert: true }) {
if (selecter === undefined) return false
if (JSON.stringify(selecter) == '{}') return false
if (selecter._id)
selecter._id = new ObjectID(selecter._id)
const db = await this.getDB()
const col = await db.collection(collection)
const result = col.update(selecter, { $set: doc }, option).then(res => {
db.close()
return res
})
return result
}
async delete(collection, selecter) {
if (selecter === undefined) return false
if (selecter._id)
selecter._id = new ObjectID(selecter._id)
const db = await this.getDB()
const col = await db.collection(collection)
const result = col.remove(selecter).then(res => {
db.close()
return res
})
return result
}
} | 23.365854 | 85 | 0.55254 |
b813acaa225663f3bb904c67c7e08a7377094ce2 | 597 | js | JavaScript | OtterBot V1.0.0.0/Bot/MusicBot/commands/stop.js | Cd-corgi/OtterBot-OP-project | bbb562fe59fcd9686e11b9f3e8f01c60f8c77499 | [
"MIT"
] | 2 | 2021-02-17T20:12:03.000Z | 2021-03-05T16:11:31.000Z | OtterBot V1.0.0.0/Bot/MusicBot/commands/stop.js | Cd-corgi/OtterBot-OP-project | bbb562fe59fcd9686e11b9f3e8f01c60f8c77499 | [
"MIT"
] | null | null | null | OtterBot V1.0.0.0/Bot/MusicBot/commands/stop.js | Cd-corgi/OtterBot-OP-project | bbb562fe59fcd9686e11b9f3e8f01c60f8c77499 | [
"MIT"
] | null | null | null | const { MessageEmbed } = require('discord.js')
module.exports = {
name: "stop",
aliases: ["disconnect", "leave"],
inVoiceChannel: true,
run: async (client, message, args) => {
const stopped = new MessageEmbed()
.setTitle("⏏ | As you want, Music Stopped!")
.setThumbnail("https://media.giphy.com/media/3o7TKW7cknfhthVPfG/giphy.gif")
const queue = client.distube.getQueue(message)
if (!queue) return message.channel.send(`❓ | There is nothing in the queue right now!`)
client.distube.stop(message)
message.channel.send(stopped)
}
} | 31.421053 | 95 | 0.646566 |
b814156c93ea126761d41504139282a75f0462b5 | 2,179 | js | JavaScript | src/containers/BooksForm.js | evaveskova/redux-bookstore | e8cfabfc4bacff9db1ddcf75f27c8fe510434233 | [
"MIT"
] | 3 | 2020-03-17T21:41:41.000Z | 2020-04-21T13:47:32.000Z | src/containers/BooksForm.js | evaveskova/redux-bookstore | e8cfabfc4bacff9db1ddcf75f27c8fe510434233 | [
"MIT"
] | 3 | 2020-03-17T22:35:25.000Z | 2022-02-27T01:22:20.000Z | src/containers/BooksForm.js | evaveskova/redux-bookstore | e8cfabfc4bacff9db1ddcf75f27c8fe510434233 | [
"MIT"
] | 2 | 2020-03-23T03:18:36.000Z | 2020-05-01T19:15:51.000Z | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createBook } from '../actions/index';
class BooksForm extends React.Component {
constructor(props) {
super(props);
this.state = {
id: Math.floor(Math.random() * 100),
title: '',
category: 'Action',
};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleChange(event) {
if (event.target.id === 'title') {
this.setState({
title: event.target.value,
});
} else if (event.target.id === 'category') {
this.setState({
category: event.target.value,
});
}
}
handleSubmit(event) {
event.preventDefault();
const { title } = this.state;
const { createBook } = this.props;
if (title) {
createBook(this.state);
this.clearState();
}
}
clearState() {
this.setState({
id: Math.floor(Math.random() * 1000),
title: '',
category: 'Action',
});
}
render() {
const categories = ['Action', 'Biography', 'History', 'Horror', 'Kids', 'Learning', 'Sci-Fi'];
const { title, category } = this.state;
return (
<div id="form-container">
<h2 id="form-header">ADD NEW BOOK</h2>
<form onSubmit={this.handleSubmit}>
<label htmlFor="title" id="title-form-label">
<input placeholder="Title" type="text" id="title" onChange={this.handleChange} value={title} />
</label>
<label htmlFor="category" id="category-form-label">
<select id="category" onChange={this.handleChange} value={category}>
{ categories.map(category => <option value={category} key={`${category}_option`}>{category}</option>)}
</select>
</label>
<button id="add-book-btn" type="submit">ADD BOOK</button>
</form>
</div>
);
}
}
BooksForm.propTypes = {
createBook: PropTypes.func.isRequired,
};
const mapDispatchToProps = dispatch => ({
createBook: book => dispatch(createBook(book)),
});
export default connect(null, mapDispatchToProps)(BooksForm);
| 26.901235 | 116 | 0.591556 |
b81425c65bea240f0978eba603e590cdc5072dcf | 441 | js | JavaScript | utils/helpers.js | Tutor78/on-my-mind | c68bf92eed190fd819565fec501addf8a8c3612d | [
"MIT"
] | null | null | null | utils/helpers.js | Tutor78/on-my-mind | c68bf92eed190fd819565fec501addf8a8c3612d | [
"MIT"
] | null | null | null | utils/helpers.js | Tutor78/on-my-mind | c68bf92eed190fd819565fec501addf8a8c3612d | [
"MIT"
] | null | null | null | module.exports = {
// formats the date into a Month, Day, Year format
format_date: date => {
return `${new Date(date).getMonth() + 1}/${new Date(date).getDate()}/${new Date(date).getFullYear()}`;
},
// formts the words to be plural or singular depending on the amount of comments
format_plural: (word, amount) => {
if (amount !==1) {
return `${word}s`;
}
return word;
}
}; | 31.5 | 110 | 0.562358 |
b814dc0e147eb27ad8e5f408207d8cfff47e675e | 422 | es6 | JavaScript | src/pobs-alert/pobs-alert-link.es6 | pinguxx/pobs | 9eda3a116f1ce933e3924e079f18054074ba89ec | [
"MIT"
] | 1 | 2017-08-02T13:39:22.000Z | 2017-08-02T13:39:22.000Z | src/pobs-alert/pobs-alert-link.es6 | pinguxx/pobs | 9eda3a116f1ce933e3924e079f18054074ba89ec | [
"MIT"
] | null | null | null | src/pobs-alert/pobs-alert-link.es6 | pinguxx/pobs | 9eda3a116f1ce933e3924e079f18054074ba89ec | [
"MIT"
] | null | null | null | 'use strict';
class PobsAlertLink extends mix(Polymer.Element).with(Pobs.ParentStyleBehavior) {
static get is() {
return 'pobs-alert-link';
}
static get config() {
return {
properties: {
href: {
type: String,
value: '#'
}
}
}
}
}
customElements.define(PobsAlertLink.is, PobsAlertLink); | 23.444444 | 81 | 0.488152 |
b814e0ca4c120a2b7b653ce9c055270f726a5a59 | 2,777 | js | JavaScript | server/api/properties.js | TandeepGill/Rentalverse | 3832f5cb57fdb7c8e7646231c53cb6ffda2a7171 | [
"MIT"
] | null | null | null | server/api/properties.js | TandeepGill/Rentalverse | 3832f5cb57fdb7c8e7646231c53cb6ffda2a7171 | [
"MIT"
] | null | null | null | server/api/properties.js | TandeepGill/Rentalverse | 3832f5cb57fdb7c8e7646231c53cb6ffda2a7171 | [
"MIT"
] | null | null | null | const router = require('express').Router();
const {
models: { Property, Lease },
} = require('../db/index.js');
module.exports = router;
// GET /api/properties --> Gets all properties based on User ID.
router.get('/', async (req, res, next) => {
try {
const properties = await Property.findAll({
where: {
userId: req.query.userId,
},
});
res.json(properties);
} catch (err) {
next(err);
}
});
// GET /api/properties --> Gets a single property based on Property ID.
router.get('/:propertyId', async (req, res, next) => {
try {
const property = await Property.findByPk(req.params.propertyId);
res.json(property);
} catch (err) {
next(err);
}
});
// GET /api/properties --> Gets a single property's lease based on Property ID.
router.get('/:propertyId/lease', async (req, res, next) => {
try {
const lease = await Lease.findOne({
where: {
propertyId: req.params.propertyId,
isCurrentTenant: true,
},
});
if (lease === null) {
return new Error('No lease information found.');
}
res.json(lease);
} catch (err) {
next(err);
}
});
// POST /api/properties --> Creates a new property for a user based on User ID.
router.post('/new/:userId', async (req, res, next) => {
try {
const property = { ...req.body };
let combinedAddress = `${property.addressLineOne}\n${property.addressLineTwo}`;
const newProperty = {
type: property.type,
address: combinedAddress,
bedroom: property.bedroom,
bathroom: property.bathroom,
sqft: property.sqft,
imageURL: property.imageURL,
};
const createdProperty = await Property.create({
...newProperty,
userId: req.params.userId,
});
res.json(createdProperty);
} catch (error) {
next(error);
}
});
// POST /api/properties --> Creates a new lease for a property based on Property ID and adds User ID to entry.
router.post('/:propertyId/lease/new/:userId', async (req, res, next) => {
try {
const leaseDetails = { ...req.body };
leaseDetails.isCurrentTenant = true;
const createdLease = await Lease.create({
...leaseDetails,
propertyId: req.params.propertyId,
userId: req.params.userId,
});
res.json(createdLease);
} catch (error) {
next(error);
}
});
// DELETE /api/properties --> Deletes a single property and all associated leases based on Property ID.
router.delete('/:propertyId/delete', async (req, res, next) => {
try {
await Lease.destroy({
where: {
propertyId: req.params.propertyId,
},
});
await Property.destroy({
where: {
id: req.params.propertyId,
},
});
res.json();
} catch (err) {
next(err);
}
});
| 23.735043 | 110 | 0.604249 |
b815e4cacc9c26ad3a3305d1fed1440ad088c961 | 229 | js | JavaScript | server/src/index.js | muba97/Anayahs_salon_app | 716411ae38bc8494510353a76f3ff9067d066db7 | [
"MIT"
] | 1 | 2021-03-09T01:59:29.000Z | 2021-03-09T01:59:29.000Z | server/src/index.js | muba97/Anayahs_salon_app | 716411ae38bc8494510353a76f3ff9067d066db7 | [
"MIT"
] | null | null | null | server/src/index.js | muba97/Anayahs_salon_app | 716411ae38bc8494510353a76f3ff9067d066db7 | [
"MIT"
] | null | null | null | import { app, server } from './server';
const { PORT } = process.env;
const serverPort = PORT || 5000;
app.listen({ port: serverPort }, () =>
console.log(`🚀 Server ready at http://localhost:${PORT}${server.graphqlPath}`)
);
| 22.9 | 80 | 0.641921 |
b8171c408fcb6b3b46adf56aeb24954615a1ab38 | 16,786 | js | JavaScript | UltimateWeb/war/js/rest.js | ultianalytics/UltimateWeb | 5b0c81cd2093187239e915ba014b3c8c2e3a5d81 | [
"MIT"
] | null | null | null | UltimateWeb/war/js/rest.js | ultianalytics/UltimateWeb | 5b0c81cd2093187239e915ba014b3c8c2e3a5d81 | [
"MIT"
] | null | null | null | UltimateWeb/war/js/rest.js | ultianalytics/UltimateWeb | 5b0c81cd2093187239e915ba014b3c8c2e3a5d81 | [
"MIT"
] | null | null | null | Ultimate.busyDialogStack = 0;
Ultimate.baseRestUrl = "/rest/view";
Ultimate.sessionId = new Date().getTime() + '';
function retrieveTeam(id, includePlayers, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveTeam");
var url = Ultimate.baseRestUrl + '/team/' + id;
url = includePlayers ? url + "?players=true" : url;
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveTeamForAdmin(id, includePlayers, includeInactive, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveTeamForAdmin");
var url = Ultimate.baseRestUrl + '/admin/team/' + id;
if (includePlayers) {
url = url + "?players=true";
if (includeInactive) {
url = url + "&includeInactive=true";
}
}
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveGames(teamId, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveGames");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/games';
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveGamesData(teamId, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveGames");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/gamesdata';
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveGamesForAdmin(teamId, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveGamesForAdmin");
var url = Ultimate.baseRestUrl + '/admin/team/' + teamId + '/games';
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveGame(teamId, gameId, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveGame");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/game/' + gameId;
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function deleteGame(teamId, gameId, successFunction, errorFunction) {
sendAnalyticsEvent("deleteGame");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/game/' + gameId + '/delete';
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function undeleteGame(teamId, gameId, successFunction, errorFunction) {
sendAnalyticsEvent("undeleteGame");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/game/' + gameId + '/undelete';
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function deleteTeam(teamId, successFunction, errorFunction) {
sendAnalyticsEvent("deleteTeam");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/delete';
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function undeleteTeam(teamId, successFunction, errorFunction) {
sendAnalyticsEvent("undeleteTeam");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/undelete';
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function deletePlayer(teamId, playerToDelete, replacementPlayer, successFunction, errorFunction) {
sendAnalyticsEvent("deletePlayer");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/player/delete?player=' + playerToDelete + '&replacement='+replacementPlayer;
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function renamePlayer(teamId, playerToRename, replacementPlayer, firstName, lastName, successFunction, errorFunction) {
sendAnalyticsEvent("renamePlayer");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/player/rename?player=' + playerToRename +
'&replacement=' + replacementPlayer + '&firstName=' + firstName + '&lastName=' + lastName;
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function retrievePlayerStatsForGames(teamId, gameIds, successFunction, errorFunction) {
sendAnalyticsEvent("retrievePlayerStatsForGames");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/stats/player';
if (gameIds != null && gameIds.length > 0) {
url = url + '?gameIds=' + gameIds.join("_");
}
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrievePlayerStatsForEachGame(teamId, gameIds, successFunction, errorFunction) {
sendAnalyticsEvent("retrievePlayerStatsForGames");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/stats/player/games';
if (gameIds != null && gameIds.length > 0) {
url = url + '?gameIds=' + gameIds.join("_");
}
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveTeamStatsForGames(teamId, gameIds, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveTeamStatsForGames");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/stats/team';
if (gameIds != null && gameIds.length > 0) {
url = url + '?gameIds=' + gameIds.join("_");
}
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveAllStatsForGames(teamId, gameIds, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveAllStatsForGames");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/stats/all';
if (gameIds != null && gameIds.length > 0) {
url = url + '?gameIds=' + gameIds.join("_");
}
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveTeams(successFunction, errorFunction) {
sendAnalyticsEvent("retrieveTeams");
var url = Ultimate.baseRestUrl + '/teams';
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrieveTeamsIncludingDeleted(successFunction, errorFunction) {
sendAnalyticsEvent("retrieveTeams");
var url = Ultimate.baseRestUrl + '/teams?includeDeleted=true';
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function retrievePlayerStatsForGame(options, successFunction, errorFunction) {
sendAnalyticsEvent("retrievePlayerStatsForGame");
var teamId = options.teamId;
retrievePlayerStatsForGames(teamId, [options.gameId], successFunction, errorFunction);
}
function retrieveGameVersions(teamId, gameId, successFunction, errorFunction) {
sendAnalyticsEvent("retrieveGameVersions");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/game/' + gameId + '/versions';
sendRequest({url: url, dataType: 'json', success: successFunction, error: errorFunction});
}
function restoreGameVersion(teamId, gameId, versionId, successFunction, errorFunction) {
sendAnalyticsEvent("restoreGameVersion");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/game/' + gameId + '/version/' + versionId + '/restore';
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function savePassword(teamId, password, successFunction, errorFunction) {
sendAnalyticsEvent("savePassword");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/password/' + (isNullOrEmpty(password) ? 'REMOVE-PASSWORD' : password);
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function signon(teamId, password, successFunction, errorFunction) {
sendAnalyticsEvent("signon");
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/authenticate/' + password;
sendRequest({url: url, dataType: 'json', isPost: true, success: successFunction, error: errorFunction});
}
function urlForStatsExportFileDownload(teamId, games) {
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/stats/export';
if (games) {
var sortedGames = sortGames(games);
var gameIds = collectGameIds(sortedGames);
if (gameIds != null && gameIds.length > 0) {
url = url + '?gameIds=' + gameIds.join("_");
}
}
return url;
}
function urlForGameExportFileDownload(teamId, gameId) {
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/export/game/' + gameId + '?players=true';
return url;
}
function urlForGameExportFileUpload(teamId) {
var returnUrl = encodeURIComponent('/team/admin#teamgamespage?team=' + teamId);
var url = Ultimate.baseRestUrl + '/team/' + teamId + '/import/game?return=' + returnUrl;
return url;
}
function sendRequest(request) {
var options = {
success: function(data, textStatus, jqXHR){
busyDialogEnd();
var responseTypeReceived = jqXHR.getResponseHeader('Content-Type');
if (isExpectedResponseType(request, jqXHR)) {
request.success(data, textStatus, jqXHR);
} else {
logRequestFailure(jqXHR, "", "unexpected response type = " + responseTypeReceived);
}
},
error: function(jqXHR, textStatus, errorThrown){
busyDialogEnd();
var error = logRequestFailure(jqXHR, textStatus, errorThrown);
if (request.error) {
request.error(jqXHR, textStatus, errorThrown);
} else {
throw error;
}
}
};
if (request.dataType) {
options.dataType = request.dataType;
}
if (request.isPost) {
options.type = 'POST';
options.contentType = 'application/json';
}
if (request.data) {
options.data = request.data;
}
options.xhrFields = {withCredentials: true};
busyDialogStart();
var url = addQueryStringParameter(request.url, 'cachebuster', Ultimate.sessionId); // new session on every page load
$.ajax(url, options);
}
function isExpectedResponseType(request, responseTypeReceived) {
if (request.expectedResponseType) {
if (responseTypeReceived.indexOf(request.expectedResponseType) < 0) {
return false;
}
}
return true;
}
function addCommas(nStr)
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
function logRequestFailure(jqXHR, textStatus, errorThrow) {
var error = errorDescription(jqXHR, textStatus, errorThrow);
logError(error);
return error;
}
function errorDescription(jqXHR, textStatus, errorThrow) {
return 'ERROR: status ' + jqXHR.status + ' (' + textStatus + ') ' + errorThrow +
(jqXHR.responseText ? ' \n' + jqXHR.responseText : '');
}
function getParameterByName(name) {
var parts = window.location.href.split('?'); // jQM seems to pass odd urls sometimes (previous qs before current qs)
var queryString = '?' + parts[parts.length -1];
var match = RegExp('[?&]' + name + '=([^&]*)').exec(queryString);
var value = match && decodeURIComponent(match[1].replace(/\+/g, ' '));
return value;
}
function logError(error) {
if (window.console) {
console.log(error);
}
}
// descending date-ordered list
function sortGames(games) {
var sortedGames = games.sort(function(a,b) {
var first = a.msSinceEpoch ? a.msSinceEpoch : 0;
var second = b.msSinceEpoch ? b.msSinceEpoch : 0;
return second - first;
});
return sortedGames;
}
function collectGameIds(games) {
var gameIds = [];
$.each(games, function() {
gameIds.push(this.gameId);
});
return gameIds;
}
//answer an array of object: {id: 'TOURNAMENT-Centex-2012', name: 'Centex', year: 2012, games:['game1234', 'game345']} in reverse chrono order
function getTournaments(games) {
var tournamentsList = [];
if (games && games.length > 0) {
var sortedGames = sortGames(games);
var tournamentGames = {};
jQuery.each(sortedGames, function() {
var name = this.tournamentName;
if (name) {
var year = this.msSinceEpoch ? new Date(this.msSinceEpoch).getFullYear() : '';
var id = 'TOURNAMENT-' + name + '-' + year;
if (!tournamentGames[id]) {
tournamentGames[id] = [];
tournamentsList.push({id: id, name: name, year: year});
}
tournamentGames[id].push(this.gameId);
}
});
jQuery.each(tournamentsList, function() {
this.games = tournamentGames[this.id];
});
return tournamentsList;
}
return [];
}
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1 (indicating the use of another browser).
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat(RegExp.$1);
}
return rv;
}
function log(message) {
if (window.console) {
console.log(message);
}
}
function isNullOrEmpty(s) {
return s == null || jQuery.trim(s) == '';
}
function busyDialogStart() {
Ultimate.busyDialogStack++;
if (Ultimate.busyDialogStack == 1) {
$('.hideWhenBusy').addClass('hidden');
$('.spinner').removeClass('hidden');
}
}
function busyDialogEnd() {
Ultimate.busyDialogStack--;
if (Ultimate.busyDialogStack == 0) {
resetBusyDialog();
}
}
function resetBusyDialog() {
$('.spinner').addClass('hidden');
showHiddenWhenBusyElements();
Ultimate.busyDialogStack == 0;
}
/*
Creates a canonical string representation of the object which can be used for comparison or subsequent hash creation.
The object will be deeply recursed to find all objects.
Circular references are handled automatically (an object will not be re-visited once it has been handled).
Thread-safe (designed to be a singleton)
*/
Ultimate.Canonicalizer = function () {
/*
Return a canonical string of the object.
Undefined properties are skipped.
options: {
treatNullAsUndefined: boolean By default NULL properties will be written. To treat nulls like undefined specify treatNullAsUndefined
treatEmptyStringsAsUndefined: boolean By default empty string properties will be written. To treat empty strings like undefined specify treatEmptyStringsAsUndefined
<propertyName>: boolean By default all other properties of an object are navigated. To ignore a certain property add it to the options with value of true.
*/
this.toCanonicalString = function (object, options) {
var allProps = [];
var visitedObjects = [];
pushObject(object, allProps, options, 0, visitedObjects);
return allProps.join("");
};
function pushObject(obj, allProps, options, level, visitedObjects) {
if (typeof obj == 'object' && obj != null) {
var visitedReference = getVisitedReference(obj, visitedObjects);
if (visitedReference) {
allProps[allProps.length] = visitedReference;
} else {
visitedObjects.push(obj);
var props = [];
for (var prop in obj) {
props.push(prop);
}
props = props.sort();
for (var i = 0; i < props.length; i++) {
var childObj = obj[props[i]];
if (shouldPush(childObj, options, props[i])) {
allProps[allProps.length] = '\n';
for (var j = 0; j < level; j++) {
allProps[allProps.length] = '.';
}
allProps[allProps.length] = props[i];
allProps[allProps.length] = ':';
pushObject(childObj, allProps, options, level + 1, visitedObjects);
}
}
}
} else {
allProps[allProps.length] = obj == null ? 'null' : obj;
}
}
function shouldPush(value, options, propName) {
if (propName && options[propName]) {
return false;
} else if (typeof value == 'function' || value === undefined) {
return false;
} else if (options.treatNullAsUndefined && value === null) {
return false;
} else if (options.treatEmptyStringsAsUndefined && value == '') {
return false;
}
return true;
}
function getVisitedReference(object, visitedObjects) {
for (var i = 0; i < visitedObjects.length; i++) {
if (visitedObjects[i] === object) {
return '@REF' + i;
}
}
return null;
}
};
function showHiddenWhenBusyElements() {
$('.hideWhenBusy').removeClass('hidden');
}
function hideHiddenWhenBusyElements() {
$('.hideWhenBusy').addClass('hidden');
}
function addQueryStringParameter(url, key, value) {
return url + (url.indexOf('?') > 0 ? '&' : '?') + key + '=' + value;
}
function resetCacheBuster() {
Ultimate.sessionId = new Date().getTime() + '';
}
function sendAnalyticsEvent(restEndpointName) {
// NOTE: You can add another property for more detail
_gaq.push(['_trackEvent', Ultimate.isAdminSite ? 'WebRestRequest-Admin' : 'WebRestRequest', restEndpointName]);
}
| 36.650655 | 170 | 0.676814 |
b81a22593d17a81bb687edf7c441cb935682f628 | 429 | js | JavaScript | vet_care/public/js/vital_signs.js | neerajvkn/vet_care | 14914b22e7a83265d736f9f9dc5186271ae62d66 | [
"MIT"
] | 2 | 2020-11-23T11:14:32.000Z | 2021-02-03T06:40:33.000Z | vet_care/public/js/vital_signs.js | neerajvkn/vet_care | 14914b22e7a83265d736f9f9dc5186271ae62d66 | [
"MIT"
] | null | null | null | vet_care/public/js/vital_signs.js | neerajvkn/vet_care | 14914b22e7a83265d736f9f9dc5186271ae62d66 | [
"MIT"
] | 7 | 2019-11-16T14:36:33.000Z | 2021-08-25T07:54:51.000Z | frappe.ui.form.on('Vital Signs', {
refresh: function(frm) {
if (frm.doc.docstatus) {
_make_encounter_btn(frm);
}
}
});
function _make_encounter_btn(frm) {
frm.add_custom_button('Make Encounter', () => {
frappe.route_options = {
patient: frm.doc.patient,
encounter_date: frm.doc.signs_date,
};
frappe.new_doc('Patient Encounter');
});
}
| 23.833333 | 51 | 0.564103 |
b81b2915cbd46b7c780c197482e3aeee87b4a3f7 | 259 | js | JavaScript | angular/services/component-config.service.js | magnolo/together | 429142acf4e700b5c9b4646e5c4001c738a23639 | [
"MIT"
] | null | null | null | angular/services/component-config.service.js | magnolo/together | 429142acf4e700b5c9b4646e5c4001c738a23639 | [
"MIT"
] | null | null | null | angular/services/component-config.service.js | magnolo/together | 429142acf4e700b5c9b4646e5c4001c738a23639 | [
"MIT"
] | null | null | null | export class ComponentConfigService{
constructor($translatePartialLoader){
'ngInject';
//
this.$translateLoader = $translatePartialLoader;
}
translate(part){
this.$translatePartialLoader.addPart(part);
}
}
| 18.5 | 56 | 0.637066 |
b81c8dbd75388959f98f871f031e4ede7358073b | 365 | js | JavaScript | server/config/development.js | a307625/apiserver | f1859bd64c06d59eba69be7a201b69ccf35149fc | [
"MIT"
] | null | null | null | server/config/development.js | a307625/apiserver | f1859bd64c06d59eba69be7a201b69ccf35149fc | [
"MIT"
] | null | null | null | server/config/development.js | a307625/apiserver | f1859bd64c06d59eba69be7a201b69ccf35149fc | [
"MIT"
] | null | null | null |
const config = {
port: process.env.PORT || 3000,
jwt: {
jwtSecret: 'secretkey',// process.env.JWT_SECRET,
jwtTokenExpiresIn: '5 days',
emailTokenExpiresIn: '1 days'
},
apiversion: 'v1',
hostUrl: 'http://localhost:3000',
databaseURI: 'mongodb://127.0.0.1:27017/apiserver',
databaseOption: null,
usrtID: null,
}
export default config
| 18.25 | 53 | 0.660274 |
b81e225681b6e455522214fb156ca351696773f1 | 204 | js | JavaScript | app/components/DeleteButton/index.js | richarddowdy/dmi-word | 101ff0c5e9a8dafd3751f561c4d5c652e15470b4 | [
"MIT"
] | null | null | null | app/components/DeleteButton/index.js | richarddowdy/dmi-word | 101ff0c5e9a8dafd3751f561c4d5c652e15470b4 | [
"MIT"
] | 3 | 2020-07-20T15:18:00.000Z | 2022-03-26T16:09:12.000Z | app/components/DeleteButton/index.js | richarddowdy/dmi-word | 101ff0c5e9a8dafd3751f561c4d5c652e15470b4 | [
"MIT"
] | 1 | 2020-05-08T01:26:04.000Z | 2020-05-08T01:26:04.000Z | import styled from 'styled-components';
const DeleteButton = styled.button`
height: 30px;
width: 30px;
border-radius: 100%;
border: solid 2px grey;
color: red;
`;
export default DeleteButton;
| 17 | 39 | 0.715686 |
b81ef56badd9810ddbd34a6f78690658d4321150 | 1,882 | js | JavaScript | src/containers/ListingPage/SectionManagedBy.js | leoChronos/ftw-hourly | 44a4531542eea448b9017ff95725edeede97c07e | [
"Apache-2.0"
] | null | null | null | src/containers/ListingPage/SectionManagedBy.js | leoChronos/ftw-hourly | 44a4531542eea448b9017ff95725edeede97c07e | [
"Apache-2.0"
] | null | null | null | src/containers/ListingPage/SectionManagedBy.js | leoChronos/ftw-hourly | 44a4531542eea448b9017ff95725edeede97c07e | [
"Apache-2.0"
] | null | null | null | import React from 'react';
import { FormattedMessage } from '../../util/reactIntl';
import { ExternalLink, IconSocialMediaFacebook, IconSocialMediaInstagram, AvatarMedium } from '../../components';
import { instagramPageURL } from '../../util/urlHelpers';
import css from './ListingPage.css';
const SectionManagedBy = props => {
const { user } = props;
const facebookLink = user.attributes.profile.publicData ? user.attributes.profile.publicData.facebook : null;
const instagramHandle = user.attributes.profile.publicData ? user.attributes.profile.publicData.instagram : null;
return (
<div className={css.sectionManagedBy}>
<h2 className={css.managedByHeading}>
<FormattedMessage id="ListingPage.managedByHeading" />
</h2>
<div className={css.areaAvatarManagedBy}>
<AvatarMedium user={user} className={css.avatarManagedBy} disableProfileLink />
</div>
<div className={css.managedByContact}>
<h2>{user.attributes.profile.displayName}</h2>
<h3>Contact</h3>
{ facebookLink ?
<ExternalLink
key="linkToFacebook"
href={facebookLink}
className={css.socialIcon}
title="Facebook"
>
<IconSocialMediaFacebook />
<span className={css.socialFacebook}>Facebook</span>
</ExternalLink>
: null
}
{ instagramHandle ?
<ExternalLink
key="linkToInstagram"
href={instagramPageURL(instagramHandle)}
className={css.socialIcon}
title="Instagram"
>
<IconSocialMediaInstagram />
<span className={css.socialInstagram}>Instagram</span>
</ExternalLink>
: null
}
</div>
</div>
);
};
export default SectionManagedBy;
| 34.218182 | 117 | 0.608395 |
b81f9b98ba0fdd3e6cbc20a1f4b4cedb46c518f2 | 324 | js | JavaScript | lib/dispatch.js | guerrerocarlos/serverless-http | a3c32092e572416bf8a9f059a4cb8004a3299ebf | [
"MIT"
] | 1 | 2020-12-15T06:25:28.000Z | 2020-12-15T06:25:28.000Z | lib/dispatch.js | guerrerocarlos/serverless-http | a3c32092e572416bf8a9f059a4cb8004a3299ebf | [
"MIT"
] | null | null | null | lib/dispatch.js | guerrerocarlos/serverless-http | a3c32092e572416bf8a9f059a4cb8004a3299ebf | [
"MIT"
] | 2 | 2020-05-01T15:47:11.000Z | 2021-08-10T10:59:58.000Z | 'use strict';
module.exports = function dispatch(promise, callback) {
if (callback) {
promise.then(result => {
process.nextTick(() => {
callback(null, result);
});
})
.catch(e => {
process.nextTick(() => {
callback(e);
});
});
return;
}
return promise;
}
| 15.428571 | 55 | 0.5 |
b81fa21ad7d2ac959ced67591b411dbdb4c2d7b3 | 2,933 | js | JavaScript | react/features/video-menu/components/web/LocalVideoMenuTriggerButton.js | benmoumene/jitsi-meet | b826fc1d5a5cdcdc3ef57888f20230a29bb94382 | [
"Apache-2.0"
] | 5 | 2021-06-23T14:01:48.000Z | 2022-03-10T02:00:16.000Z | react/features/video-menu/components/web/LocalVideoMenuTriggerButton.js | benmoumene/jitsi-meet | b826fc1d5a5cdcdc3ef57888f20230a29bb94382 | [
"Apache-2.0"
] | 23 | 2021-04-22T16:29:55.000Z | 2021-07-27T07:57:55.000Z | react/features/video-menu/components/web/LocalVideoMenuTriggerButton.js | benmoumene/jitsi-meet | b826fc1d5a5cdcdc3ef57888f20230a29bb94382 | [
"Apache-2.0"
] | 2 | 2021-05-19T07:28:35.000Z | 2021-05-19T10:05:46.000Z | // @flow
import React from 'react';
import { Icon, IconMenuThumb } from '../../../base/icons';
import { Popover } from '../../../base/popover';
import { connect } from '../../../base/redux';
import { getLocalVideoTrack } from '../../../base/tracks';
import { getCurrentLayout, LAYOUTS } from '../../../video-layout';
import FlipLocalVideoButton from './FlipLocalVideoButton';
import VideoMenu from './VideoMenu';
/**
* The type of the React {@code Component} props of
* {@link LocalVideoMenuTriggerButton}.
*/
type Props = {
/**
* The position relative to the trigger the local video menu should display
* from. Valid values are those supported by AtlasKit
* {@code InlineDialog}.
*/
_menuPosition: string,
/**
* Whether to display the Popover as a drawer.
*/
_overflowDrawer: boolean,
/**
* Shows/hides the local video flip button.
*/
_showLocalVideoFlipButton: boolean
};
/**
* React Component for displaying an icon associated with opening the
* the video menu for the local participant.
*
* @param {Props} props - The props passed to the component.
* @returns {ReactElement}
*/
function LocalVideoMenuTriggerButton(props: Props) {
return (
props._showLocalVideoFlipButton
? <Popover
content = {
<VideoMenu id = 'localVideoMenu'>
<FlipLocalVideoButton />
</VideoMenu>
}
overflowDrawer = { props._overflowDrawer }
position = { props._menuPosition }>
<span
className = 'popover-trigger local-video-menu-trigger'>
<Icon
size = '1em'
src = { IconMenuThumb }
title = 'Local user controls' />
</span>
</Popover>
: null
);
}
/**
* Maps (parts of) the Redux state to the associated {@code LocalVideoMenuTriggerButton}'s props.
*
* @param {Object} state - The Redux state.
* @private
* @returns {Props}
*/
function _mapStateToProps(state) {
const currentLayout = getCurrentLayout(state);
const { disableLocalVideoFlip } = state['features/base/config'];
const videoTrack = getLocalVideoTrack(state['features/base/tracks']);
const { overflowDrawer } = state['features/toolbox'];
let _menuPosition;
switch (currentLayout) {
case LAYOUTS.TILE_VIEW:
_menuPosition = 'left-start';
break;
case LAYOUTS.VERTICAL_FILMSTRIP_VIEW:
_menuPosition = 'left-end';
break;
default:
_menuPosition = 'auto';
}
return {
_menuPosition,
_showLocalVideoFlipButton: !disableLocalVideoFlip && videoTrack?.videoType !== 'desktop',
_overflowDrawer: overflowDrawer
};
}
export default connect(_mapStateToProps)(LocalVideoMenuTriggerButton);
| 29.039604 | 97 | 0.603137 |
b81fdaf47aed305e6253d2801eb80f94d0bb864d | 123 | js | JavaScript | src/components/article.js | Inno-web/inno-website | a8901014aba0bfb591e66822e24561838a33d450 | [
"MIT"
] | null | null | null | src/components/article.js | Inno-web/inno-website | a8901014aba0bfb591e66822e24561838a33d450 | [
"MIT"
] | null | null | null | src/components/article.js | Inno-web/inno-website | a8901014aba0bfb591e66822e24561838a33d450 | [
"MIT"
] | null | null | null | import React from 'react';
const article = () => {
return (
<div>
</div>
);
};
export default article; | 11.181818 | 26 | 0.520325 |
b81ffed122551434c1a4e818601ace03266453af | 677 | js | JavaScript | src/overmind/view/state.js | trellisfw/reagan | 8937bf84e854fd0ce850d4f57ef886a1441938b1 | [
"Apache-2.0"
] | null | null | null | src/overmind/view/state.js | trellisfw/reagan | 8937bf84e854fd0ce850d4f57ef886a1441938b1 | [
"Apache-2.0"
] | null | null | null | src/overmind/view/state.js | trellisfw/reagan | 8937bf84e854fd0ce850d4f57ef886a1441938b1 | [
"Apache-2.0"
] | null | null | null | import _ from 'lodash'
export default {
Pages: {
selectedPage: 'Data',
Data: {
search: '',
openFileBrowser: false,
uploading: {}
}
},
Modals: {
VerifiedModal: {
open: false,
showData: false,
data: ({}, state) => {
return state.app.verifyIntegrity.original
},
path: ({}, state) => {
return state.app.resourcePath
},
type: ({}, state) => {
const type = _.get(state, 'app.original._type');
if (type == "application/vnd.trellisfw.audit.sqfi.1+json") return "audit";
if (type == "application/vnd.trellisfw.coi.accord+json") return "coi";
}
}
}
}
| 22.566667 | 82 | 0.531758 |
b820685f1b8368a1e18b7211e928df72b597d7a9 | 1,053 | js | JavaScript | src/js/inject.js | noraworld/no-more-referrer | 7b614fcda7e4a906e12ce0825c85c122dfae302f | [
"MIT"
] | null | null | null | src/js/inject.js | noraworld/no-more-referrer | 7b614fcda7e4a906e12ce0825c85c122dfae302f | [
"MIT"
] | null | null | null | src/js/inject.js | noraworld/no-more-referrer | 7b614fcda7e4a906e12ce0825c85c122dfae302f | [
"MIT"
] | null | null | null | (() => {
'use strict';
chrome.storage.sync.get(function(storage) {
let execFlag = true;
if (storage.excludeURL !== undefined) {
for (var i = 0; i < storage.excludeURL.length; i++) {
if (parseURL(location.href).match(RegExp(parseURL(storage.excludeURL[i])))) {
execFlag = false;
}
}
}
if (execFlag) {
disableReferrer();
}
});
function disableReferrer() {
let meta = document.createElement('meta');
meta.name = "referrer";
meta.content = "no-referrer";
document.head.appendChild(meta);
}
function parseURL(url) {
// cut 'http' or 'https'
// http://www.example.com => www.example.com
// https://www.example.com => www.example.com
url = url.replace(/^https?:\/\//g, '');
// cut trailing slash
// example.com/foo/bar/ => example.com/foo/bar
url = (url[url.length-1] === '/') ? url.substr(0, url.length-1) : url;
return url;
}
chrome.runtime.sendMessage({referrer: document.referrer}, function(response) {});
})();
| 25.071429 | 85 | 0.578348 |
b820d892ebdb8eec28cf9457823e79ae177e2cb4 | 8,952 | js | JavaScript | .eslintrc.js | zokito/sfdx-git-delta | 00ceeb88c858e57c9d3c228be5daceef3b7224f1 | [
"MIT"
] | 182 | 2019-07-20T18:18:06.000Z | 2022-03-30T12:25:22.000Z | .eslintrc.js | zokito/sfdx-git-delta | 00ceeb88c858e57c9d3c228be5daceef3b7224f1 | [
"MIT"
] | 248 | 2019-07-24T12:40:38.000Z | 2022-03-31T21:29:49.000Z | .eslintrc.js | zokito/sfdx-git-delta | 00ceeb88c858e57c9d3c228be5daceef3b7224f1 | [
"MIT"
] | 64 | 2019-07-25T14:35:33.000Z | 2022-03-24T14:50:19.000Z | /*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! 💖
*/
module.exports = {
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'prettier'],
ignorePatterns: ['lib/**/*', 'node_modules', '.next', 'output', 'coverage'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['prettier'],
rules: {
'@typescript-eslint/brace-style': 'off',
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/comma-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/keyword-spacing': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/no-extra-parens': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/object-curly-spacing': 'off',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/semi': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/space-infix-ops': 'off',
'@typescript-eslint/type-annotation-spacing': 'off',
'array-bracket-newline': 'off',
'array-bracket-spacing': 'off',
'array-element-newline': 'off',
'arrow-body-style': 'off',
'arrow-parens': 'off',
'arrow-spacing': 'off',
'babel/object-curly-spacing': 'off',
'babel/quotes': 'off',
'babel/semi': 'off',
'block-spacing': 'off',
'brace-style': 'off',
'comma-dangle': 'off',
'comma-spacing': 'off',
'comma-style': 'off',
'computed-property-spacing': 'off',
'constructor-super': 'error',
curly: 'off',
'dot-location': 'off',
'eol-last': 'off',
'flowtype/boolean-style': 'off',
'flowtype/delimiter-dangle': 'off',
'flowtype/generic-spacing': 'off',
'flowtype/object-type-curly-spacing': 'off',
'flowtype/object-type-delimiter': 'off',
'flowtype/semi': 'off',
'flowtype/space-after-type-colon': 'off',
'flowtype/space-before-generic-bracket': 'off',
'flowtype/space-before-type-colon': 'off',
'flowtype/union-intersection-spacing': 'off',
'for-direction': 'error',
'func-call-spacing': 'off',
'function-call-argument-newline': 'off',
'function-paren-newline': 'off',
'generator-star': 'off',
'generator-star-spacing': 'off',
'getter-return': 'error',
'implicit-arrow-linebreak': 'off',
indent: 'off',
'indent-legacy': 'off',
'jsx-quotes': 'off',
'key-spacing': 'off',
'keyword-spacing': 'off',
'linebreak-style': 'off',
'lines-around-comment': 'off',
'max-len': 'off',
'multiline-ternary': 'off',
'new-parens': 'off',
'newline-per-chained-call': 'off',
'no-arrow-condition': 'off',
'no-async-promise-executor': 'error',
'no-case-declarations': 'error',
'no-class-assign': 'error',
'no-comma-dangle': 'off',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-confusing-arrow': 'off',
'no-const-assign': 'error',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-delete-var': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty': 'error',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-parens': 'off',
'no-extra-semi': 'off',
'no-fallthrough': 'error',
'no-floating-decimal': 'off',
'no-func-assign': 'error',
'no-global-assign': 'error',
'no-import-assign': 'error',
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-misleading-character-class': 'error',
'no-mixed-operators': 'off',
'no-mixed-spaces-and-tabs': 'off',
'no-multi-spaces': 'off',
'no-multiple-empty-lines': 'off',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
'no-octal': 'error',
'no-prototype-builtins': 'error',
'no-redeclare': 'error',
'no-regex-spaces': 'error',
'no-reserved-keys': 'off',
'no-self-assign': 'error',
'no-setter-return': 'error',
'no-shadow-restricted-names': 'error',
'no-space-before-semi': 'off',
'no-spaced-func': 'off',
'no-sparse-arrays': 'error',
'no-tabs': 'off',
'no-this-before-super': 'error',
'no-trailing-spaces': 'off',
'no-undef': 'error',
'no-unexpected-multiline': 'off',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unused-labels': 'error',
'no-unused-vars': 'error',
'no-useless-catch': 'error',
'no-useless-escape': 'error',
'no-whitespace-before-property': 'off',
'no-with': 'error',
'no-wrap-func': 'off',
'nonblock-statement-body-position': 'off',
'object-curly-newline': 'off',
'object-curly-spacing': 'off',
'object-property-newline': 'off',
'one-var-declaration-per-line': 'off',
'operator-linebreak': 'off',
'padded-blocks': 'off',
'prefer-arrow-callback': 'off',
'prettier/prettier': 'error',
'quote-props': 'off',
quotes: 'off',
'react/jsx-child-element-spacing': 'off',
'react/jsx-closing-bracket-location': 'off',
'react/jsx-closing-tag-location': 'off',
'react/jsx-curly-newline': 'off',
'react/jsx-curly-spacing': 'off',
'react/jsx-equals-spacing': 'off',
'react/jsx-first-prop-new-line': 'off',
'react/jsx-indent': 'off',
'react/jsx-indent-props': 'off',
'react/jsx-max-props-per-line': 'off',
'react/jsx-newline': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-multi-spaces': 'off',
'react/jsx-space-before-closing': 'off',
'react/jsx-tag-spacing': 'off',
'react/jsx-wrap-multilines': 'off',
'require-yield': 'error',
'rest-spread-spacing': 'off',
semi: 'off',
'semi-spacing': 'off',
'semi-style': 'off',
'space-after-function-name': 'off',
'space-after-keywords': 'off',
'space-before-blocks': 'off',
'space-before-function-paren': 'off',
'space-before-function-parentheses': 'off',
'space-before-keywords': 'off',
'space-in-brackets': 'off',
'space-in-parens': 'off',
'space-infix-ops': 'off',
'space-return-throw-case': 'off',
'space-unary-ops': 'off',
'space-unary-word-ops': 'off',
'standard/array-bracket-even-spacing': 'off',
'standard/computed-property-even-spacing': 'off',
'standard/object-curly-even-spacing': 'off',
'switch-colon-spacing': 'off',
'template-curly-spacing': 'off',
'template-tag-spacing': 'off',
'unicode-bom': 'off',
'unicorn/empty-brace-spaces': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/number-literal-case': 'off',
'use-isnan': 'error',
'valid-typeof': 'error',
'vue/array-bracket-newline': 'off',
'vue/array-bracket-spacing': 'off',
'vue/arrow-spacing': 'off',
'vue/block-spacing': 'off',
'vue/block-tag-newline': 'off',
'vue/brace-style': 'off',
'vue/comma-dangle': 'off',
'vue/comma-spacing': 'off',
'vue/comma-style': 'off',
'vue/dot-location': 'off',
'vue/func-call-spacing': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/html-closing-bracket-spacing': 'off',
'vue/html-end-tags': 'off',
'vue/html-indent': 'off',
'vue/html-quotes': 'off',
'vue/html-self-closing': 'off',
'vue/key-spacing': 'off',
'vue/keyword-spacing': 'off',
'vue/max-attributes-per-line': 'off',
'vue/max-len': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/mustache-interpolation-spacing': 'off',
'vue/no-extra-parens': 'off',
'vue/no-multi-spaces': 'off',
'vue/no-spaces-around-equal-signs-in-attribute': 'off',
'vue/object-curly-newline': 'off',
'vue/object-curly-spacing': 'off',
'vue/object-property-newline': 'off',
'vue/operator-linebreak': 'off',
'vue/script-indent': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/space-in-parens': 'off',
'vue/space-infix-ops': 'off',
'vue/space-unary-ops': 'off',
'vue/template-curly-spacing': 'off',
'wrap-iife': 'off',
'wrap-regex': 'off',
'yield-star-spacing': 'off',
},
env: {
browser: false,
commonjs: true,
es6: true,
node: true,
jest: true,
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
}
| 34.298851 | 85 | 0.608467 |
b820d9e9ef3cfb06a111ecc7c225ea782b082ec1 | 386 | js | JavaScript | src/reducers/category.js | xintai404/Readable | 255c0da20897c5342b9f2dade65cb7ea835934fe | [
"MIT"
] | null | null | null | src/reducers/category.js | xintai404/Readable | 255c0da20897c5342b9f2dade65cb7ea835934fe | [
"MIT"
] | null | null | null | src/reducers/category.js | xintai404/Readable | 255c0da20897c5342b9f2dade65cb7ea835934fe | [
"MIT"
] | null | null | null | import {
SELECT_CATEGORY,
SET_CATEGORIES,
} from '../actions/type'
export function selectCategory(state="all", action){
switch(action.type){
case SELECT_CATEGORY:
return action.selectCategory
default:
return 'all'
}
}
export function categories(state=[], action){
switch(action.type){
case SET_CATEGORIES:
return action.categories
default:
return state
}
} | 17.545455 | 52 | 0.720207 |
b821fbaf19654203fdd2ccc6d02aa7ffd329628e | 7,469 | js | JavaScript | safeSort.js | prettydiff/safeSort | fda06ed01e0bf89cb958589533809a9c966b958e | [
"MIT"
] | null | null | null | safeSort.js | prettydiff/safeSort | fda06ed01e0bf89cb958589533809a9c966b958e | [
"MIT"
] | null | null | null | safeSort.js | prettydiff/safeSort | fda06ed01e0bf89cb958589533809a9c966b958e | [
"MIT"
] | null | null | null | /*global define, exports*/
/*
Just a simple array sort scheme. The provided sorting accounts for values and types.
It only takes three parameters:
* array - an actual array to pass in
* operation - what kind of sort do you want? Three modes supported:
- "normal" - will normalize (remove redundant values) from the array
- "descend" - will order the array from greatest values to lowest values
- "ascend" - will order the array from lowest valus to greatest values
* recursive - accepts a boolean and defaults to false. If true then any indexes
that contain arrays will be independently sorted and returned into their
proper location
The operation parameter is optional. If not specified the value "ascend"
will be assumed.
How the algorithm works:
1) Walk the entire array looking the lowest value and lowest type and count the
instances.
2) Use a temporary array to note which index(es) of the original array contain this lowest value
3) Keep aware of the length of low values in a closure... variable c
4) Swap the values of the first c indexes with those in the temporary array.
5) Do it all over again until c is the length of the array with one exception:
* Start walking the array from index c at each recursive pass.
Enjoy and visit http://prettydiff.com/
MIT license
Copyright 2015 Austin Cheney
*/
var safeSort = function (array, operation, recursive) {
"use strict";
var arTest = function (item) {
if (typeof item !== "object" || item.length === undefined || item.length < 2) {
return false;
}
return true;
},
normal = function (item) {
var done = [item[0]],
storeb = item,
child = function () {
var a = 0,
len = storeb.length;
for (a = 0; a < len; a += 1) {
if (arTest(storeb[a]) === true) {
storeb[a] = normal(storeb[a]);
}
}
},
recurse = function (x) {
var a = 0,
storea = [],
len = storeb.length;
for (a = 0; a < len; a += 1) {
if (storeb[a] !== x) {
storea.push(storeb[a]);
}
}
storeb = storea;
if (storea.length > 0) {
done.push(storea[0]);
recurse(storea[0]);
} else {
if (recursive === true) {
child();
}
item = storeb;
}
};
recurse(array[0]);
},
descend = function (item) {
var c = 0,
storeb = item,
len = item.length,
child = function () {
var a = 0,
lenc = storeb.length;
for (a = 0; a < lenc; a += 1) {
if (arTest(storeb[a]) === true) {
storeb[a] = descend(storeb[a]);
}
}
},
recurse = function () {
var a = 0,
b = 0,
d = 0,
e = 0,
ind = [],
key = storeb[c];
for (a = c; a < len; a += 1) {
if (storeb[a] > key || typeof storeb[a] > typeof key) {
key = storeb[a];
ind = [a];
} else if (storeb[a] === key) {
ind.push(a);
}
}
d = ind.length;
b = d + c;
for (a = c; a < b; a += 1) {
storeb[ind[e]] = storeb[a];
storeb[a] = key;
e += 1;
}
c += d;
if (c < len) {
recurse();
} else {
if (recursive === true) {
child();
}
item = storeb;
}
};
recurse();
return item;
},
ascend = function (item) {
var c = 0,
storeb = item,
len = item.length,
child = function () {
var a = 0,
lenc = storeb.length;
for (a = 0; a < lenc; a += 1) {
if (arTest(storeb[a]) === true) {
storeb[a] = ascend(storeb[a]);
}
}
},
recurse = function () {
var a = 0,
b = 0,
d = 0,
e = 0,
ind = [],
key = storeb[c];
for (a = c; a < len; a += 1) {
if (storeb[a] < key || typeof storeb[a] < typeof key) {
key = storeb[a];
ind = [a];
} else if (storeb[a] === key) {
ind.push(a);
}
}
d = ind.length;
b = d + c;
for (a = c; a < b; a += 1) {
storeb[ind[e]] = storeb[a];
storeb[a] = key;
e += 1;
}
c += d;
if (c < len) {
recurse();
} else {
if (recursive === true) {
child();
}
item = storeb;
}
};
recurse();
return item;
};
if (arTest(array) === false) {
return array;
}
if (recursive === "true") {
recursive = true;
} else if (recursive !== true) {
recursive = false;
}
if (operation === "normal") {
return normal(array);
}
if (operation === "descend") {
return descend(array);
}
return ascend(array);
};
if (typeof exports === "object" || typeof exports === "function") { //commonjs and nodejs support
exports.safeSort = function commonjs(array, operation) {
"use strict";
return safeSort(array, operation);
};
} else if (typeof define === "object" || typeof define === "function") { //requirejs support
define(function requirejs(require, exports) {
"use strict";
exports.safeSort = function requirejs_export(array, operation) {
return safeSort(array, operation);
}; //worthless if block to appease RequireJS and JSLint
if (typeof require === "number") {
return require;
}
return exports.safeSort;
});
}
| 35.908654 | 97 | 0.377159 |
b8228436c6a0a326ab46208680e70d7b08c32e99 | 5,966 | js | JavaScript | src/app/layouts/MenuLayout.js | doalef/figaro | 2b733cf062459a40445350144faf6157fd775acc | [
"MIT"
] | null | null | null | src/app/layouts/MenuLayout.js | doalef/figaro | 2b733cf062459a40445350144faf6157fd775acc | [
"MIT"
] | 3 | 2022-02-13T09:27:19.000Z | 2022-02-27T02:04:12.000Z | src/app/layouts/MenuLayout.js | doalef/figaro | 2b733cf062459a40445350144faf6157fd775acc | [
"MIT"
] | null | null | null | import React from "react";
import { Link, withRouter, Redirect } from "react-router-dom";
import { connect } from "react-redux";
import { Layout, Menu, Avatar, Dropdown, PageHeader } from "antd";
import { MenuUnfoldOutlined, MenuFoldOutlined, PoweroffOutlined } from "@ant-design/icons";
import items from "../../_nav.js";
import routes from "../../routes";
const { Header, Content, Sider } = Layout;
class MenuLayout extends React.Component {
constructor(props) {
super(props);
this.state = {
collapsed: false,
broken: false,
crumbs: this.getCrumbs(this.props.match)
};
}
getCrumbs(match) {
return routes
.filter(({ path }) => match.path.includes(path))
.map(({ path, ...rest }) => ({
path: Object.keys(match.params).length
? Object.keys(match.params).reduce(
(path, param) => path.replace(`:${param}`, match.params[param]),
path
)
: path,
breadcrumbName: rest.name
}));
}
toggle = () => {
this.setState({
collapsed: !this.state.collapsed
});
};
renderMenuItems() {
return items.map((item, index) => {
if (item.items)
return (
<Menu.SubMenu
key={index}
title={
<span>
{React.cloneElement(item.icon, {})}
<span className="nav-text">{item.title}</span>
</span>
}>
{item.items.map((i, key) => {
return (
<Menu.Item key={index}>
<Link to={i.url}>
{React.cloneElement(i.icon, {})}
<span className="nav-text">{i.title}</span>
</Link>
</Menu.Item>
);
})}
</Menu.SubMenu>
);
else
return (
<Menu.Item key={index}>
<Link to={item.url}>
{React.cloneElement(item.icon, {})}
<span className="nav-text">{item.title}</span>
</Link>
</Menu.Item>
);
});
}
overlay() {
return (
<Menu>
<Menu.Item key="1">
<PoweroffOutlined />
Logout
</Menu.Item>
</Menu>
);
}
render() {
return (
<React.Fragment>
{!this.props.user && <Redirect to="/login" />}
<Layout style={{ height: "100vh" }}>
<Sider
breakpoint="sm"
zeroWidthTriggerStyle={{ display: "none" }}
onBreakpoint={broken => {
this.setState({ broken, collapsed: broken });
}}
collapsedWidth={this.state.broken ? 0 : 80}
collapsible
collapsed={this.state.collapsed}>
<div className="logo" />
<Menu theme={"dark"} mode="inline">
{this.renderMenuItems()}
</Menu>
</Sider>
<Layout>
<Header
style={{
padding: 0,
background: "white",
boxShadow: "0 1px 4px rgba(0,21,41,.08)"
}}>
<React.Fragment>
{React.createElement(
this.state.collapsed ? MenuUnfoldOutlined : MenuFoldOutlined,
{
className: "trigger",
onClick: this.toggle
}
)}
<div style={{ float: "right", paddingRight: 16 }}>
<Dropdown overlay={this.overlay()}>
<Avatar
size="large"
src="https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png"
/>
</Dropdown>
</div>
</React.Fragment>
</Header>
<PageHeader
style={{ background: "white" }}
breadcrumb={{ routes: this.state.crumbs }}
/>
<Content style={{ margin: "24px 16px 0" }}>
{this.props.children ? (
<div className="site-layout-content" style={{ padding: 24 }}>
{this.props.children}
</div>
) : null}
</Content>
</Layout>
</Layout>
</React.Fragment>
);
}
}
const mapDispatchToProps = () => {
return {};
};
const mapStateToProps = state => {
return {
user: state.user
};
};
export default connect(mapStateToProps, mapDispatchToProps())(withRouter(MenuLayout));
| 37.2875 | 128 | 0.354844 |
b82284c34ab89f7ccd0f3f0ae9d97a5cf96dd1d5 | 4,328 | js | JavaScript | src/binary-search-tree.js | IvanGerman/basic-js-ds | 1d1f1962dbf5865659a3c357ab21a245a40788f8 | [
"MIT"
] | null | null | null | src/binary-search-tree.js | IvanGerman/basic-js-ds | 1d1f1962dbf5865659a3c357ab21a245a40788f8 | [
"MIT"
] | null | null | null | src/binary-search-tree.js | IvanGerman/basic-js-ds | 1d1f1962dbf5865659a3c357ab21a245a40788f8 | [
"MIT"
] | null | null | null | const { NotImplementedError } = require('../extensions/index.js');
const { Node } = require('../extensions/list-tree.js');
/**
* Implement simple binary search tree according to task description
* using Node from extensions
*/
module.exports = class BinarySearchTree {
constructor() {
this.node = null;
}
root() {
return this.node
}
add( data ) {
if ( this.node === null ) {
this.node = new Node(data);
return;
};
let chosenNode = this.node;
// go through the nodes of the class instance
while (true) {
// 2 cases below will work when we are on the extreme/last node of the tree
if ( chosenNode.left === null && chosenNode.data > data ) {
chosenNode.left = new Node(data);
return;
} else if ( chosenNode.right === null && chosenNode.data < data ) {
chosenNode.right = new Node(data);
return;
}
// if there is more than just a parent node:
if ( chosenNode.data < data) {
chosenNode = chosenNode.right;
} else {
chosenNode = chosenNode.left;
};
}
}
find(data) {
let chosenNode = this.node;
if ( chosenNode === undefined ) { return null };
// go through the nodes of the class instance
while ( chosenNode ) {
if (data > chosenNode.data) {
chosenNode = chosenNode.right;
} else if (data < chosenNode.data) {
chosenNode = chosenNode.left;
} else if (data == chosenNode.data) {
return chosenNode;
}
}
return null;
}
has(data) {
return this.find(data) !== null;
}
remove(data) {
if ( this.has(data) ) {
this.node = replaceWithChild( this.node, data ); //change parent node property value
function replaceWithChild( node, data ) {
if ( node.data == data ) { // if there is just
if (node.right === null && node.left === null) { // a root node only
return null;
} else if ( node.left === null ) { // if there is a right node too
node = node.right;
return node; // parent node will be replaced with 'return node'= right child node
} else if (node.right === null) { // if there is a left node too
node = node.left; // left node got parent node now
return node; // parent node will be replaced with 'return node' = left child node
} else { // if node.right != null & node.left != null, both child nodes are there
if (node.right.left == null) { // if node.right left child does not exists
node.data = node.right.data; // parent node disappear and on his place now is the right child
node.right = node.right.right; // 'pool up' right childs
return node;
}
// if node.right left child does exists:
let smallestLeftChild = findSmallestLeftChild(node.right);
node = replaceWithChild(node, smallestLeftChild.data);// removing the smallest left child
node.data = smallestLeftChild.data; // the smallest left child go on the place of parent node
function findSmallestLeftChild(node) { // searching for the smallest left child of the
// parent right child branch
while (node.left) {
node = node.left; // 'pool up' left childs
};
return node;
};
return node;
};
};
if (node.data < data) {
node.right = replaceWithChild(node.right, data);
return node;
} else {
node.left = replaceWithChild(node.left, data);
return node;
};
};
};
}
min() {
let chosenNode = this.node;
while ( chosenNode.left ) {
chosenNode = chosenNode.left;
}
return chosenNode.data;
}
max() {
let chosenNode = this.node;
while ( chosenNode.right ) {
chosenNode = chosenNode.right;
}
return chosenNode.data;
}
} | 25.017341 | 108 | 0.526802 |
b822d9435ce8659d6f162b5c89085208e0eed55c | 10,984 | js | JavaScript | src/data/mock-data.js | ramseytisher/caretracker-mockup | 8b15a62f12da281de492f91d72769079d58b4b3d | [
"RSA-MD"
] | null | null | null | src/data/mock-data.js | ramseytisher/caretracker-mockup | 8b15a62f12da281de492f91d72769079d58b4b3d | [
"RSA-MD"
] | null | null | null | src/data/mock-data.js | ramseytisher/caretracker-mockup | 8b15a62f12da281de492f91d72769079d58b4b3d | [
"RSA-MD"
] | null | null | null | export const mockData = [
{
key: "1",
patient: "Ramsey Tisher",
healthConcerns: [
{
name: "Anxiety",
status: "Active",
onsetDate: "11/21/2017",
resolvedDate: "--",
expressedBy: "REED, LOUIE",
createdDateTime: "09/06/2019 17:00",
createdBy: "Penny Dubois",
updatedDateTime: "09/06/2019 18:09",
updatedBy: "Penny Dubois",
associatedGoals: [],
codifiedHealthConcern: "--",
comments: [
{
id: "1",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "2",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
],
},
{
name: "Chronic Knee Pain",
status: "Active",
onsetDate: "11/21/2017",
resolvedDate: "--",
expressedBy: "REED, LOUIE",
createdDateTime: "09/06/2019 17:00",
createdBy: "Penny Dubois",
updatedDateTime: "09/06/2019 18:09",
updatedBy: "Penny Dubois",
associatedGoals: [1],
codifiedHealthConcern: "--",
comments: [
{
id: "1",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "2",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
],
},
{
name: "Hypertension",
status: "Active",
onsetDate: "11/21/2017",
resolvedDate: "--",
expressedBy: "REED, LOUIE",
createdDateTime: "09/06/2019 17:00",
createdBy: "Penny Dubois",
updatedDateTime: "09/06/2019 18:09",
updatedBy: "Penny Dubois",
associatedGoals: [2],
codifiedHealthConcern: "--",
comments: [
{
id: "1",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "2",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
],
},
{
name: "Depression",
status: "Active",
onsetDate: "11/21/2017",
resolvedDate: "--",
expressedBy: "REED, LOUIE",
createdDateTime: "09/06/2019 17:00",
createdBy: "Penny Dubois",
updatedDateTime: "09/06/2019 18:09",
updatedBy: "Penny Dubois",
associatedGoals: [2],
codifiedHealthConcern: "--",
comments: [
{
id: "1",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "2",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
],
},
{
name: "No Access to Reliable Transportation",
status: "Active",
onsetDate: "11/21/2017",
resolvedDate: "--",
expressedBy: "REED, LOUIE",
createdDateTime: "09/06/2019 17:00",
createdBy: "Penny Dubois",
updatedDateTime: "09/06/2019 18:09",
updatedBy: "Penny Dubois",
associatedGoals: [2],
codifiedHealthConcern: "--",
comments: [
{
id: "1",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "2",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
],
},
],
goals: [
{
id: 1,
description: "Louie wants to be able to play with his grandchilren.",
longTerm: true,
other: false,
targetDate: "11/30/2019",
status: "In Progress",
owner: "REED, LOUIE",
progression: "Progressing",
discipline: "Medical, Behavioral, Patient",
progressionUpdated: "9/6/2019 12:05PM",
supportGoals: [2, 3],
comments: [
{
id: "1",
comment: "Comment related to goal.",
commentUser: "Penny Dubois",
commentDateTime: "09/10/2019 20:32",
},
{
id: "2",
comment: "Comment related to goal, more...",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to goal, even more ...",
commentUser: "Penny Dubois",
commentDateTime: "09/08/2019 20:32",
},
],
activities: [
{
description: "Hamstring stretches daily",
schedule: "1 times every 1 Days for 6 Months",
owner: "--",
discipline: "Physical Therapy, Patient",
},
{
description: "Walk for 30 minutes daily",
schedule: "1 times every 1 Days for 6 Months",
owner: "--",
discipline: "Physical Therapy, Patient",
},
],
},
{
id: 2,
description: "Improve knee pain",
targetDate: "11/01/2019",
status: "In Progress",
owner: "REED, LOUIE",
progression: "Progressing",
discipline: "Medical",
progressionUpdated: "9/6/2019 12:05PM",
comments: [
{
id: "1",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "2",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
],
activities: [
{
description: "Hamstring stretches daily",
schedule: "1 times every 1 Days for 6 Months",
owner: "--",
discipline: "Physical Therapy, Patient",
},
{
description: "Walk for 30 minutes daily",
schedule: "1 times every 1 Days for 6 Months",
owner: "--",
discipline: "Physical Therapy, Patient",
},
],
},
{
id: 3,
description: "Maintain a Healthy Blood Pressure",
targetDate: "12/31/2019",
status: "In Progress",
owner: "REED, LOUIE",
progression: "Regressing",
discipline: "Medical",
progressionUpdated: "10/9/2019 12:05PM",
comments: [
{
id: "1",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "2",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
],
activities: [
{
description: "Take Medication As Prescribed",
schedule: "No",
owner: "REED, LOUIE",
discipline: "Medical",
},
{
description: "Walk for 30 minutes daily",
schedule: "1 times every 1 Days for 6 Months",
owner: "--",
discipline: "Physical Therapy, Patient",
},
],
},
{
id: 4,
description: "Continue to play piano",
targetDate: "12/31/2019",
status: "In Progress",
other: true,
owner: "REED, LOUIE",
progression: "Progressing",
discipline: "Occupational Therapy",
progressionUpdated: "10/9/2019 12:05PM",
comments: [
{
id: "1",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "2",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
{
id: "3",
comment: "Comment related to health concern",
commentUser: "Penny Dubois",
commentDateTime: "09/09/2019 20:32",
},
],
activities: [
{
description: "Take Medication As Prescribed",
schedule: "No",
owner: "REED, LOUIE",
discipline: "Medical",
},
{
description: "Walk for 30 minutes daily",
schedule: "1 times every 1 Days for 6 Months",
owner: "--",
discipline: "Physical Therapy, Patient",
},
],
},
],
strengths: [
{ description: "Adaptable" },
{ description: "Adequate Decision-making Skills" },
{ description: "Stable Environment" },
{ description: "Taking Action for Personal Change" },
],
},
]
| 30.342541 | 77 | 0.474144 |
b82336ebe4c15fa03e64b0d494638f446745bd50 | 1,738 | js | JavaScript | src/17-:class.js | yutent/anot.js | ce9c8542a9b4251bdbcdb831683085784d24073c | [
"MIT"
] | 4 | 2019-01-15T11:07:47.000Z | 2020-01-07T02:24:55.000Z | src/17-:class.js | yutent/anot.js | ce9c8542a9b4251bdbcdb831683085784d24073c | [
"MIT"
] | null | null | null | src/17-:class.js | yutent/anot.js | ce9c8542a9b4251bdbcdb831683085784d24073c | [
"MIT"
] | null | null | null | //类名定义 :class="{xx: yy}" :class="xx"
Anot.directive('class', {
init: function(binding) {
binding.expr = binding.expr.replace(/\n/g, ' ').replace(/\s+/g, ' ')
if (binding.type === 'hover' || binding.type === 'active') {
var expr = new Function('return ' + binding.expr)()
//确保只绑定一次
if (!binding.hasBindEvent) {
var elem = binding.element
var $elem = Anot(elem)
var activate = 'mouseenter' //在移出移入时切换类名
var abandon = 'mouseleave'
if (binding.type === 'active') {
//在聚焦失焦中切换类名
elem.tabIndex = elem.tabIndex || -1
activate = 'mousedown'
abandon = 'mouseup'
var fn0 = $elem.bind('mouseleave', function() {
$elem.removeClass(expr)
})
}
}
var fn1 = $elem.bind(activate, function() {
$elem.addClass(expr)
})
var fn2 = $elem.bind(abandon, function() {
$elem.removeClass(expr)
})
binding.rollback = function() {
$elem.unbind('mouseleave', fn0)
$elem.unbind(activate, fn1)
$elem.unbind(abandon, fn2)
}
binding.hasBindEvent = true
}
},
update: function(val) {
if (this.type !== 'class') {
return
}
var obj = val
if (!obj || this.param)
return log(
'class指令语法错误 %c %s="%s"',
'color:#f00',
this.name,
this.expr
)
if (typeof obj === 'string') {
obj = {}
obj[val] = true
}
if (!Anot.isPlainObject(obj)) {
obj = obj.$model
}
for (var i in obj) {
this.element.classList.toggle(i, !!obj[i])
}
}
})
'hover,active'.replace(rword, function(name) {
directives[name] = directives['class']
})
| 24.478873 | 72 | 0.517837 |
b82521469941519cc76df9cad23c8fca244118a9 | 16,612 | js | JavaScript | src/iter/util.js | Saber-Team/SogouJS | 95f0e0b131d29d4a829a20d8d63a664b088cb089 | [
"MIT"
] | 2 | 2015-01-09T01:28:02.000Z | 2015-01-09T03:39:24.000Z | src/iter/util.js | Saber-Team/SogouJS | 95f0e0b131d29d4a829a20d8d63a664b088cb089 | [
"MIT"
] | null | null | null | src/iter/util.js | Saber-Team/SogouJS | 95f0e0b131d29d4a829a20d8d63a664b088cb089 | [
"MIT"
] | null | null | null | /**
* @fileoverview Python形式的迭代器函数.
* 见 http://docs.python.org/library/itertools.html
* @author Leo.Zhang
* @email zmike86@gamil.com
*/
define([
'../util/util',
'../array/array',
'./iterator',
'./stopiteration'
],
function(util, array, Iterator, StopIteration) {
'use strict';
/**
* 返回一个能够遍历对象的迭代器. 可能有点晦涩, 看代码就明白.
* @param {Iterator} obj 若对象本身就是迭代器将会返回自身. 若对象含有__iterator__
* 方法,则此方法返回的迭代器会被利用. 若对象是类数组,我们就自己创建迭代器.
* @return {!Iterator} 返回对象的迭代器.
*/
function toIterator(obj) {
if (obj instanceof Iterator) {
return obj;
}
if (typeof obj.__iterator__ === 'function') {
return obj.__iterator__(false);
}
if (util.isArrayLike(obj)) {
var i = 0;
var newIter = new Iterator();
newIter.next = function() {
while (true) {
if (i >= obj.length) {
throw StopIteration;
}
// 元素可能已被删除.
if (!(i in obj)) {
i++;
continue;
}
return obj[i++];
}
};
return newIter;
}
// TODO: 可以用ds.getValues()代替
throw Error('Not implemented');
}
/**
* 函数遍历可迭代对象.
* @param {Iterator} iterable 迭代对象.
* @param {function(this:T,?,?,?):?} f 执行的函数. 接收三个行参(数据项, undefined, 对象本身)
* 返回值无关紧要. 第二个参数传undefined是因为想让该函数也可用在array.forEach的场景中.
* @param {T=} opt_obj 函数上下文.
* @template T
*/
function forEach(iterable, f, opt_obj) {
if (util.isArrayLike(iterable)) {
/** @preserveTry */
try {
// NOTES: this passes the index number to the second parameter
// of the callback contrary to the documentation above.
array.forEach(/** @type {ArrayLike} */(iterable), f, opt_obj);
} catch (ex) {
if (ex !== StopIteration) {
throw ex;
}
}
} else {
iterable = toIterator(iterable);
/** @preserveTry */
try {
while (true) {
f.call(opt_obj, iterable.next(), undefined, iterable);
}
} catch (ex) {
if (ex !== StopIteration) {
throw ex;
}
}
}
}
/**
* 遍历迭代对象, 返回只通过验证函数的项加入到新的迭代器中.
* @param {Iterator} iterable 迭代对象.
* @param {function(this:T,?,undefined,?):boolean} f 要执行的函数. 如果函数执行返回true则在新的
* 迭代器中可以遍历到该项否则跳过该项.
* @param {T=} opt_obj 函数上下文.
* @return {!Iterator} 返回一个新的迭代器只遍历通过测试的项.
* @template T
*/
function filter(iterable, f, opt_obj) {
var iterator = toIterator(iterable);
var newIter = new Iterator();
newIter.next = function() {
while (true) {
var val = iterator.next();
if (f.call(opt_obj, val, undefined, iterator)) {
return val;
}
}
};
return newIter;
}
/**
* 返回只在特定范围遍历的迭代器,函数的参数个数是不固定的:
* <pre>
* range(5) = range(0, 5, 1)
* range(2, 5) = range(2, 5, 1)
* </pre>
* @param {number} startOrStop 只有一个参数时代表终止值,起始值默认是0. 否则代表起始值.
* @param {number=} opt_stop 提供的终止值.
* @param {number=} opt_step 步进长度,也可以是负值.
* @return {!Iterator} 返回新的迭代器.
*/
function range(startOrStop, opt_stop, opt_step) {
var start = 0;
var stop = startOrStop;
var step = opt_step || 1;
if (arguments.length > 1) {
start = startOrStop;
stop = opt_stop;
}
if (step === 0) {
throw Error('Range step argument must not be zero');
}
var newIter = new Iterator();
newIter.next = function() {
if (step > 0 && start >= stop || step < 0 && start <= stop) {
throw StopIteration;
}
var rv = start;
start += step;
return rv;
};
return newIter;
}
/**
* 将迭代器中各项连接起来.
* @param {Iterator} iterable
* @param {string} deliminator
* @return {string}
*/
function join(iterable, deliminator) {
return toArray(iterable).join(deliminator);
}
/**
* 多值映射返回新的迭代器.
* @param {Iterable} iterable 迭代对象.
* @param {function(this:T,?,undefined,?):?} f 一个处理函数要返回新的值.
* @param {T=} opt_obj 函数上下文.
* @return {!Iterator}
* @template T
*/
function map(iterable, f, opt_obj) {
var iterator = toIterator(iterable);
var newIter = new Iterator();
newIter.next = function() {
while (true) {
var val = iterator.next();
return f.call(opt_obj, val, undefined, iterator);
}
};
return newIter;
}
/**
* 逐步递增式处理可迭代对象各项.
* @param {Iterable} iterable 迭代对象.
* @param {function(this:T,V,?):V} f 执行函数接受两个行参(上次计算后的值或初始值, 和当前项).
* function(previousValue, currentElement) : newValue.
* @param {V} val 处理函数的初始值.
* @param {T=} opt_obj 函数上下文.
* @return {V} Result of evaluating f repeatedly across the values of
* the iterator.
* @template T,V
*/
function reduce(iterable, f, val, opt_obj) {
var rval = val;
forEach(iterable, function(val) {
rval = f.call(opt_obj, rval, val);
});
return rval;
}
/**
* 只要有一项返回true则返回true.
* @param {Iterable} iterable 迭代对象.
* @param {function(this:T,?,undefined,?):boolean} f 执行函数返回布尔值.
* @param {T=} opt_obj 函数上下文.
* @return {boolean} 返回是否有值通过测试.
* @template T
*/
function some(iterable, f, opt_obj) {
iterable = toIterator(iterable);
/** @preserveTry */
try {
while (true) {
if (f.call(opt_obj, iterable.next(), undefined, iterable)) {
return true;
}
}
} catch (ex) {
if (ex !== StopIteration) {
throw ex;
}
}
return false;
}
/**
* 全部通过测试则返回true否则返回false.
* @param {Iterable} iterable 迭代对象.
* @param {function(this:T,?,undefined,?):boolean} f 检测函数返回布尔值.
* @param {T=} opt_obj 函数上下文.
* @return {boolean} true 是否全部通过测试.
* @template T
*/
function every(iterable, f, opt_obj) {
iterable = toIterator(iterable);
/** @preserveTry */
try {
while (true) {
if (!f.call(opt_obj, iterable.next(), undefined, iterable)) {
return false;
}
}
} catch (ex) {
if (ex !== StopIteration) {
throw ex;
}
}
return true;
}
/**
* 接收多个迭代器并且在迭代的时候遍历其中的项.
* @param {...Iterator} var_args 任意数量的迭代对象.
* @return {!Iterator} 返回新的迭代器.
*/
function chain(var_args) {
var args = arguments;
var length = args.length;
var i = 0;
var newIter = new Iterator();
/**
* @return {*} The next item in the iteration.
* @this {Iterator}
*/
newIter.next = function() {
/** @preserveTry */
try {
if (i >= length) {
throw StopIteration;
}
var current = toIterator(args[i]);
return current.next();
} catch (ex) {
if (ex !== StopIteration || i >= length) {
throw ex;
} else {
// In case we got a StopIteration increment counter and try again.
i++;
return this.next();
}
}
};
return newIter;
}
/**
* Builds a new iterator that iterates over the original, but skips elements as
* long as a supplied function returns true.
* @param {Iterable} iterable 迭代对象.
* @param {function(this:T,?,undefined,?):boolean} f 遍历用到的函数,返回布尔值.
* @param {T=} opt_obj 函数上下文.
* @return {!Iterator} A new iterator that drops elements from the
* original iterator as long as {@code f} is true.
* @template T
*/
function dropWhile(iterable, f, opt_obj) {
var iterator = toIterator(iterable);
var newIter = new Iterator();
var dropping = true;
newIter.next = function() {
while (true) {
var val = iterator.next();
if (dropping && f.call(opt_obj, val, undefined, iterator)) {
continue;
} else {
dropping = false;
}
return val;
}
};
return newIter;
}
/**
* Builds a new iterator that iterates over the original, but only as long as a
* supplied function returns true.
* @param {Iterable} iterable The iterator object.
* @param {function(this:T,?,undefined,?):boolean} f The function to call for
* every value. This function
* takes 3 arguments (the value, undefined, and the iterator) and should
* return a boolean.
* @param {T=} opt_obj This is used as the 'this' object in f when called.
* @return {!Iterator} A new iterator that keeps elements in the
* original iterator as long as the function is true.
* @template T
*/
function takeWhile(iterable, f, opt_obj) {
var iterator = toIterator(iterable);
var newIter = new Iterator();
var taking = true;
newIter.next = function() {
while (true) {
if (taking) {
var val = iterator.next();
if (f.call(opt_obj, val, undefined, iterator)) {
return val;
} else {
taking = false;
}
} else {
throw StopIteration;
}
}
};
return newIter;
}
/**
* 将迭代器转化成熟组
* @param {Iterable} iterable
* @return {!Array}
*/
function toArray(iterable) {
// Fast path for array-like.
if (util.isArrayLike(iterable)) {
return array.toArray(/** @type {!ArrayLike} */(iterable));
}
iterable = toIterator(iterable);
var array = [];
forEach(iterable, function(val) {
array.push(val);
});
return array;
}
/**
* 遍历两个对象返回他们是否长度相等且数据项各个都相等.
* @param {Iterable} iterable1 对象1.
* @param {Iterable} iterable2 对象2.
* @return {boolean} 返回是否相等.
*/
function equals(iterable1, iterable2) {
iterable1 = toIterator(iterable1);
iterable2 = toIterator(iterable2);
var b1, b2;
/** @preserveTry */
try {
while (true) {
b1 = b2 = false;
var val1 = iterable1.next();
b1 = true;
var val2 = iterable2.next();
b2 = true;
if (val1 !== val2) {
return false;
}
}
} catch (ex) {
if (ex !== StopIteration) {
throw ex;
} else {
if (b1 && !b2) {
// iterable1 done but iterable2 is not done.
return false;
}
if (!b2) {
/** @preserveTry */
try {
// iterable2 not done?
val2 = iterable2.next();
// iterable2 not done but iterable1 is done
return false;
} catch (ex1) {
if (ex1 !== StopIteration) {
throw ex1;
}
// iterable2 done as well... They are equal
return true;
}
}
}
}
return false;
}
/**
* 加强版的next方法, 在不能遍历的情况下不是抛出异常而是返回默认值.
* @param {Iterable} iterable 迭代对象.
* @param {*} 默认项.
* @return {*} 返回下一项或者默认项.
*/
function nextOrValue(iterable, defaultValue) {
try {
return toIterator(iterable).next();
} catch (e) {
if (e !== StopIteration) {
throw e;
}
return defaultValue;
}
}
/**
* Cartesian product of zero or more sets. Gives an iterator that gives every
* combination of one element chosen from each set. For example,
* ([1, 2], [3, 4]) gives ([1, 3], [1, 4], [2, 3], [2, 4]).
* @see http://docs.python.org/library/itertools.html#itertools.product
* @param {...!ArrayLike.<*>} var_args Zero or more sets, as arrays.
* @return {!Iterator} An iterator that gives each n-tuple (as an
* array).
*/
function product(var_args) {
var someArrayEmpty = array.some(arguments, function(arr) {
return !arr.length;
});
// An empty set in a cartesian product gives an empty set.
if (someArrayEmpty || !arguments.length) {
return new Iterator();
}
var iter = new Iterator();
var arrays = arguments;
// The first indicies are [0, 0, ...]
var indicies = array.repeat(0, arrays.length);
iter.next = function() {
if (indicies) {
var retVal = array.map(indicies, function(valueIndex, arrayIndex) {
return arrays[arrayIndex][valueIndex];
});
// Generate the next-largest indicies for the next call.
// Increase the rightmost index. If it goes over, increase the next
// rightmost (like carry-over addition).
for (var i = indicies.length - 1; i >= 0; i--) {
// Assertion prevents compiler warning below.
// asserts.assert(indicies);
if (indicies[i] < arrays[i].length - 1) {
indicies[i]++;
break;
}
// We're at the last indicies (the last element of every array), so
// the iteration is over on the next call.
if (i == 0) {
indicies = null;
break;
}
// Reset the index in this column and loop back to increment the
// next one.
indicies[i] = 0;
}
return retVal;
}
throw StopIteration;
};
return iter;
}
/**
* Create an iterator to cycle over the iterable's elements indefinitely.
* For example, ([1, 2, 3]) would return : 1, 2, 3, 1, 2, 3, ...
* @see: http://docs.python.org/library/itertools.html#itertools.cycle.
* @param {!Iterable} iterable The iterable object.
* @return {!Iterator} An iterator that iterates indefinitely over
* the values in {@code iterable}.
*/
function cycle(iterable) {
var baseIterator = toIterator(iterable);
// We maintain a cache to store the iterable elements as we iterate
// over them. The cache is used to return elements once we have
// iterated over the iterable once.
var cache = [];
var cacheIndex = 0;
var iter = new Iterator();
// This flag is set after the iterable is iterated over once
var useCache = false;
iter.next = function() {
var returnElement = null;
// Pull elements off the original iterator if not using cache
if (!useCache) {
try {
// Return the element from the iterable
returnElement = baseIterator.next();
cache.push(returnElement);
return returnElement;
} catch (e) {
// If an exception other than StopIteration is thrown
// or if there are no elements to iterate over (the iterable was empty)
// throw an exception
if (e !== StopIteration || array.isEmpty(cache)) {
throw e;
}
// set useCache to true after we know that a 'StopIteration' exception
// was thrown and the cache is not empty (to handle the 'empty iterable'
// use case)
useCache = true;
}
}
returnElement = cache[cacheIndex];
cacheIndex = (cacheIndex + 1) % cache.length;
return returnElement;
};
return iter;
}
return {
toIterator: toIterator,
forEach: forEach,
filter: filter,
range: range,
join: join,
map: map,
reduce: reduce,
some: some,
every: every,
chain: chain,
dropWhile: dropWhile,
takeWhile: takeWhile,
toArray: toArray,
equals: equals,
nextOrValue: nextOrValue,
product: product,
cycle: cycle
};
}
); | 29.195079 | 85 | 0.507344 |
b82614766615c66820b28952bf632934f9ce9195 | 156 | js | JavaScript | web/vue/hellow/unpackage/dist/dev/app-plus/pages/template/list-triplex-row/list-triplex-row.js | february29/Learning | e909fd0a10b1a6d2ba6847e5821233548a778508 | [
"MIT"
] | null | null | null | web/vue/hellow/unpackage/dist/dev/app-plus/pages/template/list-triplex-row/list-triplex-row.js | february29/Learning | e909fd0a10b1a6d2ba6847e5821233548a778508 | [
"MIT"
] | 4 | 2021-03-09T04:53:30.000Z | 2022-02-26T11:14:26.000Z | web/vue/hellow/unpackage/dist/dev/app-plus/pages/template/list-triplex-row/list-triplex-row.js | february29/Learning | e909fd0a10b1a6d2ba6847e5821233548a778508 | [
"MIT"
] | null | null | null | document.dispatchEvent(new CustomEvent("generateFuncReady", { detail: { generateFunc: $gwx('./pages/template/list-triplex-row/list-triplex-row.wxml') } })); | 156 | 156 | 0.75641 |
1d2479b708a000a20c434f5baf117a3637248517 | 1,258 | js | JavaScript | src/components/clojurescript/ReplOutputCljsSource.js | jinCN/Mancy | f03aea7ce85bee0b9a1120cfe325f8ad5c282684 | [
"MIT"
] | null | null | null | src/components/clojurescript/ReplOutputCljsSource.js | jinCN/Mancy | f03aea7ce85bee0b9a1120cfe325f8ad5c282684 | [
"MIT"
] | null | null | null | src/components/clojurescript/ReplOutputCljsSource.js | jinCN/Mancy | f03aea7ce85bee0b9a1120cfe325f8ad5c282684 | [
"MIT"
] | null | null | null | import React from 'react'
import _ from 'lodash'
export default class ReplOutputCljsVar extends React.Component {
constructor (props) {
super(props)
this.state = {
collapse: props.collapse == null ? true : props.collapse
}
this.onToggleCollapse = this.onToggleCollapse.bind(this)
}
shouldComponentUpdate (nextProps, nextState) {
return !(_.isEqual(nextState, this.state) &&
_.isEqual(nextProps, this.props))
}
onToggleCollapse () {
this.setState({
collapse: !this.state.collapse
})
}
render () {
return (
<span className='repl-cljs-source-fold'>
{
this.state.collapse
? <span className='repl-cljs-source'>
<i className='fa fa-plus-square-o'
onClick={this.onToggleCollapse}></i>
{this.props.short}
</span>
: <span className='repl-cljs-source'>
<i className='fa fa-minus-square-o'
onClick={this.onToggleCollapse}></i>
<span className='repl-cljs-source-code'
dangerouslySetInnerHTML={{ __html: this.props.source }}>
</span>
</span>
}
</span>
)
}
}
| 26.765957 | 78 | 0.551669 |
1d2524db3dc9ebc16e22e0297aab71d10062490f | 1,446 | js | JavaScript | app/components/TranslatedValidationField/messages.js | JohnPhoto/julmustracet-2016 | 89313dde788b46572257378b8079cbe2a8d74cd7 | [
"MIT"
] | null | null | null | app/components/TranslatedValidationField/messages.js | JohnPhoto/julmustracet-2016 | 89313dde788b46572257378b8079cbe2a8d74cd7 | [
"MIT"
] | null | null | null | app/components/TranslatedValidationField/messages.js | JohnPhoto/julmustracet-2016 | 89313dde788b46572257378b8079cbe2a8d74cd7 | [
"MIT"
] | null | null | null | /*
* TranslatedValidationField Messages
*
* This contains all the text for the TranslatedValidationField component.
*/
import { defineMessages } from 'react-intl';
export const ERRORS = {
REQUIRED: 'presence',
LENGTH_SHORT: 'length.min',
LENGTH_LONG: 'length.max',
UNIQUE: 'uniqueness',
EMAIL: 'custom.email',
DEFAULT: 'error',
TOO_MUCH: 'too.much',
TOO_LITTLE: 'too.little',
};
export default defineMessages({
[ERRORS.REQUIRED]: {
id: 'app.components.TranslatedValidationField.presence',
defaultMessage: 'Required field',
},
[ERRORS.LENGTH_SHORT]: {
id: 'app.components.TranslatedValidationField.too_short',
defaultMessage: 'Too short',
},
[ERRORS.LENGTH_LONG]: {
id: 'app.components.TranslatedValidationField.too_long',
defaultMessage: 'Too long',
},
[ERRORS.UNIQUE]: {
id: 'app.components.TranslatedValidationField.uniqueness',
defaultMessage: 'Already taken',
},
[ERRORS.EMAIL]: {
id: 'app.components.TranslatedValidationField.custom.email',
defaultMessage: 'Must be a valid email',
},
[ERRORS.DEFAULT]: {
id: 'app.components.TranslatedValidationField.default.error',
defaultMessage: 'Invalid',
},
[ERRORS.TOO_MUCH]: {
id: 'app.components.TranslatedValidationFieldtoo.much',
defaultMessage: 'Too much',
},
[ERRORS.TOO_LITTLE]: {
id: 'app.components.TranslatedValidationField.too.little',
defaultMessage: 'Too little',
},
});
| 27.807692 | 74 | 0.697095 |
1d2547b9e71f1e86aaa8566f33f20426b28969e0 | 20,855 | js | JavaScript | images/sdd_files/5Nwt4oUYFIV.js | sdoylelambda/solo | fbfc6bcae667279e879a42b17c875d30546da125 | [
"CC-BY-3.0"
] | null | null | null | images/sdd_files/5Nwt4oUYFIV.js | sdoylelambda/solo | fbfc6bcae667279e879a42b17c875d30546da125 | [
"CC-BY-3.0"
] | null | null | null | images/sdd_files/5Nwt4oUYFIV.js | sdoylelambda/solo | fbfc6bcae667279e879a42b17c875d30546da125 | [
"CC-BY-3.0"
] | null | null | null | if (self.CavalryLogger) { CavalryLogger.start_js(["U1PbV"]); }
__d("FDSPrivateInputIconSelectors",["ix","asset"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();var h={error:g("489535"),warning:g("480790"),validated:g("506111")},i={error:g("871824"),warning:g("480790"),validated:g("815791")};function a(a){switch(a){case"error":return i.error;case"warning":return i.warning;case"validated":return i.validated;default:return null}}function b(a){switch(a){case"error":return h.error;case"warning":return h.warning;case"validated":return h.validated;default:return null}}e.exports={classicSelector:b,geoSelector:a}}),null);
__d("FDSFormUtils",["FDSPrivateInputIconSelectors","FDSThreeStateCheckboxEnum"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=b("FDSPrivateInputIconSelectors").classicSelector,h=b("FDSPrivateInputIconSelectors").geoSelector;function a(a,b,c){if(b)return b;b=c===!0?h:g;return b(a)}function c(a){switch(a){case b("FDSThreeStateCheckboxEnum").CHECKED:return!0;case b("FDSThreeStateCheckboxEnum").PARTIAL:return"indeterminate";default:return!1}}function d(a,b,c){if(a)return"error";else if(b)return"warning";else if(c===!0)return"validated";return void 0}e.exports={getIconSrc:a,getInputState:d,mapCheckboxState:c}}),null);
__d("FDSMultiElementLayoutContext",["React"],(function(a,b,c,d,e,f){"use strict";a=b("React").createContext({groupID:null,getLayout:function(){}});e.exports=a}),null);
__d("FDSPrivateDisabledContext",["React"],(function(a,b,c,d,e,f){"use strict";e.exports=b("React").createContext(void 0)}),null);
__d("FDSPrivateInputSelectors",[],(function(a,b,c,d,e,f){"use strict";__p&&__p();function a(a){var b=a.size==="large"?a.atoms.inputPrimitive.size.large:a.atoms.inputPrimitive.size.medium;return babelHelpers["extends"]({height:b},g(a))}function b(a){return g(a)}function g(a){__p&&__p();var b=a.isFocused,c=a.isDisabled,d=a.hasError,e=a.hasWarning,f=a.isValid,g=a.isEdited;a=a.atoms;var h=a.inputs["default"].boxShadow,i=a.inputs["default"].border,j=a.colors.layers.background,k=a.colors.text.primary;b&&(h=a.inputs.focused.boxShadow,i=a.inputs.focused.border);d&&(h=b?a.inputs.focused.error.boxShadow:void 0,i=a.inputs.error.border);e&&(h=b?a.inputs.focused.warning.boxShadow:void 0,i=a.inputs.warning.border);f===!0&&(h=b?a.inputs.focused.valid.boxShadow:void 0,i=a.inputs.valid.border);c&&(i=a.inputs.disabled.border,j=a.inputs.disabled.backgroundColor,k=a.colors.text.secondary);g&&(j=a.inputs.edited.backgroundColor);return{backgroundColor:j,border:i,borderRadius:a.inputs.borderRadius,boxShadow:h,color:k,fontFamily:a.type.fontFamily}}e.exports={getInputStyle:a,getTextAreaStyle:b}}),null);
__d("FDSPrivateSizeContext",["React"],(function(a,b,c,d,e,f){"use strict";e.exports=b("React").createContext(null)}),null);
__d("FDSBaseTextInput.react",["cx","AbstractTextInput.react","FDSCloseButton.react","FDSFormUtils","FDSMultiElementLayoutContext","FDSPrivateDisabledContext","FDSPrivateInputSelectors","FDSPrivateSizeContext","FDSPrivateThemeContext.react","FDSPrivateThemeUtils","Image.react","React","emptyFunction","isStringNullOrEmpty","makeFDSStandardComponent"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();var h=b("FDSPrivateInputSelectors").getInputStyle;a=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){__p&&__p();var c,d;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(c=d=a.call.apply(a,[this].concat(f))||this,d.state={isFocused:!1},d.$1=b("React").createRef(),d.$2=function(a){a=a.target.value;d.props.onChange(a)},d.$3=function(a){if(d.props.onEnter){var b=a.target.value;d.props.onEnter(b,a)}},d.$4=function(a){d.setState({isFocused:!1}),d.props.onBlur&&d.props.onBlur(a)},d.$5=function(a){d.setState({isFocused:!0}),d.props.onFocus&&d.props.onFocus(a)},d.$6=function(){d.props.onClear&&d.props.onClear(),d.focus()},c)||babelHelpers.assertThisInitialized(d)}var d=c.prototype;d.$7=function(a,c){return!b("isStringNullOrEmpty")(a)&&c!=null?b("React").jsx(b("FDSCloseButton.react"),{onClick:this.$6,size:"large"}):null};d.$8=function(a,c,d){if(c)return c;c=b("FDSFormUtils").getIconSrc(a,null,d);return c!=null?b("React").jsx(b("Image.react"),{src:c}):null};d.focus=function(){this.$1.current&&this.$1.current.focusInput()};d.blur=function(){this.$1.current&&this.$1.current.blurInput()};d.select=function(){this.$1.current&&this.$1.current.selectInput()};d.render=function(){__p&&__p();var a=this,c=this.props,d=c.autoComplete,e=c.busyIndicator,f=c.describedBy,g=c.dir,i=c.errorMessageId,j=c.hasError,k=c.hasWarning,l=c.htmlForTargetId,m=c.icon,n=c.isEdited,o=c.isValid,p=c.labelledBy,q=c.maxLength,r=c.name,s=c.onClear,t=c.onKeyDown,u=c.onKeyUp,v=c.onPaste,w=c.placeholder,x=c.rightContent,y=c.type,z=c.value,A;j?A="error":k?A="warning":o===!0&&(A="validated");var B=this.state.isFocused||this.props.isHighlighted===!0;return b("React").jsx(b("FDSMultiElementLayoutContext").Consumer,{children:function(c){var C=c.getLayout;return b("React").jsx(b("FDSPrivateSizeContext").Consumer,{children:function(c){return b("React").jsx(b("FDSPrivateDisabledContext").Consumer,{children:function(D){return b("React").jsx(b("FDSPrivateThemeContext.react").Consumer,{children:function(E){var F=D!=null?D:a.props.isDisabled,G=c!=null?c:a.props.size,H=b("FDSPrivateThemeUtils").isGeo(E),I=C!=null?C(B):void 0;G=h({isFocused:B,isDisabled:F,size:G,hasError:j,hasWarning:k,isValid:o,isEdited:n,atoms:E});return b("React").jsxs("span",{className:"_2gn0"+(H?" _8o2t":""),style:babelHelpers["extends"]({},G,I,{"--background-color":G.backgroundColor}),children:[b("React").jsx(b("AbstractTextInput.react"),{"aria-busy":e!=null?!0:void 0,"aria-describedby":f,"aria-errormessage":i,"aria-invalid":i?"true":"false","aria-labelledby":p,autoComplete:d==="off"?"disable_autocomplete":d,className:"_2gnb"+(!F&&s?" _7_n4":""),"data-testid":a.props["data-testid"],dir:g,disabled:F,id:l,maxLength:q,name:r,onBlur:a.$4,onChange:a.$2,onClick:a.props.onClick,onEnter:a.$3,onFocus:a.$5,onKeyDown:t,onKeyUp:u,onPaste:v,placeholder:w,ref:a.$1,type:y,useLabel:!1,value:z}),x,e,!F&&a.$7(z,s),a.$8(A,m,H)]})}})}})}})}})};return c}(b("React").PureComponent);a.defaultProps={hasError:!1,hasWarning:!1,isDisabled:!1,isEdited:!1,isValid:null,onChange:b("emptyFunction"),size:"large",type:"text"};e.exports=b("makeFDSStandardComponent")("FDSBaseTextInput",a)}),null);
__d("FDSPrivateFormLabelLayoutContext",["createLayoutContext"],(function(a,b,c,d,e,f){"use strict";a=b("createLayoutContext")({descriptionOffset:0});e.exports=a}),null);
__d("FDSPrivateFormLabel.react",["cx","fbt","FDSPrivateFormLabelLayoutContext","FDSPrivateThemeContext.react","FDSPrivateThemeUtils","FDSSimplePopover.react","FDSText.react","FlexLayout.react","React","cxMargin","makeFDSStandardComponent","stylex","useContentRect"],(function(a,b,c,d,e,f,g,h){"use strict";__p&&__p();var i=b("FDSPrivateFormLabelLayoutContext").useLayoutContext,j=b("React").useContext,k=b("React").useMemo,l="\u2219";function a(a){__p&&__p();var c=a.hasRequirementLabel;c=c===void 0?!1:c;var d=a.isRequired;d=d===void 0?!1:d;var e=a.isTooltipVisible;e=e===void 0?!0:e;var f=a.labelIsHidden;f=f===void 0?!1:f;var g=a.description,h=a.descriptionId,l=a.inputId,o=a.labelId,p=a.popover,q=a.title;a=a.tooltipText;var r=j(b("FDSPrivateThemeContext.react"));r=b("FDSPrivateThemeUtils").isGeo(r);var s=r&&g!=null,t=b("useContentRect")(),u=t[0];t=t[1];var v=(u=u==null?void 0:u.height)!=null?u:0;u=k(function(){return{descriptionHeight:v}},[v]);u=i(u);var w=u[0].descriptionOffset;u=u[1];c=b("React").jsx(m,{hasRequirementLabel:c,inputId:l,isGeo:r,isRequired:d,labelId:o,labelIsHidden:f,title:q});return f&&!s?c:b("React").jsxs("div",{className:q!=null&&!f||s?"_3-94":"",ref:u,style:{paddingTop:w},children:[b("React").jsxs(b("FlexLayout.react"),{align:"center",children:[c,b("React").jsx(n,{isTooltipVisible:e,popover:p,tooltipText:a})]}),s?b("React").jsx("div",{ref:t,children:b("React").jsx(b("FDSText.react"),{color:"secondary",display:"block",id:h,size:"small",weight:"normal",children:g})}):null]})}function m(a){var c=a.hasRequirementLabel,d=a.isGeo,e=a.isRequired,f=a.title;e=e?h._("Required"):h._("Optional");return b("React").jsxs("span",{className:a.labelIsHidden?"accessible_elem":"",children:[b("React").jsx("label",{htmlFor:a.inputId,id:a.labelId,children:b("React").jsx(b("FDSText.react"),{color:d?"header":"primary",size:d?"header4":"body2",weight:d?"bold":"normal",children:f})}),c?b("React").jsx("span",{className:"fx4hsqtn",children:b("React").jsxs(b("FDSText.react"),{color:d?"secondary":"placeholder",margin:"_3-99",size:d?"body":"body2",weight:d?"bold":"normal",children:[l," ",e]})}):null]})}function n(a){var c=a.isTooltipVisible,d=a.popover;a=a.tooltipText;var e=null;a!=null&&(e=b("React").jsx(b("FDSSimplePopover.react"),{content:a,position:"above"}));d!=null&&(e=d);return e!=null?b("React").jsx("div",{className:"_8ahp"+(c===!1?" _8ail":""),children:e}):null}e.exports=b("makeFDSStandardComponent")("FDSPrivateFormLabel",a)}),null);
__d("createFeatureContext",["React","emptyFunction","objectEntries","shallowEqual","uniqueID","useUniqueID"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g=(c=b("React")).useCallback,h=c.useContext,i=c.useLayoutEffect,j=c.useMemo,k=c.useReducer,l=c.useRef;function a(){__p&&__p();var a=b("React").createContext({getFeature:function(){return[]},pushFeatures:function(){return b("emptyFunction")}});function c(a,c){__p&&__p();var d=c.id,e=c.features;c=c.remove;a=new Map(a);for(var e=b("objectEntries")(e),f=Array.isArray(e),g=0,e=f?e:e[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var h;if(f){if(g>=e.length)break;h=e[g++]}else{g=e.next();if(g.done)break;h=g.value}h=h;var i=h[0];h=h[1];var j=new Map(a.get(i));c===!0?j["delete"](d):j.set(d,h);a.set(i,j)}return a}function d(a){return b("objectEntries")((a=a)!=null?a:{}).reduce(function(a,c){var d=c[0];c=c[1];return a.set(d,new Map(c.map(function(a){return[b("uniqueID")(),a]})))},new Map())}function e(e){var f=k(c,d(e.initialValue)),h=f[0],i=f[1],l=g(function(a){return Array.from(new Map(h.get(a)).values())},[h]),m=g(function(b,a){i({id:b,features:a,remove:!1});return function(){return i({id:b,features:a,remove:!0})}},[]);f=j(function(){return{getFeature:l,pushFeatures:m}},[l,m]);return b("React").jsx(a.Provider,{value:f,children:e.children})}function f(c){var d=b("useUniqueID")(),e=h(a),f=e.getFeature,g=e.pushFeatures,k=l(),m=j(function(){return b("shallowEqual")(c,k.current)?k.current:c},[c]);i(function(){k.current=m},[m]);i(function(){if(m)return g(d,m)},[d,m,g]);return f}function m(a){var b=f(a.value);return a.children(b)}function n(a){f(a.value);return null}return{Consumer:m,Provider:e,Push:n,useFeatureContext:f}}e.exports=a}),null);
__d("GeoPrivateMultiElementMessageContext",["createFeatureContext"],(function(a,b,c,d,e,f){"use strict";a=b("createFeatureContext")();e.exports=a}),null);
__d("FDSFormInputLayout.react",["cx","FDSMultiElementLayoutContext","FDSPrivateDisabledContext","FDSPrivateDisabledMessageWrapper.react","FDSPrivateFormLabel.react","FDSPrivateThemeContext.react","FDSPrivateThemeUtils","FDSText.react","FlexLayout.react","GeoPrivateMultiElementMessageContext","React","cxMargin","isEmpty","joinClasses","useBoolean","useKeyboardFocus","useUniqueID"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();var h,i=b("FDSPrivateThemeUtils").useIsGeoThemeContext,j=b("React").useContext,k=b("React").useMemo;function a(a){__p&&__p();var c=a.children,d=a.disabledMessage,e=a.label,f=a.labelIsHidden;f=f===void 0?!1:f;var g=a.infoTooltipText,h=a.isDisabled,i=a.isOptional,n=a.margin,o=babelHelpers.objectWithoutPropertiesLoose(a,["children","disabledMessage","label","labelIsHidden","infoTooltipText","isDisabled","isOptional","margin"]);a=j(b("FDSPrivateThemeContext.react"));var p=b("FDSPrivateThemeUtils").isGeo(a);a=j(b("FDSMultiElementLayoutContext"));var r=a.groupID;a=j(b("FDSPrivateDisabledContext"));var s=(a=a)!=null?a:h;a=b("useBoolean")(!1);h=a.value;var t=a.setTrue,u=a.setFalse;a=b("useKeyboardFocus")({onBlur:u,onFocus:t});var v=a.isKeyboardFocused,w=a.onBlur,x=a.onFocus;a=h||v;var y=r!=null||f;v=(h=o.inputId)!=null?h:b("useUniqueID")();h=(f=o.labelId)!=null?f:b("useUniqueID")();var z=b("useUniqueID")(),A=b("useUniqueID")(),B={inputId:v,labelledBy:r==null?h:r+" "+h,describedBy:o.description!=null?z:void 0,errorMessageId:o.errorMessage!=null?A:void 0},C=b("React").jsx(b("FDSPrivateFormLabel.react"),{description:o.description,descriptionId:z,hasRequirementLabel:i===!0,inputId:v,isRequired:i===!1,isTooltipVisible:a,labelId:h,labelIsHidden:y,popover:o.popover,title:e,tooltipText:g});f=k(function(){return{errorMessage:o.errorMessage,warningMessage:o.warningMessage}},[o.errorMessage,o.warningMessage]);return b("React").jsx(b("GeoPrivateMultiElementMessageContext").Consumer,{value:f,children:function(a){var e;return b("React").jsxs("div",{className:b("joinClasses")(n,"_86ij"),"data-testid":o["data-testid"],onBlur:w,onFocus:x,onMouseEnter:t,onMouseLeave:u,children:[y?C:b("React").jsxs(b("FlexLayout.react"),{align:"center",className:"_21op",justify:"all",children:[b("React").jsx(b("FlexLayout.react"),{align:"center",children:C}),o.labelSupplementaryContent]}),b("React").jsx(b("FDSPrivateDisabledMessageWrapper.react"),{disabledMessage:d,fdsPrivate_loggerSuffix:"InFDSFormInputLayout",isDisabled:s,children:b("React").jsx(b("FlexLayout.react"),{className:"_86ik",direction:"vertical",children:c(B)})}),r==null&&b("React").jsx(q,{errorMessage:(e=o.errorMessage)!=null?e:l(a("errorMessage")),errorMessageId:A,warningMessage:(e=o.warningMessage)!=null?e:l(a("warningMessage"))}),p?null:b("React").jsx(m,{id:z,text:o.description})]})}})}function l(a){a=a.filter(Boolean);return(h||(h=b("isEmpty")))(a)?void 0:a}function m(a){return a.text!=null&&a.text!==""?b("React").jsx(b("FDSText.react"),{color:"secondary",id:a.id,margin:"_3-8w",size:"body3",children:a.text}):null}var n=function(a){return a==null||String(a)===""},o=function(a){return!n(a)},p=function(a){if(a==null)return null;a=[].concat(a);a=a.filter(Boolean).filter(o);return a.length>0?a:null};function q(a){__p&&__p();var c=i();if(c)return b("React").jsx(r,babelHelpers["extends"]({},a));c=p(a.errorMessage);var d=p(a.warningMessage);if(c!=null)return b("React").jsx(b("FDSText.react"),{color:"negative",display:"block",id:a.errorMessageId,size:"body3",children:c.map(function(a,c){return b("React").jsx("div",{className:"_3-8w",children:a},c)})});else if(d!=null)return d.map(function(a,c){return b("React").jsx("span",{className:"_7vrh",children:a},c)});return null}function r(a){__p&&__p();var c=j(b("FDSPrivateThemeContext.react")),d=p(a.errorMessage),e=p(a.warningMessage);d=(d=d)!=null?d:e;e=d===e;if(d==null)return null;var f=c.inputs.borderRadius*2;c=c.inputs.borderRadius;e=e?"rgba(225, 186, 0, 0.1)":"rgba(242, 128, 70, 0.1)";f={backgroundColor:e,borderBottomLeftRadius:c,borderBottomRightRadius:c,padding:f};e={borderBottomLeftRadius:c,borderBottomRightRadius:c,boxShadow:"0 0 0 "+c+"px "+e,clip:"rect(0px, auto, "+c+"px, auto)",height:c,left:0,position:"absolute",top:-c,width:"100%"};c=[].concat(d);return b("React").jsxs("div",{className:"_7vri",style:f,children:[b("React").jsx("span",{style:e}),b("React").jsx(b("FlexLayout.react"),{direction:"vertical",children:b("React").jsx(b("FDSText.react"),{display:"block",id:a.errorMessageId,size:"meta1",children:c.map(function(a,c){return b("React").jsx("div",{children:a},c)})})})]})}e.exports=a}),null);
__d("FDSPrivateFormCounter.react",["FDSText.react","React"],(function(a,b,c,d,e,f){"use strict";a=function(a){a=a.limit-a.count;return b("React").jsx(b("FDSText.react"),{color:a>0?"positive":"negative","data-testid":"FDSPrivateFormCounter/text",children:a})};e.exports=a}),null);
__d("FDSTextInput.react",["FDSBaseTextInput.react","FDSFormInputLayout.react","FDSPrivateFormCounter.react","React","emptyFunction","makeFDSStandardComponent","uniqueID"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=function(a){__p&&__p();babelHelpers.inheritsLoose(c,a);function c(){var c,d,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(d=e=a.call.apply(a,[this].concat(g))||this,e.state={innerValue:(c=e.props.value)!=null?c:"",value:e.props.value},e.$1=b("React").createRef(),e.$2=b("uniqueID")(),e.$3=function(a){e.setState({innerValue:a}),e.props.onChange(a)},e.$4=function(){e.setState({innerValue:""}),e.props.onClear&&e.props.onClear()},d)||babelHelpers.assertThisInitialized(e)}c.getDerivedStateFromProps=function(a,b){if(b.value!==a.value){return{innerValue:(b=a.value)!=null?b:"",value:a.value}}return null};var d=c.prototype;d.focus=function(){this.$1.current&&this.$1.current.focus()};d.blur=function(){this.$1.current&&this.$1.current.blur()};d.select=function(){this.$1.current&&this.$1.current.select()};d.render=function(){var a=this,c=this.props,d=c.autoComplete,e=c.busyIndicator,f=c.description,g=c.dir,h=c.disabledMessage,i=c.errorMessage,j=c.icon,k=c.isDisabled,l=c.isEdited,m=c.isHighlighted,n=c.isOptional,o=c.isValid,p=c.label,q=c.labelIsHidden,r=c.maxLength,s=c.name,t=c.onBlur,u=c.onClear,v=c.onClick,w=c.onEnter,x=c.onFocus,y=c.onKeyDown,z=c.onKeyUp,A=c.onPaste,B=c.placeholder,C=c.rightContent,D=c.size,E=c.tooltipText,F=c.type,G=c.warningMessage,H=(c=this.props.value)!=null?c:this.state.innerValue;c=r!=null?b("React").jsx(b("FDSPrivateFormCounter.react"),{count:H.length,limit:r}):null;return b("React").jsx(b("FDSFormInputLayout.react"),{description:f,disabledMessage:h,errorMessage:i,infoTooltipText:E,inputId:this.$2,isDisabled:k,isOptional:n,label:p,labelIsHidden:q,labelSupplementaryContent:c,warningMessage:G,children:function(c){var f=c.labelledBy,h=c.describedBy;c=c.errorMessageId;return b("React").jsx(b("FDSBaseTextInput.react"),{autoComplete:d,busyIndicator:e,"data-testid":a.props["data-testid"],describedBy:h,dir:g,errorMessageId:c,hasError:!!i,hasWarning:!!G,htmlForTargetId:a.$2,icon:j,isDisabled:k,isEdited:l,isHighlighted:m,isValid:o,labelledBy:f,maxLength:r,name:s,onBlur:t,onChange:a.$3,onClear:u&&a.$4,onClick:v,onEnter:w,onFocus:x,onKeyDown:y,onKeyUp:z,onPaste:A,placeholder:B,ref:a.$1,rightContent:C,size:D,type:F,value:H})}})};return c}(b("React").PureComponent);a.defaultProps={isDisabled:!1,isEdited:!1,isValid:null,labelIsHidden:!1,onChange:b("emptyFunction"),size:"large",type:"text"};e.exports=b("makeFDSStandardComponent")("FDSTextInput",a)}),null);
__d("CircularProgressBar.react",["cx","React","createReactClass_DEPRECATED","prop-types"],(function(a,b,c,d,e,f,g){"use strict";a=b("createReactClass_DEPRECATED")({displayName:"CircularProgressBar",propTypes:{animate:b("prop-types").bool,percentComplete:b("prop-types").number.isRequired,text:b("prop-types").string},render:function(){var a=this.props,c=a.animate,d=a.text;a=a.percentComplete;var e=360*a/100,f=Math.max(e,180)-180;e=Math.min(e,180);var g=a<100?"1":"0";return b("React").jsxs("div",{"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":a,className:"_1_bj",role:"progressbar",style:{opacity:g},children:[!!d&&b("React").jsx("div",{className:"_22sa",children:d}),b("React").jsx("div",{className:"_1_bk",children:b("React").jsxs("div",{className:c?"_22sb":"",children:[b("React").jsx("div",{className:"_1_bl",style:{opacity:g}}),b("React").jsx("div",{className:"_1_bp _1_bq",children:b("React").jsx("div",{className:"_1_br",style:{transform:"translateX(-100%) rotate("+f+"deg)",opacity:g}})}),b("React").jsx("div",{className:"_1_bs _1_bq",children:b("React").jsx("div",{className:"_1_br",style:{transform:"translateX(-100%) rotate("+e+"deg)",opacity:g}})})]})})]})}});e.exports=a}),null);
__d("SUICard.react",["cx","React","SUIErrorBoundary.react","SUITheme","joinClasses","prop-types","withSUITheme"],(function(a,b,c,d,e,f,g){"use strict";__p&&__p();a=function(a){babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var d=c.prototype;d.render=function(){var a=b("SUITheme").get(this).SUICard;return b("React").jsx("div",{className:b("joinClasses")("_5h92",this.props.className_DEPRECATED,this.props.margin),"data-testid":void 0,style:babelHelpers["extends"]({},this.props.style,{backgroundColor:a.backgroundColor,borderWidth:a.borderWidth,borderRadius:a.borderRadius,borderColor:a.borderColor,boxShadow:a.boxShadow,width:this.props.width}),children:b("React").jsx(b("SUIErrorBoundary.react"),{children:this.props.children})})};return c}(b("React").PureComponent);a.propTypes={"data-testid":(c=b("prop-types")).string,margin:c.string,theme:c.instanceOf(b("SUITheme")),width:c.oneOfType([c.string,c.number])};e.exports=b("withSUITheme")(a)}),null);
__d("QE",["Banzai","Cache"],(function(a,b,c,d,e,f){__p&&__p();var g="qe_log_exposure",h=60,i=new(b("Cache"))();a={logExposure:function(a,c){var d=c?a+"|"+c:a;if(i.has(d))return;var e={signal:!0};a={name:a,id:null};c&&(a.id=c);b("Banzai").post(g,a,e);i.set(d,!0,1,h)}};e.exports=a}),null); | 1,097.631579 | 4,573 | 0.727404 |
1d25b67e9cdf5dc48ff67efdcc36309bdf1e6eba | 4,724 | js | JavaScript | JalienGame/Jalien/main.js | JonnoUK/JonathanTaylorHq | e7e717b9099a63540027ae2f007a05a6b6672dd1 | [
"CC-BY-3.0"
] | null | null | null | JalienGame/Jalien/main.js | JonnoUK/JonathanTaylorHq | e7e717b9099a63540027ae2f007a05a6b6672dd1 | [
"CC-BY-3.0"
] | null | null | null | JalienGame/Jalien/main.js | JonnoUK/JonathanTaylorHq | e7e717b9099a63540027ae2f007a05a6b6672dd1 | [
"CC-BY-3.0"
] | 1 | 2019-10-01T19:32:48.000Z | 2019-10-01T19:32:48.000Z | class MainScreen extends Phaser.Scene {
constructor() {
super({key: 'MainScreen'})
}
preload() {
this.load.image('closedBox', 'bank_chest_closed.png');
this.load.image('openBox', 'Bank_chest_open.png');
this.load.image('jalien', 'hypers.png');
this.load.image('ufo', 'ufo_2.png');
this.load.image('title', 'jalienTitle.png');
}
create() {
gamestate.closedBox = [];
gamestate.title = this.add.sprite(225, 160, 'title').setScale(0);
this.tweens.add({
targets: gamestate.title,
scale: 0.5,
duration: 1000,
ease: 'Power2',
});
for(let step = 0; step < 5; step++) {
var stepX = step + 1;
var alloX = stepX * 75;
console.log(alloX);
console.log(step);
gamestate.closedBox[step] = this.add.sprite(alloX, 75, "closedBox").setInteractive();
gamestate.closedBox[step].setScale(0);
this.tweens.add({
targets: gamestate.closedBox[step],
scale: 0.2,
duration: 1000,
ease: 'Power2',
});
}
for(let secondRow = 5; secondRow < 10; secondRow++) {
var step2X = secondRow - 4;
var alloX = step2X * 75;
console.log(alloX);
gamestate.closedBox[secondRow] = this.add.sprite(alloX, 250, "closedBox").setInteractive();
gamestate.closedBox[secondRow].setScale(0);
this.tweens.add({
targets: gamestate.closedBox[secondRow],
scale: 0.2,
duration: 1000,
ease: 'Power2',
});
}
var correctChest = Math.floor(Math.random(gamestate.closedBox.length)*10);
console.log("Correct Number: "+correctChest);
console.log("length: " +gamestate.closedBox.length);
gamestate.openBox = [];
gamestate.jalien;
for(let i = 0; i < gamestate.closedBox.length; i++) {
if (i != correctChest) {
generateBox(false, i, this);
} else {
generateBox(true, i, this);
}
}
}
}
const gamestate = {
};
function generateBox(correct, i, game) {
if(correct) {
gamestate.closedBox[i].on('pointerdown', function (pointer) {
var xLoc = gamestate.closedBox[i].x;
var yLoc = gamestate.closedBox[i].y;
gamestate.closedBox[i].visible = false;
gamestate.openBox[i] = game.add.sprite(xLoc, yLoc, "openBox").setScale(0.175);
gamestate.openBox[i].flipX = true;
var particles = game.add.particles('ufo');
var emitter = particles.createEmitter();
emitter.setPosition(xLoc, yLoc);
emitter.setSpeed(100);
emitter.setBlendMode(Phaser.BlendModes.ADD);
game.time.delayedCall(2000, ()=> {
emitter.stop();
});
gamestate.jalien = game.add.sprite(xLoc, yLoc, "jalien").setScale(0.1);
game.tweens.add({
targets: gamestate.jalien,
scale: 0.5,
duration: 1000,
ease: 'Power2',
});
game.time.delayedCall(500, ()=> {
game.tweens.add({
targets: gamestate.jalien,
x: xLoc,
y: yLoc-20,
duration: 250,
ease: 'Power2',
yoyo: true,
repeat: 10,
});
});
});
} else {
gamestate.closedBox[i].on('pointerdown', function (pointer) {
var xLoc = gamestate.closedBox[i].x;
var yLoc = gamestate.closedBox[i].y;
gamestate.closedBox[i].visible = false;
gamestate.openBox[i] = game.add.sprite(xLoc, yLoc, "openBox").setScale(0.175);
gamestate.openBox[i].flipX = true;
gamestate.openBox[i].setTint(0xFF0000);
game.tweens.add({
targets: gamestate.openBox[i],
x: xLoc + 2,
duration: 100,
ease: 'Power2',
yoyo: true,
});
});
}
}
const config = {
type: Phaser.AUTO,
width: 450,
height: 350,
backgroundColor: 'white',
physics: {
default: 'arcade',
arcade: {
gravity: {y: 0},
enableBody: true,
debug: false,
}
},
scene: [MainScreen]
}
const game = new Phaser.Game(config); | 31.284768 | 103 | 0.48624 |
1d2874aa39b81e913826143d41f7fcbf0de36f0c | 483 | js | JavaScript | test/jest/fixtures/interface.js | peterboehm/ui-organizations | a6ee1b561eb3dd8980d82b307172d73a03e37218 | [
"Apache-2.0"
] | null | null | null | test/jest/fixtures/interface.js | peterboehm/ui-organizations | a6ee1b561eb3dd8980d82b307172d73a03e37218 | [
"Apache-2.0"
] | 344 | 2019-04-12T12:11:22.000Z | 2022-03-31T16:53:04.000Z | test/jest/fixtures/interface.js | peterboehm/ui-organizations | a6ee1b561eb3dd8980d82b307172d73a03e37218 | [
"Apache-2.0"
] | 4 | 2019-10-01T07:36:09.000Z | 2022-02-23T13:59:30.000Z | export const orgInterface = {
id: '793b9d42-ae12-41d7-a36a-f33e5b9e82c5',
name: 'GOBI',
uri: 'www.gobi3.com',
notes: 'all staff have different logons with different permissions',
available: false,
deliveryMethod: 'Other',
locallyStored: 'false',
statisticsNotes: 'get stats on demand from GOBI, or contact customers service',
type: ['Other'],
metadata: {
createdDate: '2021-06-14T01:51:13.480+00:00',
updatedDate: '2021-06-14T01:51:13.480+00:00',
},
};
| 30.1875 | 81 | 0.689441 |
1d28965cc57cd516b7a4c2535104c773561b21c0 | 471 | js | JavaScript | src/reducers/index.js | tested01/crm_dashboard | c8a597269f4b5626791806164872259799224580 | [
"MIT"
] | null | null | null | src/reducers/index.js | tested01/crm_dashboard | c8a597269f4b5626791806164872259799224580 | [
"MIT"
] | null | null | null | src/reducers/index.js | tested01/crm_dashboard | c8a597269f4b5626791806164872259799224580 | [
"MIT"
] | null | null | null | import { combineReducers } from 'redux';
import LoginReducer from '../reducers/reducer_login';
const appReducer = combineReducers({
loginState: LoginReducer
});
// To reset redux state after sign-out
// reference: https://stackoverflow.com/questions/35622588/how-to-reset-the-state-of-a-redux-store
const rootReducer = (state, action) => {
if (action.type === 'SIGN_OUT') {
state = undefined
}
return appReducer(state, action)
}
export default rootReducer;
| 27.705882 | 98 | 0.730361 |
1d28ab2d33707861a0a9a848f267996d8e939083 | 203 | js | JavaScript | src/client/assets/js/nodes/processors/uibuilder/features/canvas/components/svg/index.js | tsh2/platform-sdk2 | 718660f48ebce52b8eab5e4b304b2353e4feebe7 | [
"MIT"
] | 3 | 2017-01-31T19:15:53.000Z | 2017-05-31T20:49:09.000Z | src/client/assets/js/nodes/processors/uibuilder/features/canvas/components/svg/index.js | tsh2/platform-sdk2 | 718660f48ebce52b8eab5e4b304b2353e4feebe7 | [
"MIT"
] | 12 | 2016-12-13T11:53:19.000Z | 2016-12-13T11:58:07.000Z | src/client/assets/js/nodes/processors/uibuilder/features/canvas/components/svg/index.js | tsh2/platform-sdk2 | 718660f48ebce52b8eab5e4b304b2353e4feebe7 | [
"MIT"
] | 5 | 2017-09-29T08:33:43.000Z | 2018-03-05T01:31:28.000Z | export Circle from './Circle';
export Text from './Text';
export Line from './Line';
export Rect from './Rect';
export Ellipse from './Ellipse';
export Group from './Group';
export Path from './Path'; | 29 | 32 | 0.679803 |
1d29df30919918d0a64596505441d414ab7048a9 | 885 | js | JavaScript | fontmin.js | font-size/fontsmin | 6ffcadb7f1ecf6b39fcb90aef60e97158a5ad56a | [
"MIT"
] | 3 | 2020-11-24T14:14:53.000Z | 2021-12-19T13:05:52.000Z | fontmin.js | font-size/fontsmin | 6ffcadb7f1ecf6b39fcb90aef60e97158a5ad56a | [
"MIT"
] | null | null | null | fontmin.js | font-size/fontsmin | 6ffcadb7f1ecf6b39fcb90aef60e97158a5ad56a | [
"MIT"
] | 2 | 2021-10-10T03:39:28.000Z | 2022-03-21T01:22:24.000Z | module.exports = function (font, text, callback) {
const Fontmin = require('fontmin')
var srcPath = `./fonts/${font}.ttf`; // 字体源文件
var destPath = './font'; // 输出路径
var text = text || '';
// 初始化
var fontmin = new Fontmin()
.src(srcPath) // 输入配置
.use(Fontmin.glyph({ // 字型提取插件
text: text // 所需文字
}))
.use(Fontmin.ttf2eot()) // eot 转换插件
.use(Fontmin.ttf2woff()) // woff 转换插件
.use(Fontmin.ttf2svg()) // svg 转换插件
.use(Fontmin.css()) // css 生成插件
.dest(destPath); // 输出配置
// 执行
fontmin.run(function (err, files, stream) {
if (err) { // 异常捕捉
console.error(err);
}
// console.log('done'); // 成功
return callback('done')
});
}
| 29.5 | 53 | 0.442938 |
1d29fb13d53950d19ed2d9da6af099b2322a7b34 | 891 | js | JavaScript | lib/methods/findAll.js | appcelerator-forks/appcelerator.appc.mysql | c7353b192df4402e201fc4211bb2926ccfb2e0c1 | [
"Apache-2.0"
] | null | null | null | lib/methods/findAll.js | appcelerator-forks/appcelerator.appc.mysql | c7353b192df4402e201fc4211bb2926ccfb2e0c1 | [
"Apache-2.0"
] | null | null | null | lib/methods/findAll.js | appcelerator-forks/appcelerator.appc.mysql | c7353b192df4402e201fc4211bb2926ccfb2e0c1 | [
"Apache-2.0"
] | null | null | null | var Arrow = require('arrow')
/**
* Finds all model instances. A maximum of 1000 models are returned.
* @param {Arrow.Model} Model The model class being updated.
* @param {Function} callback Callback passed an Error object (or null if successful) and the models.
*/
exports.findAll = function (Model, callback) {
var self = this
var table = this.getTableName(Model)
var primaryKeyColumn = this.getPrimaryKeyColumn(Model)
var query = 'SELECT ' +
(primaryKeyColumn ? primaryKeyColumn + ', ' : '') + this.escapeKeys(Model.payloadKeys()).join(', ') +
' FROM ' + table + (primaryKeyColumn ? ' ORDER BY ' + primaryKeyColumn : '') + ' LIMIT 1000'
this._query(query, callback, function (results) {
var rows = []
results.forEach(function (row) {
rows.push(self.getInstanceFromRow(Model, row))
})
callback(null, new Arrow.Collection(Model, rows))
})
}
| 35.64 | 105 | 0.675645 |
1d2a802eacb2016bf876646d8eb836064391e2bb | 1,453 | js | JavaScript | app/main.js | FNNDSC/cjs | 55494d8be7b6a875526cc9012a60ecc4e94d25f3 | [
"MIT"
] | 3 | 2015-08-19T05:01:18.000Z | 2017-01-17T06:55:06.000Z | app/main.js | FNNDSC/cjs | 55494d8be7b6a875526cc9012a60ecc4e94d25f3 | [
"MIT"
] | 1 | 2015-02-03T08:48:27.000Z | 2015-02-03T09:54:10.000Z | app/main.js | FNNDSC/cjs | 55494d8be7b6a875526cc9012a60ecc4e94d25f3 | [
"MIT"
] | null | null | null | var MyApp = MyApp || {};
MyApp.require = require.config({
paths: {
togetherjs: 'https://togetherjs.com/togetherjs-min',
cjs: 'scripts/c'
}
});
// load cjs after togetherJS has been loaded
// turn OFF togetherJS autostart
// should investigate to have it working well with AUTO START TOO
TogetherJSConfig_noAutoStart = true;
MyApp.require(['cjs'], function(Cjs) {
// init cjs
var myCjs = new Cjs();
// event handler
var myHandler = {
id: 'fireID',
name: 'app.fireMessage',
target: 'fireButton',
callback: function(message){
window.console.log('fireMessage received! ' + message);
}
}
// callback after TogetherJS is ready to go
myCjs.ready = function(){
document.getElementById("joinTP").innerHTML = 'Leave the party :(';
// add hanlers
myCjs.add(myHandler);
};
// callback after TogetherJS is ready to close
myCjs.close = function(){
document.getElementById("joinTP").innerHTML = 'Join the party :)';
// remove handler
// only 1 fireMessage in this case
myCjs.remove(myHandler);
};
// connect click callback
document.getElementById("joinTP").onclick=function(){
var roomName = document.getElementById("roomName").value;
myCjs.join(roomName);
};
document.getElementById("fireButton").onclick=function(){
var event = new CustomEvent('app.fireMessage', { 'detail': 'hello my friend' });
this.dispatchEvent(event);
};
}); | 25.946429 | 84 | 0.660702 |
1d2aacb0bcbb22f204abe27d5b1727161b76bec9 | 1,704 | js | JavaScript | 4.x/a02745.js | musasesay/tesseract-ocr.github.io | 61f815042b9722305fc9d4933c3dbf3b5e3915b5 | [
"Apache-2.0"
] | null | null | null | 4.x/a02745.js | musasesay/tesseract-ocr.github.io | 61f815042b9722305fc9d4933c3dbf3b5e3915b5 | [
"Apache-2.0"
] | null | null | null | 4.x/a02745.js | musasesay/tesseract-ocr.github.io | 61f815042b9722305fc9d4933c3dbf3b5e3915b5 | [
"Apache-2.0"
] | null | null | null | var a02745 =
[
[ "SPLIT", "a02745.html#a8994d5b2afb2ae21fc35b4ac527af1b1", null ],
[ "SPLIT", "a02745.html#a595fc01e6d1baa1476e8544782affd5f", null ],
[ "bounding_box", "a02745.html#a781f4be39df4ddfc8767c71b75587e8b", null ],
[ "Box12", "a02745.html#a40fa1801c0de4f18d4f25186659fe6af", null ],
[ "Box21", "a02745.html#a6828f7be08009a1f318df1e66083e88f", null ],
[ "ContainedByBlob", "a02745.html#a58053e080fb693b83bdc295f6133c27e", null ],
[ "ContainedByOutline", "a02745.html#a8ddbf9b9affec572461c7a017567c79c", null ],
[ "FullPriority", "a02745.html#a232cbddbf32d4da6f1970e253cdee500", null ],
[ "Hide", "a02745.html#a8a409bf6389371aa49f6eee0e73e0c78", null ],
[ "IsHealthy", "a02745.html#a5bb86783faf35fc2da4b2e4321803598", null ],
[ "IsLittleChunk", "a02745.html#a36795324eb4936ef2a0606dd454c8eeb", null ],
[ "Mark", "a02745.html#ac705686670e73ffbbf88af5c54ab2b78", null ],
[ "Print", "a02745.html#a92c64d68f081746782554c80bbaca59c", null ],
[ "Reveal", "a02745.html#a6db864f7439765553bf32a97e7da07d0", null ],
[ "SharesPosition", "a02745.html#abbcb53a438788e1f8e32fc317a0567ca", null ],
[ "SplitOutline", "a02745.html#ab0fb61a13fdabba9a3deeca5e5ed63ba", null ],
[ "SplitOutlineList", "a02745.html#a6f2987e297bb1e316711d6d7ce7a0c78", null ],
[ "UnsplitOutlineList", "a02745.html#abb8a656558c71a49995ec06fcca6e707", null ],
[ "UnsplitOutlines", "a02745.html#acdc9b8bde015c833cf073a0425f4ba45", null ],
[ "UsesPoint", "a02745.html#aec319596c1125a2fa11988ef27e74feb", null ],
[ "point1", "a02745.html#a6e1438a5497d0376b4daed310395d7bf", null ],
[ "point2", "a02745.html#a71ffab0530d007b565e69711594afa08", null ]
]; | 68.16 | 84 | 0.737676 |
1d2b2a3328f16b36b3bd4879de154ba19697aac6 | 612 | js | JavaScript | linda/linda_app/static/r2r/scripts/controllers/csvreconile.js | cbotsikas/LindaWorkbench | b2bfa091fb4ec80ac35b3f68edf46780c1e9ffea | [
"MIT"
] | null | null | null | linda/linda_app/static/r2r/scripts/controllers/csvreconile.js | cbotsikas/LindaWorkbench | b2bfa091fb4ec80ac35b3f68edf46780c1e9ffea | [
"MIT"
] | null | null | null | linda/linda_app/static/r2r/scripts/controllers/csvreconile.js | cbotsikas/LindaWorkbench | b2bfa091fb4ec80ac35b3f68edf46780c1e9ffea | [
"MIT"
] | null | null | null | (function() {
'use strict';
angular.module('app').controller('CsvReconcileCtrl', function($scope, _, Oracle, Csv, Rdf) {
$scope.csv = Csv;
$scope.rdf = Rdf;
$scope.loading = false;
$scope.subjectTag = {};
$scope.columnTags = {};
return $scope.ask = function(subject, columns) {
$scope.loading = true;
return Oracle.ask(subjects, $scope.subjectTag, columns, $scope.columnTags).then(function(promise) {
$scope.loading = false;
return $scope.rdf.suggestions[filename] = promise;
});
};
});
}).call(this);
//# sourceMappingURL=csvreconile.js.map
| 29.142857 | 105 | 0.624183 |
1d2b2abe069a20312ed13f7ac0d8304436abdf33 | 3,855 | js | JavaScript | src/Services/UserService.js | shardik95/Client-BeatDrop-ReactJs | 208606a72db5020efb9612b95381ada2c119e33e | [
"MIT"
] | 2 | 2018-08-07T00:06:28.000Z | 2018-08-08T23:31:00.000Z | src/Services/UserService.js | shardik95/Client-BeatDrop | 208606a72db5020efb9612b95381ada2c119e33e | [
"MIT"
] | 9 | 2020-07-16T07:03:28.000Z | 2022-03-08T22:09:34.000Z | src/Services/UserService.js | shardik95/Client-BeatDrop | 208606a72db5020efb9612b95381ada2c119e33e | [
"MIT"
] | null | null | null | let _singleton=Symbol()
class UserService{
constructor(singletonToken) {
if (_singleton !== singletonToken)
throw new Error('Cannot instantiate directly.');
}
static get instance() {
if(!this[_singleton])
this[_singleton] = new UserService(_singleton);
return this[_singleton]
}
createUser(user){
return fetch("https://beatdrop.herokuapp.com/api/signup",{
method:'post',
headers:{
'content-type':'application/json',
'Accept': 'application/json',
'Access-Control-Allow-Credentials':true,
'Access-Control-Allow-Origin':true
},
body:JSON.stringify(user),
credentials: 'include',
})
}
loginUser(user){
return fetch("https://beatdrop.herokuapp.com/api/login",{
method:'post',
headers:{
'content-type':'application/json',
'Accept': 'application/json',
'Access-Control-Allow-Credentials':true,
'Access-Control-Allow-Origin':true
},
body:JSON.stringify(user),
credentials: 'include',
})
}
findUserById(id){
return fetch("https://beatdrop.herokuapp.com/api/user/"+id)
.then(response =>(
response.json()
))
}
logout(){
fetch("https://beatdrop.herokuapp.com/api/logout",{
credentials: 'include'
})
}
findByUsernameOrFirstName(query){
return fetch("https://beatdrop.herokuapp.com/api/user/search/q="+query)
.then(response=>response.json())
}
updateUser(user){
return fetch("https://beatdrop.herokuapp.com/api/user",{
credentials: 'include',
headers:{
'content-type':'application/json',
},
method:'put',
body:JSON.stringify(user)
}).then(response=>response.json())
}
followUser(user,userId){
return fetch("https://beatdrop.herokuapp.com/api/user/following/"+userId,{
method:'post',
headers:{
'content-type':'application/json',
},
credentials: 'include',
body:JSON.stringify(user)
}).then(response=>response.json())
}
unfollow(followingId,followerId){
return fetch("https://beatdrop.herokuapp.com/api/following/FID/follower/F_Id".replace("FID",followingId).replace("F_Id",followerId),{
method:'delete',
credentials: 'include'
}).then(response=>response.json())
}
findAllUsers(){
return fetch("https://beatdrop.herokuapp.com/api/user")
.then(response=>response.json())
}
deleteUser(id){
return fetch("https://beatdrop.herokuapp.com/api/user/"+id,{
method:'delete'
}).then(response=>response.json())
}
verifyUser(user){
return fetch("https://beatdrop.herokuapp.com/api/verify",{
method:'post',
headers:{
'content-type':'application/json',
},
credentials: 'include',
body:JSON.stringify(user)
}).then(response=>response.json())
}
update(user){
return fetch("https://beatdrop.herokuapp.com/api/user/admin",{
credentials: 'include',
headers:{
'content-type':'application/json',
},
method:'put',
body:JSON.stringify(user)
}).then(response=>response.json())
}
getSession(){
return fetch("https://beatdrop.herokuapp.com/api/profile",{
credentials: 'include',
}).then((response)=>response.json())
}
}
export default UserService; | 28.768657 | 141 | 0.536965 |
1d2b5ad0e0e12d48cbf7403c1ab62fcdfa1fb5c1 | 6,923 | js | JavaScript | components/AccountCard.js | vanita5/mastodon-twitter-bridge | 9bfc676701b0430baf7c3958e7d715ab16bfe124 | [
"MIT"
] | 2 | 2017-04-04T16:15:35.000Z | 2017-04-09T12:58:54.000Z | components/AccountCard.js | vanita5/mastodon-twitter-bridge | 9bfc676701b0430baf7c3958e7d715ab16bfe124 | [
"MIT"
] | null | null | null | components/AccountCard.js | vanita5/mastodon-twitter-bridge | 9bfc676701b0430baf7c3958e7d715ab16bfe124 | [
"MIT"
] | null | null | null | // @flow
import { Button, Card, CardBlock, CardSubtitle, CardTitle } from 'reactstrap';
import { PureComponent } from 'react';
import api from '../lib/isoAPI';
type CardAccount =
| {
type: 'twitter',
account: TwitterAccountData,
}
| {
type: 'mastodon',
account: MastodonAccountData,
};
type Props = {
affectedConnections: number,
accountData: CardAccount,
};
type State = {
isDeleted?: boolean,
deletionOngoing?: { resolve: Function, reject: Function },
deletionError?: boolean,
};
export default class AccountCard extends PureComponent {
props: Props;
state: State = {};
deletionPromise = (): { resolve: Function, reject: Function } => {
const { account, type } = this.props.accountData;
let resolve = () => {};
let reject = () => {};
new Promise((res, rej) => {
resolve = res;
reject = rej;
}).then(
async () => {
const res = await api.deleteAccount(account.id, type);
if (res.status === 200) {
this.setState({
isDeleted: true,
});
} else {
this.setState({
deletionError: true,
deletionOngoing: this.deletionPromise(),
});
}
},
() => {
this.setState({
deletionOngoing: undefined,
deletionError: false,
});
}
);
return { resolve, reject };
};
handleDeleteIconClick = () => {
this.setState((state: State) => ({
deletionOngoing: state.deletionOngoing ? undefined : this.deletionPromise(),
deletionError: false,
}));
};
render() {
const a = this.props.accountData;
const { affectedConnections } = this.props;
const { isDeleted, deletionOngoing, deletionError } = this.state;
if (isDeleted) {
return null;
}
return (
<Card className="text-center" style={style.card}>
<div style={style.image(a.account.backgroundImage)} className="card-img-top">
<div style={style.avatar(a.account.profileImage)} />
<div style={style.delete(Boolean(deletionOngoing))}>
<span
style={style.deleteIcon}
className="fa fa-trash-o"
onClick={this.handleDeleteIconClick}/>
</div>
</div>
<div style={style.showContainer(Boolean(deletionOngoing))}>
{deletionOngoing &&
<div style={style.askDeletionBody}>
{deletionError &&
<span style={style.error}>
{'An error occured, please try again.'}
</span>}
<span>{'Sure \'bout that?'}</span>
<span className="text-danger">
{`This will delete ${affectedConnections} Connections!`}
</span>
<div style={style.deletionButtons}>
<Button
style={style.askDelButton}
color="danger"
onClick={deletionOngoing ? deletionOngoing.resolve : undefined}>
{'Yep'}
</Button>
<Button
style={style.askDelButton}
onClick={deletionOngoing ? deletionOngoing.reject : undefined}>
{'Nope'}
</Button>
</div>
</div>}
</div>
<CardBlock>
<CardTitle>{a.account.name}</CardTitle>
<CardSubtitle>
{`@${a.account.screenName}`}
{a.type === 'mastodon' &&
<span style={style.instance}>{`@${a.account.instanceUrl}`}</span>}
{a.account.protected && <span className="fa fa-lock" style={style.lock} />}
</CardSubtitle>
</CardBlock>
</Card>
);
}
}
const style = {
card: {
width: 400,
margin: '15px auto',
overflow: 'hidden',
position: 'relative',
},
image: src => ({
width: '100%',
height: 200,
backgroundImage: `url(${src})`,
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
backgroundSize: 'cover',
display: 'inline-flex',
flexDirection: 'row',
padding: 20,
alignItems: 'center',
justifyContent: 'center',
}),
avatar: src => ({
backgroundImage: `url(${src})`,
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
backgroundSize: 'cover',
height: 100,
width: 100,
border: '2px solid white',
borderRadius: 4,
boxShadow: '0px 0px 20px 0px rgba(0,0,0,0.75)',
}),
delete: big => ({
backgroundColor: `rgba(255, 255, 255, ${big ? 0.8 : 0.5})`,
width: big ? 895 : 25,
height: big ? 895 : 25,
position: 'absolute',
top: big ? -435 : 0,
right: big ? -435 : 0,
borderRadius: '50%',
transition: 'all 0.3s',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
margin: 15,
}),
showContainer: shown => ({
opacity: shown ? 1 : 0,
transition: 'opacity 0.3s',
}),
askDeletionBody: {
position: 'absolute',
top: 0,
right: 0,
height: '100%',
width: '100%',
zIndex: 2,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
},
deletionButtons: {
marginTop: 20,
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
},
askDelButton: {
margin: 5,
cursor: 'pointer',
},
error: {
color: '#be0000',
fontStyle: 'italic',
position: 'absolute',
top: 40,
},
deleteIcon: {
padding: 5,
cursor: 'pointer',
color: '#be0000',
zIndex: 3,
},
lock: {
marginLeft: 5,
},
instance: {
//fontStyle: 'italic',
fontWeight: 'lighter',
color: '#aaa',
},
};
| 31.611872 | 100 | 0.442727 |
1d2bc3337d7d7d93876315953ffaee8976a7d96c | 962 | js | JavaScript | function_Directory/BinaryTree/checkLeaf.js | AlaaN-Smadi/Data_Structure_And_Algorithm | 268b82ad33310bd7a90eae750cb36ba6be8647cc | [
"MIT"
] | null | null | null | function_Directory/BinaryTree/checkLeaf.js | AlaaN-Smadi/Data_Structure_And_Algorithm | 268b82ad33310bd7a90eae750cb36ba6be8647cc | [
"MIT"
] | null | null | null | function_Directory/BinaryTree/checkLeaf.js | AlaaN-Smadi/Data_Structure_And_Algorithm | 268b82ad33310bd7a90eae750cb36ba6be8647cc | [
"MIT"
] | null | null | null |
'use strict';
let leafArr = [];
let numberOfPassed = 0;
let checkLeaf = (tree1, tree2) => {
if(!tree1.root || !tree2.root){
return("Empty Tree");
}
addMyLeaf(tree1.root);
let result = compareFun(tree2.root);
// console.log(numberOfPassed);
// console.log(leafArr.length);
return(result);
}
let addMyLeaf = node => {
// preOrder Traversal
if(!node.left && !node.right){
leafArr.push(node.value);
}
if(node.left){
addMyLeaf(node.left);
}
if(node.right){
addMyLeaf(node.right);
}
}
let compareFun = node => {
let returnBolean = true;
if(!node.left && !node.right){
numberOfPassed+=1;
returnBolean = leafArr.includes(node.value)
}
if(node.left){
returnBolean = compareFun(node.left);
}
if(node.right){
returnBolean = compareFun(node.right);
}
return(returnBolean);
}
module.exports = checkLeaf; | 17.178571 | 51 | 0.576923 |
1d2be69e4758ddd9b97c39a55bd74e8d36f330ab | 362 | js | JavaScript | routes/uploadFile.js | xiechuanlong/klMork | dc09db85287543ed68f3e4e173cfe8bebf81f272 | [
"0BSD"
] | null | null | null | routes/uploadFile.js | xiechuanlong/klMork | dc09db85287543ed68f3e4e173cfe8bebf81f272 | [
"0BSD"
] | 4 | 2020-07-17T17:11:03.000Z | 2021-05-09T23:43:29.000Z | routes/uploadFile.js | xiechuanlong/kl-jMockr | dc09db85287543ed68f3e4e173cfe8bebf81f272 | [
"0BSD"
] | null | null | null | module.exports = function (app) {
app.post('/batchUploadFile.do', function (req, res) {
res.json({
"retCode": 200,
"retDesc": "操作成功",
"md5": "3b7ef9e6de488f9f58a820061cd2753c",
"fileName": "1481594190007x.zip",
"url": "http://haitao.nosdn1.127.net/1481594190007x.zip"
});
});
}; | 32.909091 | 68 | 0.530387 |
1d2c8231e7530372d4a7db753c0ca0d13aabb710 | 2,147 | js | JavaScript | index.js | stemcmyk/Presence-Man | 21feb4ca34992bdeb2c2dd075f41793fde0268c8 | [
"MIT"
] | null | null | null | index.js | stemcmyk/Presence-Man | 21feb4ca34992bdeb2c2dd075f41793fde0268c8 | [
"MIT"
] | null | null | null | index.js | stemcmyk/Presence-Man | 21feb4ca34992bdeb2c2dd075f41793fde0268c8 | [
"MIT"
] | null | null | null | const { Client, MessageEmbed, Presence, Collection } = require("discord.js");
const fs = require("fs");
const moment = require("moment");
const ms = require("ms");
require("dotenv").config();
const Database = require("./database");
const Basic_functions = require("./basic_functions");
const client = new Client();
var prefix = process.env.PREFIX;
client.prefix = prefix;
var excluded = ["Spotify"];
const localInterval = 5000;
client.commands = new Collection(); // Collection for all commands
client.aliases = new Collection(); // Collection for all aliases of every command
["command"].forEach((handler) => {
require(`./handlers/${handler}`)(client);
});
client.on("message", async (message) => {
if (message.author.bot) return;
if (!message.guild) return;
if (!message.content.startsWith(prefix)) return;
if (!message.member)
message.member = await message.guild.fetchMember(message);
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const cmd = args.shift().toLowerCase();
if (cmd.length === 0) return;
let command = client.commands.get(cmd);
if (!command) command = client.commands.get(client.aliases.get(cmd));
if (command) command.run(client, message, args);
});
client.on("ready", async () => {
console.log(`Logged in as ${client.user.tag}!`);
setInterval(async () => {
var users = await Database.fetchUsers();
users.forEach((user) => {
var cuser;
client.guilds.cache.forEach((server) => {
var duser = server.members.cache.get(user.discordId);
if (duser) cuser = duser;
});
if (!cuser) return;
var show = [];
cuser.guild.presences.cache
.get(cuser.id)
.activities.forEach((presence) => {
if ((presence.type = "PLAYING")) {
var not = false;
excluded.forEach((exc) => {
if (presence.name == exc) not = true;
});
if (!not) {
show.push(presence);
}
}
});
Database.updateTime(cuser.id, show, localInterval / 1000);
});
}, localInterval);
});
client.login(process.env.CLIENT_TOKEN);
| 32.530303 | 81 | 0.619935 |
1d2ca8707fec058643f92b21682ff1ea01e9bdb8 | 400 | js | JavaScript | node_modules/ts-morph/dist/utils/comparers/ComparerToStoredComparer.js | USSDlover/abp-sam-nestjs | 9b1beaee34d203a2bb0dcc6d4ce4ec17062b9a49 | [
"MIT"
] | 29 | 2019-08-30T08:45:43.000Z | 2022-03-16T01:27:21.000Z | node_modules/ts-morph/dist/utils/comparers/ComparerToStoredComparer.js | USSDlover/abp-sam-nestjs | 9b1beaee34d203a2bb0dcc6d4ce4ec17062b9a49 | [
"MIT"
] | 4 | 2019-08-13T09:48:00.000Z | 2022-01-22T08:25:20.000Z | node_modules/ts-morph/dist/utils/comparers/ComparerToStoredComparer.js | USSDlover/abp-sam-nestjs | 9b1beaee34d203a2bb0dcc6d4ce4ec17062b9a49 | [
"MIT"
] | 7 | 2019-08-13T09:34:39.000Z | 2021-11-07T16:13:09.000Z | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ComparerToStoredComparer {
constructor(comparer, storedValue) {
this.comparer = comparer;
this.storedValue = storedValue;
}
compareTo(value) {
return this.comparer.compareTo(this.storedValue, value);
}
}
exports.ComparerToStoredComparer = ComparerToStoredComparer;
| 30.769231 | 65 | 0.69 |
1d2e1df433bc87d88021d979ade05cfe38241b94 | 1,818 | js | JavaScript | app/assets/javascripts/ng-control/data_association.js | OLA-Simple/OLASimple-Aquarium | 42aa3f66be85fde32ceab86f34ec9df8008ca073 | [
"MIT"
] | 25 | 2020-06-14T16:31:17.000Z | 2021-11-28T13:16:44.000Z | app/assets/javascripts/ng-control/data_association.js | OLA-Simple/OLASimple-Aquarium | 42aa3f66be85fde32ceab86f34ec9df8008ca073 | [
"MIT"
] | 252 | 2020-06-11T16:58:06.000Z | 2022-03-30T21:57:30.000Z | app/assets/javascripts/ng-control/data_association.js | OLA-Simple/OLASimple-Aquarium | 42aa3f66be85fde32ceab86f34ec9df8008ca073 | [
"MIT"
] | 7 | 2018-08-30T02:46:19.000Z | 2020-05-17T19:46:27.000Z | (function() {
var w = angular.module('aquarium');
w.controller( 'daCtrl', [ '$scope', '$http', '$attrs',
function ( $scope, $http, $attrs ) {
$scope.toggle_modal = function(da) {
da.modal = !da.modal;
};
$scope.is_image = function(da) {
return da.upload.upload_content_type.split("/")[0] == "image";
}
$scope.title = function(da) {
return "Data associated with " + da.parent_class + " " + da.id + ". Key: " + da.key;
}
$scope.notes = function(parent) {
var das = aq.where(parent.data_associations,function(da) { return da.key == "notes"; });
if ( das.length > 0 ) {
return das[0].value;
} else {
return null;
}
}
$scope.edit_note = function(parent) {
parent.note = $scope.notes(parent);
parent.edit_modal = true;
}
function set_da(parent,key,value) {
var das = aq.where(parent.data_associations,function(da) { return da.key == key; });
if ( das.length > 0 ) {
das[0].set(value);
} else {
var obj = {};
obj[key] = value;
var da = new DataAssociation($http).from({
key: key,
object: JSON.stringify(obj),
id: parent.id
});
if ( ! parent.data_associations ) {
parent.data_associations = [];
}
parent.data_associations.push(da);
}
}
$scope.save_note = function(parent,parent_class) {
$http.post(
"/browser/save_data_association",
{
key: "notes",
value: parent.note,
parent_class: parent_class,
id: parent.id
}
).then(function(result) {
parent.edit_modal = false;
set_da(parent,"notes",parent.note);
})
}
}]);
})(); | 25.25 | 100 | 0.518702 |
1d2e71dffb211d291befa00f2ec9e4b1ec8d336d | 1,760 | js | JavaScript | addons/ewei_shopv2/plugin/groups/static/js/op.js | xunexploit/phpdan9 | 2390ad9b62c6424d158c265b49b3a2ed6a3e3c41 | [
"Apache-2.0"
] | null | null | null | addons/ewei_shopv2/plugin/groups/static/js/op.js | xunexploit/phpdan9 | 2390ad9b62c6424d158c265b49b3a2ed6a3e3c41 | [
"Apache-2.0"
] | null | null | null | addons/ewei_shopv2/plugin/groups/static/js/op.js | xunexploit/phpdan9 | 2390ad9b62c6424d158c265b49b3a2ed6a3e3c41 | [
"Apache-2.0"
] | 1 | 2019-12-13T18:10:26.000Z | 2019-12-13T18:10:26.000Z | eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('S([\'9\',\'G\'],2(9,G){f 4={};4.U=2(c){8(V c===R){c=7}4.c=c;$(\'.d-t Q\').l(\'H\').H(2(){f 3=$(k).i(\'3\');f u=$(k).u();8(u==\'\'){g}b.w(\'确认要取消订单吗?\',\'提示\',2(){4.t(3,u,7)})});$(\'.d-r\').l(\'a\').a(2(){f 3=$(k).i(\'3\');b.w(\'确认要删除订单吗?\',\'提示\',2(){4.r(3)})});$(\'.d-n\').l(\'a\').a(2(){f 3=$(k).i(\'3\');b.w(\'确认已收到货了吗?\',\'提示\',2(){4.n(3)})});$(\'.d-e\').l(\'a\').a(2(){f 3=$(k).i(\'3\');4.e(3)})};4.t=2(5,x){9.o(\'h/j/t\',{5:5,x:x},2(6){8(6.s==1){8(4.c){v.B=9.C(\'h/j\')}D{$(".d-E[i-3=\'"+5+"\']").K()}g}b.z.m(6.p)},7,7)};4.r=2(5){9.o(\'h/j/r\',{5:5},2(6){8(6.s==1){8(4.c){v.B=9.C(\'h/j\')}D{$(".d-E[i-3=\'"+5+"\']").K()}g}b.z.m(6.p)},7,7)};4.n=2(5){9.o(\'h/j/n\',{5:5},2(6){8(6.s==1){v.Z();g}b.z.m(6.p)},7,7)};4.e=2(3){q=I 16({15:$(".d-e-X").W(),N:"M-4",T:2(){q.A()}});q.m();$(\'.e-J\').F(\'.A\').l(\'a\').a(2(){q.A()});9.o(\'h/e/14\',{5:3},2(y){8(y.s==0){b.12(\'生成出错,请刷新重试!\');g}f L=+I P();$(\'.e-J\').F(\'.11\').17(\'Y\',y.p.13+"?10="+L).m()},O,7)};g 4});',62,70,'||function|orderid|modal|id|pay_json|true|if|core|click|FoxUI|fromDetail|order|verify|var|return|groups|data|orders|this|unbind|show|finish|json|result|container|delete|status|cancel|val|location|confirm|remark|ret|toast|close|href|getUrl|else|item|find|tpl|change|new|pop|remove|time|popup|extraClass|false|Date|select|undefined|define|maskClick|init|typeof|html|hidden|src|reload|timestamp|qrimg|alert|url|qrcode|content|FoxUIModal|attr'.split('|'),0,{}))
| 880 | 1,759 | 0.50625 |
1d2f2801180702ed6e2c17f90df3bd9c8212381b | 12,207 | js | JavaScript | src/components/lib/csoundinstr.js | docb/csound-web-gatsby-react-bootstrap-starter | eb9f80743536292905611066af5e6f22c77ef731 | [
"Unlicense"
] | null | null | null | src/components/lib/csoundinstr.js | docb/csound-web-gatsby-react-bootstrap-starter | eb9f80743536292905611066af5e6f22c77ef731 | [
"Unlicense"
] | null | null | null | src/components/lib/csoundinstr.js | docb/csound-web-gatsby-react-bootstrap-starter | eb9f80743536292905611066af5e6f22c77ef731 | [
"Unlicense"
] | null | null | null | import React from "react"
import {Button, Row, Col} from "react-bootstrap"
import Instrument from "./instrument.js"
import HFader from "./hfader"
import Select from "react-select"
import OSC from 'osc-js'
import {withPrefix} from "gatsby";
const noteMap = {
KeyZ: 60,
KeyS: 61,
KeyX: 62,
KeyD: 63,
KeyC: 64,
KeyV: 65,
KeyG: 66,
KeyB: 67,
KeyH: 68,
KeyN: 69,
KeyJ: 70,
KeyM: 71,
Comma: 72,
KeyL: 73,
Period: 74,
KeyQ: 72,
Digit2: 73,
KeyW: 74,
Digit3: 75,
KeyE: 76,
KeyR: 77,
Digit5: 78,
KeyT: 79,
Digit6: 80,
KeyY: 81,
Digit7: 82,
KeyU: 83,
KeyI: 84,
Digit9: 85,
KeyO: 86,
Digit0: 87,
KeyP: 88,
BracketLeft: 89,
Equal: 90,
BracketRight: 91,
}
class CsoundInstr extends React.Component {
constructor(props) {
super(props)
let t = {value: {name: "12edo"}, label: "12edo"}
this.state = {
csoundLoaded: "loading",
csndstatus: "dbyellow",
started: true,
midi: false,
velocity: 100,
octave: 5,
currentTuning: t,
oscmsg: 'No OSC'
}
this.inst = props.inst
this.instrument = React.createRef()
this.options = props.tunings.map(tuning => {
return {value: tuning, label: tuning.name}
})
this.options.unshift(t)
this.root = React.createRef()
this.midichannels = [{label: "All Channels", value: 0}];
this.state.midichannel = this.midichannels[0];
for (let k = 1; k <= 16; k++) {
this.midichannels.push({label: 'Chn ' + k, value: k});
}
if (this.props.keyboard) {
this.bc = new BroadcastChannel(this.props.keyboard);
this.bc.onmessage = msg => {
console.log(msg);
if (msg.data.noteon) {
this.noteOn(msg.data.noteon);
}
if (msg.data.noteoff) {
this.noteOff(msg.data.noteoff);
}
if (msg.data.freqon) {
this.freqOn(msg.data.freqon.freq,msg.data.freqon.vel);
}
if (msg.data.freqoff) {
this.freqOff(msg.data.freqoff.freq);
}
}
}
}
async componentDidMount() {
const url = this.props.csoundwasm
const {Csound} = await import(/* webpackIgnore: true */ url)
this.csound = await Csound({
withPlugins: this.props.plugins,
})
const csdresp = await fetch(this.props.csd)
let buf = await csdresp.text()
let csd = this.props.csd.substring(this.props.csd.lastIndexOf("/") + 1)
this.csound.fs.writeFileSync(csd, buf)
let result = await this.csound.compileCsd(csd)
if (result) {
this.setState({csoundLoaded: "compiling csd failed"})
} else {
await this.csound.start()
this.setState({csoundLoaded: "running"})
this.setState({csndstatus: "dbgreen"})
this.props.onStart && this.props.onStart()
this.audioContext = await this.csound.getAudioContext()
let isStarted = this.audioContext.state === "running"
this.setState({started: isStarted})
if (navigator.requestMIDIAccess) {
console.log("WebMIDI support - yes")
navigator.requestMIDIAccess().then(this.webMidiInit.bind(this),
this.webMidiErr.bind(this))
} else {
console.log("No WebMIDI support")
this.setState({midierr: "No WebMIDI Support"})
}
}
if (this.props.osc) {
this.osc = new OSC();
this.osc.open({
host: "localhost",
port: 47100
});
this.osc.on('error', () => this.setState({oscmsg: 'No OSC'}));
this.osc.on('open', () => {
this.setState({oscmsg: 'OSC Connected'});
});
this.osc.on('close', () => {
this.setState({oscmsg: 'No OSC'})
});
this.osc.on('*', this.onOSC.bind(this));
}
this.instrument.current.setDefaultValues();
this.root.current.focus();
}
webMidiInit(midi_handle) {
let devicesAvailable = false
let devs = midi_handle.inputs.values()
this.devices = []
for (let device = devs.next(); device && !device.done; device = devs.next()) {
console.log(device)
this.devices.push({value: device.value, label: device.value.name})
devicesAvailable = true
}
if (!devicesAvailable) {
console.log("No midi devices available")
this.setState({midierr: "No devices found"})
} else {
console.log("WebMIDI support enabled")
this.setState({midi: true})
this.setState({currentDevice: this.devices[0]})
this.devices[0].value.onmidimessage = this.onMidiEvent.bind(this)
}
}
webMidiErr(err) {
console.log(err);
this.setState({midierr: "Error in WebMIDI"});
}
componentWillUnmount() {
if (this.csound) {
this.csound.stop()
this.csound.destroy()
}
}
getFreq(key) {
let currentTuning = this.state.currentTuning.value
let note = (key + currentTuning.basekey) % 12
let octave = Math.floor((key + currentTuning.basekey) / 12)
return currentTuning.basefreq * currentTuning.scale[note] * Math.pow(2, octave)
}
sendNoteEvent(key, vel, on) {
let eventStr
if (this.state.currentTuning.value.name === "12edo") {
eventStr = `i "trig" 0 0.1 ${on} ${key} ${vel}`
} else {
eventStr = `i "freqtrig" 0 0.1 ${on} ${this.getFreq(key)} ${vel}`
}
console.log(eventStr)
this.csound.readScore(eventStr)
}
async getChannel(chn) {
if (this.csound) {
return await this.csound.getControlChannel(chn)
}
}
async getTable(fn) {
if (this.csound) {
return await this.csound.tableCopyOut(fn)
}
}
async getTableLength(fn) {
if (this.csound) {
return await this.csound.tableLength("" + fn)
}
}
onMidiEvent(event) {
const chn = (event.data[0] & 0x0f) + 1;
const chfilter = this.state.midichannel.value;
if (chfilter && chn !== chfilter) return;
switch (event.data[0] & 0xf0) {
case 0x90:
if (event.data[2] !== 0) {
this.sendNoteEvent(event.data[1], event.data[2], 1)
}
break
case 0x80:
this.sendNoteEvent(event.data[1], event.data[2], 0)
break
case 0xB0:
this.instrument.current.setCtrlValue(event.data[1], event.data[2])
break
default:
return
}
}
onOSC(message) {
const pathSplit = message.address.split('/');
if (pathSplit.length > 2) {
if (pathSplit[1] === this.props.osc) {
if (pathSplit[2] === 'note') {
this.sendNoteEvent(message.args[1], message.args[2], message.args[0]);
} else if (pathSplit[2] === 'notefreq') {
const eventStr = `i "freqtrig" 0 0.1 ${message.args[0]} ${message.args[1]} ${message.args[2]}`
this.csound.readScore(eventStr)
} else {
if (pathSplit.length > 3)
this.instrument.current.setValues({[pathSplit[2]]: {[pathSplit[3]]: message.args[0]}});
else
this.instrument.current.setValues({[pathSplit[2]]: message.args[0]});
}
}
}
}
handleStart() {
if (!this.state.started) {
this.audioContext.resume()
this.setState({started: true})
}
}
handleUpdate(id, val) {
if (!this.csound) return
if (val instanceof Object) {
Object.keys(val).forEach(key => {
this.handleUpdate(key, val[key])
})
} else if (val instanceof String || typeof val === "string") {
this.csound.setStringChannel(id, val)
} else {
console.log("set ctrl", id, val)
this.csound.setControlChannel(id, val)
}
}
onKeyDown(event) {
if (event.repeat) return
const note = noteMap[event.nativeEvent.code]
if (note) {
this.sendNoteEvent(note - 60 + this.state.octave * 12, this.state.velocity, 1)
}
}
onKeyUp(event) {
if (event.repeat) return
const note = noteMap[event.nativeEvent.code]
if (note) {
this.sendNoteEvent(note - 60 + this.state.octave * 12, this.state.velocity, 0)
}
}
onVelChange(vel) {
this.setState({velocity: vel})
}
onOctaveChange(oct) {
this.setState({octave: oct})
}
handleSelect = (currentTuning) => {
this.setState({currentTuning}, () =>
console.log(`Option selected:`, this.state.currentTuning),
)
}
handleMidiSelect = (device) => {
console.log("selected: ", device.value.name)
this.state.currentDevice.value.onmidimessage = undefined
this.setState({currentDevice: device})
device.value.onmidimessage = this.onMidiEvent.bind(this)
}
noteOn = (note) => {
if (note) {
this.sendNoteEvent(note - 60 + this.state.octave * 12, this.state.velocity, 1);
}
}
noteOff = (note) => {
if (note) {
this.sendNoteEvent(note - 60 + this.state.octave * 12, this.state.velocity, 0);
}
}
freqOn = (freq,vel) => {
if(freq) {
const eventStr = `i "freqtrig" 0 0.1 1 ${freq} ${vel}`;
console.log(eventStr)
this.csound.readScore(eventStr);
}
}
freqOff = (freq) => {
if(freq) {
const eventStr = `i "freqtrig" 0 0.1 0 ${freq} 0`;
console.log(eventStr)
this.csound.readScore(eventStr);
}
}
onChannelChange(chn) {
this.setState({midichannel: chn});
}
onOpenKeyboard() {
if(this.kw && !this.kw.closed) {
this.kw.focus();
} else {
this.kw = window.open(withPrefix("/keyboard"), 'keyboardwindow',
'left=800,top=20,width=800,height=800,toolbar=0,resizable=0')
}
}
render() {
const {options, devices, midichannels} = this
return (
<Row tabIndex={0} onKeyDown={this.onKeyDown.bind(this)} onKeyUp={this.onKeyUp.bind(this)}
ref={ref => this.root.current = ref}>
<Col>
<Row style={{marginBottom: 5}}>
<Col className={this.state.csndstatus}>Csound {this.state.csoundLoaded}</Col>
<Col>
{!this.state.started ?
<Button onClick={this.handleStart.bind(this)}>audio context paused - click here</Button> :
<div>audio enabled</div>
}
</Col>
{this.state.midi ? (
<>
<Col>
<Select onChange={this.handleMidiSelect.bind(this)} options={devices} value={this.state.currentDevice}
isClearable={false} isSearchable={false} className="tunselect"/>
</Col>
<Col>
<Select onChange={this.onChannelChange.bind(this)} options={midichannels}
value={this.state.midichannel}
isClearable={false} isSearchable={false} className="tunselect"/>
</Col>
</>
) : <Col>{this.state.midierr}</Col>
}
{this.props.osc ? <Col>{this.state.oscmsg}</Col> : ""}
<Col>
<Select onChange={this.handleSelect} options={options} value={this.state.currentTuning}
isClearable={false} isSearchable={false} className="tunselect"/>
</Col>
</Row>
<Row><Col>
<Instrument osc={this.props.osc} inst={this.inst} onChange={this.handleUpdate.bind(this)}
ref={ref => this.instrument.current = ref}/>
</Col></Row>
<Row style={{marginBottom: 5}} noGutters="true" className="instfooter">
<Col style={{margin: 'auto', textAlign: 'left'}} md='auto'>Computer keyboard settings:</Col>
<Col style={{margin: 'auto', textAlign: 'right'}}>Vel: </Col>
<Col><HFader onChange={this.onVelChange.bind(this)} defval={100} min={0} max={127}
vals={[0, 20, 40, 60, 80, 100, 120]} step={1}/></Col>
<Col style={{margin: 'auto', textAlign: 'right'}}>Octave: </Col>
<Col><HFader onChange={this.onOctaveChange.bind(this)} min={0} max={9} defval={5}
vals={[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]} step={1}/></Col>
{this.props.keyboard ? (
<Col style={{margin: 'auto'}}>
<Button onClick={this.onOpenKeyboard.bind(this)} variant="secondary">Open screen keyboard</Button>
</Col>
) : ""
}
</Row>
</Col>
</Row>
)
}
}
export default CsoundInstr
| 29.556901 | 120 | 0.574097 |
1d2fd9566e7776fc7d175e1795517fe1a5cde991 | 606 | js | JavaScript | src/services/order.js | huwolai/hwlmanager | 6b7cf94164ada366a3c4695bad5fbe58104da900 | [
"MIT"
] | null | null | null | src/services/order.js | huwolai/hwlmanager | 6b7cf94164ada366a3c4695bad5fbe58104da900 | [
"MIT"
] | null | null | null | src/services/order.js | huwolai/hwlmanager | 6b7cf94164ada366a3c4695bad5fbe58104da900 | [
"MIT"
] | null | null | null | import xFetch from './xFetch';
import config from './config';
//获取订单列表
export async function getOrders({
page_index,
page_size
}) {
return xFetch(`${config.shopapi.url}/admin/orders?page_index=${page_index}&page_size=${page_size}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
"app_id": `${config.shopapi.appid}`
}
})
}
// 获取订单详情
export async function getOrderDetail({
order_no
}) {
return xFetch(`${config.shopapi.url}/order/${order_no}/detail`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
"app_id": `${config.shopapi.appid}`
}
})
} | 20.2 | 102 | 0.660066 |
1d2ff37e9e9030ae0faa43d73558534b80ffbc4a | 2,245 | js | JavaScript | client/src/pages/WatchVideo.js | rockyery/react-youtube | bf1ce793f64b4e78729d9526b16f8db5352f2a25 | [
"Apache-2.0"
] | null | null | null | client/src/pages/WatchVideo.js | rockyery/react-youtube | bf1ce793f64b4e78729d9526b16f8db5352f2a25 | [
"Apache-2.0"
] | null | null | null | client/src/pages/WatchVideo.js | rockyery/react-youtube | bf1ce793f64b4e78729d9526b16f8db5352f2a25 | [
"Apache-2.0"
] | null | null | null | // @ts-nocheck
import React from "react";
import AddComment from "../components/AddComment";
import { DislikeIcon, LikeIcon } from "../components/Icons";
import NoResults from "../components/NoResults";
import VideoPlayer from "../components/VideoPlayer";
import Button from "../styles/Button";
import Wrapper from "../styles/WatchVideo";
function WatchVideo() {
const is404 = true;
if (is404) {
return (
<NoResults
title="Page not found"
text="The page you are looking for is not found or it may have been removed"
/>
);
}
return (
<Wrapper filledLike={true} filledDislike={false}>
<div className="video-container">
<div className="video">
<VideoPlayer />
</div>
<div className="video-info">
<h3>Title</h3>
<div className="video-info-stats">
<p>
<span>Views views</span> <span>•</span>{" "}
<span>Premiered createdAt</span>
</p>
<div className="likes-dislikes flex-row">
<p className="flex-row like">
<LikeIcon /> <span>Likes Count</span>
</p>
<p className="flex-row dislike" style={{ marginLeft: "1rem" }}>
<DislikeIcon /> <span>Dislikes Count</span>
</p>
</div>
</div>
</div>
<div className="channel-info-description">
<div className="channel-info-flex">
<div className="channel-info flex-row">
<img
className="avatar md"
src="https://dummyimage.com/100x100"
alt="channel avatar"
/>
<div className="channel-info-meta">
<h4>Username</h4>
<span className="secondary small">
SubscribersCount subscribers
</span>
</div>
</div>
<Button>Subscribe</Button>
</div>
<p>Description</p>
</div>
<AddComment />
</div>
<div className="related-videos">
<h3 className="up-next">Up Next</h3>
Up Next Videos
</div>
</Wrapper>
);
}
export default WatchVideo;
| 27.048193 | 84 | 0.519822 |
1d30115aba7cd99974e8dcd9382a09dd2cd7b809 | 2,353 | js | JavaScript | src/app/collectible-view.component.js | kellygmoore/thirty-day-github-challenge | 22b61bdeb5f2df3b988b67fb0af194e4152eadc4 | [
"MIT"
] | null | null | null | src/app/collectible-view.component.js | kellygmoore/thirty-day-github-challenge | 22b61bdeb5f2df3b988b67fb0af194e4152eadc4 | [
"MIT"
] | null | null | null | src/app/collectible-view.component.js | kellygmoore/thirty-day-github-challenge | 22b61bdeb5f2df3b988b67fb0af194e4152eadc4 | [
"MIT"
] | null | null | null | "use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var collectible_1 = require('./collectible');
var collectible_data_service_1 = require('./collectible-data.service');
var CollectibleViewComponent = (function () {
function CollectibleViewComponent(collectibleDataService) {
this.collectibleDataService = collectibleDataService;
this.newCollectible = new collectible_1.Collectible();
}
CollectibleViewComponent.prototype.addCollectible = function () {
console.log("In collectible-view component export addCollectible.");
this.collectibleDataService.addCollectible(this.newCollectible);
this.newCollectible = new collectible_1.Collectible();
};
Object.defineProperty(CollectibleViewComponent.prototype, "collectibles", {
get: function () {
return this.collectibleDataService.getAllCollectibles();
},
enumerable: true,
configurable: true
});
CollectibleViewComponent.prototype.ngOnInit = function () {
};
CollectibleViewComponent = __decorate([
core_1.Component({
//moduleId: module.id,
selector: 'collectible-view',
templateUrl: './collectible-view.component.html',
providers: [collectible_data_service_1.CollectibleDataService]
}),
__metadata('design:paramtypes', [collectible_data_service_1.CollectibleDataService])
], CollectibleViewComponent);
return CollectibleViewComponent;
}());
exports.CollectibleViewComponent = CollectibleViewComponent;
//# sourceMappingURL=collectible-view.component.js.map | 52.288889 | 150 | 0.681683 |